@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
17 | 17 | // Load WP_List_Table if not loaded |
18 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
19 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
18 | +if ( ! class_exists('WP_List_Table')) { |
|
19 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | global $status, $page; |
46 | 46 | |
47 | 47 | // Set parent defaults |
48 | - parent::__construct( array( |
|
49 | - 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
50 | - 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
48 | + parent::__construct(array( |
|
49 | + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records |
|
50 | + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records |
|
51 | 51 | 'ajax' => false // Does this table support ajax? |
52 | - ) ); |
|
52 | + )); |
|
53 | 53 | |
54 | 54 | } |
55 | 55 | |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return string Column Name |
66 | 66 | */ |
67 | - public function column_default( $item, $column_name ) { |
|
68 | - $donation_list_page_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); |
|
67 | + public function column_default($item, $column_name) { |
|
68 | + $donation_list_page_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history'); |
|
69 | 69 | |
70 | - switch ( $column_name ) { |
|
70 | + switch ($column_name) { |
|
71 | 71 | case 'complete_sales': |
72 | - $value = $item[ $column_name ] ? |
|
72 | + $value = $item[$column_name] ? |
|
73 | 73 | sprintf( |
74 | 74 | '<a href="%s">%s</a>', |
75 | 75 | add_query_arg( |
@@ -79,13 +79,12 @@ discard block |
||
79 | 79 | ), |
80 | 80 | $donation_list_page_url |
81 | 81 | ), |
82 | - $item[ $column_name ] |
|
83 | - ) : |
|
84 | - $item[ $column_name ]; |
|
82 | + $item[$column_name] |
|
83 | + ) : $item[$column_name]; |
|
85 | 84 | break; |
86 | 85 | |
87 | 86 | case 'pending_sales': |
88 | - $value = $item[ $column_name ] ? |
|
87 | + $value = $item[$column_name] ? |
|
89 | 88 | sprintf( |
90 | 89 | '<a href="%s">%s</a>', |
91 | 90 | add_query_arg( |
@@ -95,13 +94,12 @@ discard block |
||
95 | 94 | ), |
96 | 95 | $donation_list_page_url |
97 | 96 | ), |
98 | - $item[ $column_name ] |
|
99 | - ) : |
|
100 | - $item[ $column_name ]; |
|
97 | + $item[$column_name] |
|
98 | + ) : $item[$column_name]; |
|
101 | 99 | break; |
102 | 100 | |
103 | 101 | case 'total_sales': |
104 | - $value = $item[ $column_name ] ? |
|
102 | + $value = $item[$column_name] ? |
|
105 | 103 | sprintf( |
106 | 104 | '<a href="%s">%s</a>', |
107 | 105 | add_query_arg( |
@@ -110,14 +108,13 @@ discard block |
||
110 | 108 | ), |
111 | 109 | $donation_list_page_url |
112 | 110 | ), |
113 | - $item[ $column_name ] |
|
114 | - ) : |
|
115 | - $item[ $column_name ]; |
|
111 | + $item[$column_name] |
|
112 | + ) : $item[$column_name]; |
|
116 | 113 | |
117 | 114 | break; |
118 | 115 | |
119 | 116 | default: |
120 | - $value = $item[ $column_name ]; |
|
117 | + $value = $item[$column_name]; |
|
121 | 118 | } |
122 | 119 | |
123 | 120 | return $value; |
@@ -132,11 +129,11 @@ discard block |
||
132 | 129 | */ |
133 | 130 | public function get_columns() { |
134 | 131 | $columns = array( |
135 | - 'label' => esc_attr__( 'Gateway', 'give' ), |
|
136 | - 'complete_sales' => esc_attr__( 'Complete Payments', 'give' ), |
|
137 | - 'pending_sales' => esc_attr__( 'Pending / Failed Payments', 'give' ), |
|
138 | - 'total_sales' => esc_attr__( 'Total Payments', 'give' ), |
|
139 | - 'total_donations' => esc_attr__( 'Total Donated', 'give' ) |
|
132 | + 'label' => esc_attr__('Gateway', 'give'), |
|
133 | + 'complete_sales' => esc_attr__('Complete Payments', 'give'), |
|
134 | + 'pending_sales' => esc_attr__('Pending / Failed Payments', 'give'), |
|
135 | + 'total_sales' => esc_attr__('Total Payments', 'give'), |
|
136 | + 'total_donations' => esc_attr__('Total Donated', 'give') |
|
140 | 137 | ); |
141 | 138 | |
142 | 139 | return $columns; |
@@ -151,7 +148,7 @@ discard block |
||
151 | 148 | */ |
152 | 149 | public function get_sortable_columns() { |
153 | 150 | return array( |
154 | - 'total_donations' => array( 'total_donations', false ) |
|
151 | + 'total_donations' => array('total_donations', false) |
|
155 | 152 | ); |
156 | 153 | } |
157 | 154 | |
@@ -164,7 +161,7 @@ discard block |
||
164 | 161 | * @return int Current page number |
165 | 162 | */ |
166 | 163 | public function get_paged() { |
167 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
164 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
168 | 165 | } |
169 | 166 | |
170 | 167 | |
@@ -175,7 +172,7 @@ discard block |
||
175 | 172 | * @since 1.0 |
176 | 173 | * @return void |
177 | 174 | */ |
178 | - public function bulk_actions( $which = '' ) { |
|
175 | + public function bulk_actions($which = '') { |
|
179 | 176 | |
180 | 177 | } |
181 | 178 | |
@@ -187,27 +184,27 @@ discard block |
||
187 | 184 | * |
188 | 185 | * @param string $which |
189 | 186 | */ |
190 | - protected function display_tablenav( $which ) { |
|
187 | + protected function display_tablenav($which) { |
|
191 | 188 | |
192 | - if ( 'top' === $which ) { |
|
193 | - wp_nonce_field( 'bulk-' . $this->_args['plural'] ); |
|
189 | + if ('top' === $which) { |
|
190 | + wp_nonce_field('bulk-'.$this->_args['plural']); |
|
194 | 191 | } |
195 | 192 | ?> |
196 | - <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr( $which ); ?>"> |
|
193 | + <div class="tablenav gateways-report-tablenav give-clearfix <?php echo esc_attr($which); ?>"> |
|
197 | 194 | |
198 | - <?php if ( 'top' === $which ) { ?> |
|
195 | + <?php if ('top' === $which) { ?> |
|
199 | 196 | <h2 class="alignleft reports-earnings-title screen-reader-text"> |
200 | - <?php _e( 'Donation Methods Report', 'give' ); ?> |
|
197 | + <?php _e('Donation Methods Report', 'give'); ?> |
|
201 | 198 | </h2> |
202 | 199 | <?php } ?> |
203 | 200 | |
204 | 201 | <div class="alignright tablenav-right"> |
205 | 202 | <div class="actions bulkactions"> |
206 | - <?php $this->bulk_actions( $which ); ?> |
|
203 | + <?php $this->bulk_actions($which); ?> |
|
207 | 204 | </div> |
208 | 205 | <?php |
209 | - $this->extra_tablenav( $which ); |
|
210 | - $this->pagination( $which ); |
|
206 | + $this->extra_tablenav($which); |
|
207 | + $this->pagination($which); |
|
211 | 208 | ?> |
212 | 209 | </div> |
213 | 210 | |
@@ -229,17 +226,17 @@ discard block |
||
229 | 226 | * |
230 | 227 | * @return int |
231 | 228 | */ |
232 | - public function give_sort_total_donations( $old_value, $new_value ) { |
|
229 | + public function give_sort_total_donations($old_value, $new_value) { |
|
233 | 230 | // If no sort, default to label. |
234 | - $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'label'; |
|
231 | + $orderby = ( ! empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'label'; |
|
235 | 232 | |
236 | 233 | //If no order, default to asc. |
237 | - $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'asc'; |
|
234 | + $order = ( ! empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; |
|
238 | 235 | |
239 | 236 | //Determine sort order. |
240 | - $result = strcmp( $old_value[ $orderby ], $new_value[ $orderby ] ); |
|
237 | + $result = strcmp($old_value[$orderby], $new_value[$orderby]); |
|
241 | 238 | |
242 | - return ( $order === 'asc' ) ? $result : -$result; |
|
239 | + return ($order === 'asc') ? $result : -$result; |
|
243 | 240 | } |
244 | 241 | |
245 | 242 | |
@@ -256,10 +253,10 @@ discard block |
||
256 | 253 | $gateways = give_get_payment_gateways(); |
257 | 254 | $stats = new Give_Payment_Stats(); |
258 | 255 | |
259 | - foreach ( $gateways as $gateway_id => $gateway ) { |
|
256 | + foreach ($gateways as $gateway_id => $gateway) { |
|
260 | 257 | |
261 | - $complete_count = give_count_sales_by_gateway( $gateway_id, 'publish' ); |
|
262 | - $pending_count = give_count_sales_by_gateway( $gateway_id, array( 'pending', 'failed' ) ); |
|
258 | + $complete_count = give_count_sales_by_gateway($gateway_id, 'publish'); |
|
259 | + $pending_count = give_count_sales_by_gateway($gateway_id, array('pending', 'failed')); |
|
263 | 260 | |
264 | 261 | $reports_data[] = array( |
265 | 262 | 'ID' => $gateway_id, |
@@ -267,7 +264,7 @@ discard block |
||
267 | 264 | 'complete_sales' => $complete_count, |
268 | 265 | 'pending_sales' => $pending_count, |
269 | 266 | 'total_sales' => $complete_count + $pending_count, |
270 | - 'total_donations' => give_currency_filter( give_format_amount( $stats->get_earnings( 0, strtotime('04/13/2015' ), current_time('timestamp' ), $gateway_id ), array( 'sanitize' => false ) ) ), |
|
267 | + 'total_donations' => give_currency_filter(give_format_amount($stats->get_earnings(0, strtotime('04/13/2015'), current_time('timestamp'), $gateway_id), array('sanitize' => false))), |
|
271 | 268 | ); |
272 | 269 | } |
273 | 270 | |
@@ -288,11 +285,11 @@ discard block |
||
288 | 285 | $columns = $this->get_columns(); |
289 | 286 | $hidden = array(); // No hidden columns |
290 | 287 | $sortable = $this->get_sortable_columns(); |
291 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
288 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
292 | 289 | $this->items = $this->reports_data(); |
293 | 290 | |
294 | 291 | // Sort Array when we are sorting data in array. |
295 | - usort( $this->items, array( $this, 'give_sort_total_donations' ) ); |
|
292 | + usort($this->items, array($this, 'give_sort_total_donations')); |
|
296 | 293 | |
297 | 294 | } |
298 | 295 | } |
@@ -70,24 +70,24 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @param array $args |
72 | 72 | */ |
73 | - public function register( $args ) { |
|
73 | + public function register($args) { |
|
74 | 74 | $args_default = array( |
75 | 75 | 'id' => '', |
76 | 76 | 'version' => '', |
77 | 77 | 'callback' => '', |
78 | 78 | ); |
79 | 79 | |
80 | - $args = wp_parse_args( $args, $args_default ); |
|
80 | + $args = wp_parse_args($args, $args_default); |
|
81 | 81 | |
82 | 82 | // You can only register database upgrade. |
83 | 83 | $args['type'] = 'database'; |
84 | 84 | |
85 | 85 | // Bailout. |
86 | - if ( empty( $args['id'] ) || empty( $args['version'] ) || empty( $args['callback'] ) || ! is_callable( $args['callback'] ) ) { |
|
86 | + if (empty($args['id']) || empty($args['version']) || empty($args['callback']) || ! is_callable($args['callback'])) { |
|
87 | 87 | return; |
88 | 88 | } |
89 | 89 | |
90 | - $this->updates[ $args['type'] ][] = $args; |
|
90 | + $this->updates[$args['type']][] = $args; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -102,32 +102,32 @@ discard block |
||
102 | 102 | * |
103 | 103 | * @return array |
104 | 104 | */ |
105 | - public function get_updates( $update_type = '', $status = 'all' ) { |
|
105 | + public function get_updates($update_type = '', $status = 'all') { |
|
106 | 106 | // return all updates. |
107 | - if ( empty( $update_type ) ) { |
|
107 | + if (empty($update_type)) { |
|
108 | 108 | return $this->updates; |
109 | 109 | } |
110 | 110 | |
111 | 111 | // Get specific update. |
112 | - $updates = ! empty( $this->updates[ $update_type ] ) ? $this->updates[ $update_type ] : array(); |
|
112 | + $updates = ! empty($this->updates[$update_type]) ? $this->updates[$update_type] : array(); |
|
113 | 113 | |
114 | 114 | // Bailout. |
115 | - if ( empty( $updates ) ) { |
|
115 | + if (empty($updates)) { |
|
116 | 116 | return $updates; |
117 | 117 | } |
118 | 118 | |
119 | - switch ( $status ) { |
|
119 | + switch ($status) { |
|
120 | 120 | case 'new': |
121 | 121 | // Remove already completed updates. |
122 | 122 | $completed_updates = give_get_completed_upgrades(); |
123 | 123 | |
124 | - if ( ! empty( $completed_updates ) ) { |
|
125 | - foreach ( $updates as $index => $update ) { |
|
126 | - if ( in_array( $update['id'], $completed_updates ) ) { |
|
127 | - unset( $updates[ $index ] ); |
|
124 | + if ( ! empty($completed_updates)) { |
|
125 | + foreach ($updates as $index => $update) { |
|
126 | + if (in_array($update['id'], $completed_updates)) { |
|
127 | + unset($updates[$index]); |
|
128 | 128 | } |
129 | 129 | } |
130 | - $updates = array_values( $updates ); |
|
130 | + $updates = array_values($updates); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | break; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @return static |
145 | 145 | */ |
146 | 146 | static function get_instance() { |
147 | - if ( is_null( self::$instance ) ) { |
|
147 | + if (is_null(self::$instance)) { |
|
148 | 148 | self::$instance = new self(); |
149 | 149 | } |
150 | 150 | |
@@ -162,16 +162,16 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * Setup hooks. |
164 | 164 | */ |
165 | - add_action( 'init', array( $this, '__register_upgrade' ), 9999 ); |
|
166 | - add_action( 'admin_init', array( $this, '__change_donations_label' ), 9999 ); |
|
167 | - add_action( 'admin_menu', array( $this, '__register_menu' ), 9999 ); |
|
168 | - add_action( 'give_set_upgrade_completed', array( $this, '__flush_resume_updates' ), 9999 ); |
|
169 | - add_action( 'wp_ajax_give_do_ajax_updates', array( $this, '__give_ajax_updates' ) ); |
|
165 | + add_action('init', array($this, '__register_upgrade'), 9999); |
|
166 | + add_action('admin_init', array($this, '__change_donations_label'), 9999); |
|
167 | + add_action('admin_menu', array($this, '__register_menu'), 9999); |
|
168 | + add_action('give_set_upgrade_completed', array($this, '__flush_resume_updates'), 9999); |
|
169 | + add_action('wp_ajax_give_do_ajax_updates', array($this, '__give_ajax_updates')); |
|
170 | 170 | |
171 | 171 | /** |
172 | 172 | * Load file |
173 | 173 | */ |
174 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
174 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | $addons = give_get_plugins(); |
185 | 185 | $plugin_updates = get_plugin_updates(); |
186 | 186 | |
187 | - foreach ( $addons as $key => $info ) { |
|
188 | - if ( 'active' != $info['Status'] || 'add-on' != $info['Type'] || empty( $plugin_updates[ $key ] ) ) { |
|
187 | + foreach ($addons as $key => $info) { |
|
188 | + if ('active' != $info['Status'] || 'add-on' != $info['Type'] || empty($plugin_updates[$key])) { |
|
189 | 189 | continue; |
190 | 190 | } |
191 | 191 | |
192 | - $this->updates['plugin'][] = array_merge( $info, (array) $plugin_updates[ $key ] ); |
|
192 | + $this->updates['plugin'][] = array_merge($info, (array) $plugin_updates[$key]); |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * @access public |
202 | 202 | */ |
203 | 203 | public function __register_upgrade() { |
204 | - if ( ! is_admin() ) { |
|
204 | + if ( ! is_admin()) { |
|
205 | 205 | return; |
206 | 206 | } |
207 | 207 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * |
211 | 211 | * @since 1.8.12 |
212 | 212 | */ |
213 | - do_action( 'give_register_updates', $this ); |
|
213 | + do_action('give_register_updates', $this); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
@@ -224,17 +224,17 @@ discard block |
||
224 | 224 | global $submenu; |
225 | 225 | |
226 | 226 | // Bailout. |
227 | - if ( empty( $menu ) || ! $this->get_update_count() ) { |
|
227 | + if (empty($menu) || ! $this->get_update_count()) { |
|
228 | 228 | return; |
229 | 229 | } |
230 | 230 | |
231 | - foreach ( $menu as $index => $menu_item ) { |
|
232 | - if ( 'edit.php?post_type=give_forms' !== $menu_item[2] ) { |
|
231 | + foreach ($menu as $index => $menu_item) { |
|
232 | + if ('edit.php?post_type=give_forms' !== $menu_item[2]) { |
|
233 | 233 | continue; |
234 | 234 | } |
235 | 235 | |
236 | - $menu[ $index ][0] = sprintf( |
|
237 | - __( 'Donations %s', 'give' ), |
|
236 | + $menu[$index][0] = sprintf( |
|
237 | + __('Donations %s', 'give'), |
|
238 | 238 | sprintf( |
239 | 239 | '<span class="update-plugins count-%1$d"><span class="plugin-count">%1$d</span></span>', |
240 | 240 | $this->get_update_count() |
@@ -259,15 +259,15 @@ discard block |
||
259 | 259 | // Bailout. |
260 | 260 | if ( ! $this->get_update_count()) { |
261 | 261 | // Show complete update message if still on update setting page. |
262 | - if ( isset($_GET['page']) && 'give-updates' === $_GET['page'] ) { |
|
262 | + if (isset($_GET['page']) && 'give-updates' === $_GET['page']) { |
|
263 | 263 | // Upgrades |
264 | 264 | add_submenu_page( |
265 | 265 | 'edit.php?post_type=give_forms', |
266 | - esc_html__( 'Give Updates Complete', 'give' ), |
|
267 | - __( 'Updates', 'give' ), |
|
266 | + esc_html__('Give Updates Complete', 'give'), |
|
267 | + __('Updates', 'give'), |
|
268 | 268 | 'manage_give_settings', |
269 | 269 | 'give-updates', |
270 | - array( $this, 'render_complete_page' ) |
|
270 | + array($this, 'render_complete_page') |
|
271 | 271 | ); |
272 | 272 | } |
273 | 273 | |
@@ -277,15 +277,15 @@ discard block |
||
277 | 277 | // Upgrades |
278 | 278 | add_submenu_page( |
279 | 279 | 'edit.php?post_type=give_forms', |
280 | - esc_html__( 'Give Updates', 'give' ), |
|
280 | + esc_html__('Give Updates', 'give'), |
|
281 | 281 | sprintf( |
282 | 282 | '%1$s <span class="update-plugins count-%2$d"><span class="plugin-count">%2$d</span></span>', |
283 | - __( 'Updates', 'give' ), |
|
283 | + __('Updates', 'give'), |
|
284 | 284 | $this->get_update_count() |
285 | 285 | ), |
286 | 286 | 'manage_give_settings', |
287 | 287 | 'give-updates', |
288 | - array( $this, 'render_page' ) |
|
288 | + array($this, 'render_page') |
|
289 | 289 | ); |
290 | 290 | } |
291 | 291 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | * @return int |
299 | 299 | */ |
300 | 300 | public function get_db_update_count() { |
301 | - return count( $this->get_updates( 'database', 'new' ) ); |
|
301 | + return count($this->get_updates('database', 'new')); |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | /** |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | * @return int |
311 | 311 | */ |
312 | 312 | public function get_total_db_update_count() { |
313 | - return count( $this->get_updates( 'database', 'all' ) ); |
|
313 | + return count($this->get_updates('database', 'all')); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * @access public |
321 | 321 | */ |
322 | 322 | public function render_complete_page() { |
323 | - include_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/views/upgrades-complete.php'; |
|
323 | + include_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/views/upgrades-complete.php'; |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | /** |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * @access public |
331 | 331 | */ |
332 | 332 | public function render_page() { |
333 | - include_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/views/upgrades.php'; |
|
333 | + include_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/views/upgrades.php'; |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | * @return int |
342 | 342 | */ |
343 | 343 | public function get_plugin_update_count() { |
344 | - return count( $this->get_updates( 'plugin' ) ); |
|
344 | + return count($this->get_updates('plugin')); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $db_update_count = $this->get_db_update_count(); |
357 | 357 | $plugin_update_count = $this->get_plugin_update_count(); |
358 | 358 | |
359 | - return ( $db_update_count + $plugin_update_count ); |
|
359 | + return ($db_update_count + $plugin_update_count); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | |
@@ -367,12 +367,12 @@ discard block |
||
367 | 367 | * @access public |
368 | 368 | */ |
369 | 369 | public function __flush_resume_updates() { |
370 | - delete_option( 'give_doing_upgrade' ); |
|
371 | - update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) ); |
|
370 | + delete_option('give_doing_upgrade'); |
|
371 | + update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION)); |
|
372 | 372 | |
373 | 373 | // Reset counter. |
374 | 374 | $this->step = $this->percentage = 0; |
375 | - ++ $this->update; |
|
375 | + ++$this->update; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | /** |
@@ -383,24 +383,24 @@ discard block |
||
383 | 383 | */ |
384 | 384 | public function __give_ajax_updates() { |
385 | 385 | // Check permission. |
386 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
386 | + if ( ! current_user_can('manage_give_settings')) { |
|
387 | 387 | $this->send_ajax_response( |
388 | 388 | array( |
389 | - 'message' => esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), |
|
389 | + 'message' => esc_html__('You do not have permission to do Give upgrades.', 'give'), |
|
390 | 390 | ), |
391 | 391 | 'error' |
392 | 392 | ); |
393 | 393 | } |
394 | 394 | |
395 | 395 | // Set params. |
396 | - $this->step = absint( $_POST['step'] ); |
|
397 | - $this->update = absint( $_POST['update'] ); |
|
396 | + $this->step = absint($_POST['step']); |
|
397 | + $this->update = absint($_POST['update']); |
|
398 | 398 | |
399 | 399 | // Bailout: step and update must be positive and greater then zero. |
400 | - if ( ! $this->step ) { |
|
400 | + if ( ! $this->step) { |
|
401 | 401 | $this->send_ajax_response( |
402 | 402 | array( |
403 | - 'message' => __( 'Please reload this page and try again', 'give' ), |
|
403 | + 'message' => __('Please reload this page and try again', 'give'), |
|
404 | 404 | 'heading' => '', |
405 | 405 | 'percentage' => 0, |
406 | 406 | ), |
@@ -409,14 +409,14 @@ discard block |
||
409 | 409 | } |
410 | 410 | |
411 | 411 | // Get updates. |
412 | - $updates = $this->get_updates( 'database', 'new' ); |
|
412 | + $updates = $this->get_updates('database', 'new'); |
|
413 | 413 | |
414 | 414 | // Bailout if we do not have nay updates. |
415 | - if ( empty( $updates ) ) { |
|
415 | + if (empty($updates)) { |
|
416 | 416 | $this->send_ajax_response( |
417 | 417 | array( |
418 | - 'message' => __( 'The database is already up to date.', 'give' ), |
|
419 | - 'heading' => __( 'Updates Completed.', 'give' ), |
|
418 | + 'message' => __('The database is already up to date.', 'give'), |
|
419 | + 'heading' => __('Updates Completed.', 'give'), |
|
420 | 420 | 'percentage' => 0, |
421 | 421 | ), |
422 | 422 | 'success' |
@@ -424,26 +424,26 @@ discard block |
||
424 | 424 | } |
425 | 425 | |
426 | 426 | // Process update. |
427 | - foreach ( $updates as $index => $update ) { |
|
427 | + foreach ($updates as $index => $update) { |
|
428 | 428 | // Check if update depend upon any other update. |
429 | - if ( ! empty( $update['depend'] ) && ! give_has_upgrade_completed( $update['depend'] ) ) { |
|
429 | + if ( ! empty($update['depend']) && ! give_has_upgrade_completed($update['depend'])) { |
|
430 | 430 | continue; |
431 | 431 | } |
432 | 432 | |
433 | 433 | // Run update. |
434 | - if ( is_array( $update['callback'] ) ) { |
|
434 | + if (is_array($update['callback'])) { |
|
435 | 435 | $update['callback'][0]->$update['callback'][1](); |
436 | 436 | } else { |
437 | 437 | $update['callback'](); |
438 | 438 | } |
439 | 439 | |
440 | 440 | // Check if current update completed or not. |
441 | - if ( give_has_upgrade_completed( $update['id'] ) ) { |
|
442 | - if ( 1 === count( $updates ) ) { |
|
441 | + if (give_has_upgrade_completed($update['id'])) { |
|
442 | + if (1 === count($updates)) { |
|
443 | 443 | $this->send_ajax_response( |
444 | 444 | array( |
445 | - 'message' => __( 'Database updated successfully.', 'give' ), |
|
446 | - 'heading' => __( 'Updates Completed.', 'give' ), |
|
445 | + 'message' => __('Database updated successfully.', 'give'), |
|
446 | + 'heading' => __('Updates Completed.', 'give'), |
|
447 | 447 | 'percentage' => 0, |
448 | 448 | ), |
449 | 449 | 'success' |
@@ -453,16 +453,16 @@ discard block |
||
453 | 453 | |
454 | 454 | $doing_upgrade_args = array( |
455 | 455 | 'update_info' => $update, |
456 | - 'step' => ++ $this->step, |
|
456 | + 'step' => ++$this->step, |
|
457 | 457 | 'update' => $this->update, |
458 | - 'heading' => sprintf( 'Update %s of {update_count}', $this->update ), |
|
458 | + 'heading' => sprintf('Update %s of {update_count}', $this->update), |
|
459 | 459 | 'percentage' => $this->percentage, |
460 | 460 | ); |
461 | 461 | |
462 | 462 | // Cache upgrade. |
463 | - update_option( 'give_doing_upgrade', $doing_upgrade_args ); |
|
463 | + update_option('give_doing_upgrade', $doing_upgrade_args); |
|
464 | 464 | |
465 | - $this->send_ajax_response( $doing_upgrade_args ); |
|
465 | + $this->send_ajax_response($doing_upgrade_args); |
|
466 | 466 | }// End foreach(). |
467 | 467 | } |
468 | 468 | |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | * @param $data |
476 | 476 | * @param string $type |
477 | 477 | */ |
478 | - public function send_ajax_response( $data, $type = '' ) { |
|
478 | + public function send_ajax_response($data, $type = '') { |
|
479 | 479 | $default = array( |
480 | 480 | 'message' => '', |
481 | 481 | 'heading' => '', |
@@ -485,21 +485,21 @@ discard block |
||
485 | 485 | ); |
486 | 486 | |
487 | 487 | // Set data. |
488 | - $data = wp_parse_args( $data, $default ); |
|
488 | + $data = wp_parse_args($data, $default); |
|
489 | 489 | |
490 | - switch ( $type ) { |
|
490 | + switch ($type) { |
|
491 | 491 | case 'success': |
492 | - wp_send_json_success( $data ); |
|
492 | + wp_send_json_success($data); |
|
493 | 493 | break; |
494 | 494 | |
495 | 495 | case 'error': |
496 | - wp_send_json_error( $data ); |
|
496 | + wp_send_json_error($data); |
|
497 | 497 | break; |
498 | 498 | |
499 | 499 | default: |
500 | - wp_send_json( array( |
|
500 | + wp_send_json(array( |
|
501 | 501 | 'data' => $data, |
502 | - ) ); |
|
502 | + )); |
|
503 | 503 | break; |
504 | 504 | } |
505 | 505 | } |
@@ -516,8 +516,8 @@ discard block |
||
516 | 516 | public function resume_updates() { |
517 | 517 | $status = false; |
518 | 518 | |
519 | - if ( $update = get_option( 'give_doing_upgrade' ) ) { |
|
520 | - $status = ! empty( $update['step'] ) ? $update['step'] : $status; |
|
519 | + if ($update = get_option('give_doing_upgrade')) { |
|
520 | + $status = ! empty($update['step']) ? $update['step'] : $status; |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | return $status; |
@@ -533,12 +533,12 @@ discard block |
||
533 | 533 | * @param $total |
534 | 534 | * @param $current_total |
535 | 535 | */ |
536 | - public function set_percentage( $total, $current_total ) { |
|
536 | + public function set_percentage($total, $current_total) { |
|
537 | 537 | // Set percentage. |
538 | - $this->percentage = $total ? ( ( $current_total ) / $total ) * 100 : 0; |
|
538 | + $this->percentage = $total ? (($current_total) / $total) * 100 : 0; |
|
539 | 539 | |
540 | 540 | // Verify percentage. |
541 | - $this->percentage = ( 100 < $this->percentage ) ? 100 : $this->percentage; |
|
541 | + $this->percentage = (100 < $this->percentage) ? 100 : $this->percentage; |
|
542 | 542 | } |
543 | 543 | } |
544 | 544 |
@@ -10,17 +10,17 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | ?> |
17 | 17 | <div class="wrap" id="poststuff"> |
18 | 18 | <div id="give-updates"> |
19 | - <h1 id="give-updates-h1"><?php esc_html_e( 'Give - Updates Complete', 'give' ); ?></h1> |
|
19 | + <h1 id="give-updates-h1"><?php esc_html_e('Give - Updates Complete', 'give'); ?></h1> |
|
20 | 20 | <hr class="wp-header-end"> |
21 | 21 | |
22 | 22 | <div class="give-update-panel-content"> |
23 | - <p><?php esc_html_e( 'Congratulations! You are running the latest versions of Give and its add-ons.', 'give' ); ?></p> |
|
23 | + <p><?php esc_html_e('Congratulations! You are running the latest versions of Give and its add-ons.', 'give'); ?></p> |
|
24 | 24 | </div> |
25 | 25 | |
26 | 26 | </div> |
@@ -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 | |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | global $give_settings_page, $give_payments_page, $give_reports_page, $give_add_ons_page, $give_donors_page, $give_tools_page; |
33 | 33 | |
34 | 34 | //Payments |
35 | - $give_payment = get_post_type_object( 'give_payment' ); |
|
36 | - $give_payments_page = add_submenu_page( 'edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page' ); |
|
35 | + $give_payment = get_post_type_object('give_payment'); |
|
36 | + $give_payments_page = add_submenu_page('edit.php?post_type=give_forms', $give_payment->labels->name, $give_payment->labels->menu_name, 'edit_give_payments', 'give-payment-history', 'give_payment_history_page'); |
|
37 | 37 | |
38 | 38 | //Donors |
39 | - $give_donors_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Donors', 'give' ), esc_html__( 'Donors', 'give' ), 'view_give_reports', 'give-donors', 'give_donors_page' ); |
|
39 | + $give_donors_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Donors', 'give'), esc_html__('Donors', 'give'), 'view_give_reports', 'give-donors', 'give_donors_page'); |
|
40 | 40 | |
41 | 41 | //Reports` |
42 | 42 | $give_reports_page = add_submenu_page( |
43 | 43 | 'edit.php?post_type=give_forms', |
44 | - esc_html__( 'Donation Reports', 'give' ), |
|
45 | - esc_html__( 'Reports', 'give' ), |
|
44 | + esc_html__('Donation Reports', 'give'), |
|
45 | + esc_html__('Reports', 'give'), |
|
46 | 46 | 'view_give_reports', |
47 | 47 | 'give-reports', |
48 | 48 | array( |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | //Settings |
55 | 55 | $give_settings_page = add_submenu_page( |
56 | 56 | 'edit.php?post_type=give_forms', |
57 | - esc_html__( 'Give Settings', 'give' ), |
|
58 | - esc_html__( 'Settings', 'give' ), |
|
57 | + esc_html__('Give Settings', 'give'), |
|
58 | + esc_html__('Settings', 'give'), |
|
59 | 59 | 'manage_give_settings', |
60 | 60 | 'give-settings', |
61 | 61 | array( |
@@ -65,16 +65,16 @@ discard block |
||
65 | 65 | ); |
66 | 66 | |
67 | 67 | //Tools. |
68 | - $give_tools_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Tools', 'give' ), esc_html__( 'Tools', 'give' ), 'manage_give_settings', 'give-tools', array( |
|
68 | + $give_tools_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Tools', 'give'), esc_html__('Tools', 'give'), 'manage_give_settings', 'give-tools', array( |
|
69 | 69 | Give()->give_settings, |
70 | 70 | 'output' |
71 | - ) ); |
|
71 | + )); |
|
72 | 72 | |
73 | 73 | //Add-ons |
74 | - $give_add_ons_page = add_submenu_page( 'edit.php?post_type=give_forms', esc_html__( 'Give Add-ons', 'give' ), esc_html__( 'Add-ons', 'give' ), 'install_plugins', 'give-addons', 'give_add_ons_page' ); |
|
74 | + $give_add_ons_page = add_submenu_page('edit.php?post_type=give_forms', esc_html__('Give Add-ons', 'give'), esc_html__('Add-ons', 'give'), 'install_plugins', 'give-addons', 'give_add_ons_page'); |
|
75 | 75 | } |
76 | 76 | |
77 | -add_action( 'admin_menu', 'give_add_options_links', 10 ); |
|
77 | +add_action('admin_menu', 'give_add_options_links', 10); |
|
78 | 78 | |
79 | 79 | /** |
80 | 80 | * Determines whether the current admin page is a Give admin page. |
@@ -89,224 +89,224 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @return bool True if Give admin page. |
91 | 91 | */ |
92 | -function give_is_admin_page( $passed_page = '', $passed_view = '' ) { |
|
92 | +function give_is_admin_page($passed_page = '', $passed_view = '') { |
|
93 | 93 | |
94 | 94 | global $pagenow, $typenow; |
95 | 95 | |
96 | 96 | $found = false; |
97 | - $post_type = isset( $_GET['post_type'] ) ? strtolower( $_GET['post_type'] ) : false; |
|
98 | - $action = isset( $_GET['action'] ) ? strtolower( $_GET['action'] ) : false; |
|
99 | - $taxonomy = isset( $_GET['taxonomy'] ) ? strtolower( $_GET['taxonomy'] ) : false; |
|
100 | - $page = isset( $_GET['page'] ) ? strtolower( $_GET['page'] ) : false; |
|
101 | - $view = isset( $_GET['view'] ) ? strtolower( $_GET['view'] ) : false; |
|
102 | - $tab = isset( $_GET['tab'] ) ? strtolower( $_GET['tab'] ) : false; |
|
103 | - |
|
104 | - switch ( $passed_page ) { |
|
97 | + $post_type = isset($_GET['post_type']) ? strtolower($_GET['post_type']) : false; |
|
98 | + $action = isset($_GET['action']) ? strtolower($_GET['action']) : false; |
|
99 | + $taxonomy = isset($_GET['taxonomy']) ? strtolower($_GET['taxonomy']) : false; |
|
100 | + $page = isset($_GET['page']) ? strtolower($_GET['page']) : false; |
|
101 | + $view = isset($_GET['view']) ? strtolower($_GET['view']) : false; |
|
102 | + $tab = isset($_GET['tab']) ? strtolower($_GET['tab']) : false; |
|
103 | + |
|
104 | + switch ($passed_page) { |
|
105 | 105 | case 'give_forms': |
106 | - switch ( $passed_view ) { |
|
106 | + switch ($passed_view) { |
|
107 | 107 | case 'list-table': |
108 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' ) { |
|
108 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php') { |
|
109 | 109 | $found = true; |
110 | 110 | } |
111 | 111 | break; |
112 | 112 | case 'edit': |
113 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post.php' ) { |
|
113 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post.php') { |
|
114 | 114 | $found = true; |
115 | 115 | } |
116 | 116 | break; |
117 | 117 | case 'new': |
118 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'post-new.php' ) { |
|
118 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'post-new.php') { |
|
119 | 119 | $found = true; |
120 | 120 | } |
121 | 121 | break; |
122 | 122 | default: |
123 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) || 'give_forms' === $post_type || ( 'post-new.php' == $pagenow && 'give_forms' === $post_type ) ) { |
|
123 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) || 'give_forms' === $post_type || ('post-new.php' == $pagenow && 'give_forms' === $post_type)) { |
|
124 | 124 | $found = true; |
125 | 125 | } |
126 | 126 | break; |
127 | 127 | } |
128 | 128 | break; |
129 | 129 | case 'categories': |
130 | - switch ( $passed_view ) { |
|
130 | + switch ($passed_view) { |
|
131 | 131 | case 'list-table': |
132 | 132 | case 'new': |
133 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy ) { |
|
133 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_category' === $taxonomy) { |
|
134 | 134 | $found = true; |
135 | 135 | } |
136 | 136 | break; |
137 | 137 | case 'edit': |
138 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy ) { |
|
138 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_category' === $taxonomy) { |
|
139 | 139 | $found = true; |
140 | 140 | } |
141 | 141 | break; |
142 | 142 | default: |
143 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy ) { |
|
143 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_category' === $taxonomy) { |
|
144 | 144 | $found = true; |
145 | 145 | } |
146 | 146 | break; |
147 | 147 | } |
148 | 148 | break; |
149 | 149 | case 'tags': |
150 | - switch ( $passed_view ) { |
|
150 | + switch ($passed_view) { |
|
151 | 151 | case 'list-table': |
152 | 152 | case 'new': |
153 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy ) { |
|
153 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' !== $action && 'give_forms_tag' === $taxonomy) { |
|
154 | 154 | $found = true; |
155 | 155 | } |
156 | 156 | break; |
157 | 157 | case 'edit': |
158 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy ) { |
|
158 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'edit' === $action && 'give_forms_tag' === $taxonomy) { |
|
159 | 159 | $found = true; |
160 | 160 | } |
161 | 161 | break; |
162 | 162 | default: |
163 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy ) { |
|
163 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit-tags.php' && 'give_forms_tag' === $taxonomy) { |
|
164 | 164 | $found = true; |
165 | 165 | } |
166 | 166 | break; |
167 | 167 | } |
168 | 168 | break; |
169 | 169 | case 'payments': |
170 | - switch ( $passed_view ) { |
|
170 | + switch ($passed_view) { |
|
171 | 171 | case 'list-table': |
172 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view ) { |
|
172 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && false === $view) { |
|
173 | 173 | $found = true; |
174 | 174 | } |
175 | 175 | break; |
176 | 176 | case 'edit': |
177 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-payment-details' === $view ) { |
|
177 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page && 'view-payment-details' === $view) { |
|
178 | 178 | $found = true; |
179 | 179 | } |
180 | 180 | break; |
181 | 181 | default: |
182 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-payment-history' === $page ) { |
|
182 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-payment-history' === $page) { |
|
183 | 183 | $found = true; |
184 | 184 | } |
185 | 185 | break; |
186 | 186 | } |
187 | 187 | break; |
188 | 188 | case 'reports': |
189 | - switch ( $passed_view ) { |
|
189 | + switch ($passed_view) { |
|
190 | 190 | // If you want to do something like enqueue a script on a particular report's duration, look at $_GET[ 'range' ] |
191 | 191 | case 'earnings': |
192 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && ( 'earnings' === $view || '-1' === $view || false === $view ) ) { |
|
192 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && ('earnings' === $view || '-1' === $view || false === $view)) { |
|
193 | 193 | $found = true; |
194 | 194 | } |
195 | 195 | break; |
196 | 196 | case 'donors': |
197 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view ) { |
|
197 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'customers' === $view) { |
|
198 | 198 | $found = true; |
199 | 199 | } |
200 | 200 | break; |
201 | 201 | case 'gateways': |
202 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view ) { |
|
202 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'gateways' === $view) { |
|
203 | 203 | $found = true; |
204 | 204 | } |
205 | 205 | break; |
206 | 206 | case 'export': |
207 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view ) { |
|
207 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'export' === $view) { |
|
208 | 208 | $found = true; |
209 | 209 | } |
210 | 210 | break; |
211 | 211 | case 'logs': |
212 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view ) { |
|
212 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page && 'logs' === $view) { |
|
213 | 213 | $found = true; |
214 | 214 | } |
215 | 215 | break; |
216 | 216 | default: |
217 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) { |
|
217 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) { |
|
218 | 218 | $found = true; |
219 | 219 | } |
220 | 220 | break; |
221 | 221 | } |
222 | 222 | break; |
223 | 223 | case 'settings': |
224 | - switch ( $passed_view ) { |
|
224 | + switch ($passed_view) { |
|
225 | 225 | case 'general': |
226 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && ( 'general' === $tab || false === $tab ) ) { |
|
226 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && ('general' === $tab || false === $tab)) { |
|
227 | 227 | $found = true; |
228 | 228 | } |
229 | 229 | break; |
230 | 230 | case 'gateways': |
231 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab ) { |
|
231 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'gateways' === $tab) { |
|
232 | 232 | $found = true; |
233 | 233 | } |
234 | 234 | break; |
235 | 235 | case 'emails': |
236 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab ) { |
|
236 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'emails' === $tab) { |
|
237 | 237 | $found = true; |
238 | 238 | } |
239 | 239 | break; |
240 | 240 | case 'display': |
241 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab ) { |
|
241 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'display' === $tab) { |
|
242 | 242 | $found = true; |
243 | 243 | } |
244 | 244 | break; |
245 | 245 | case 'licenses': |
246 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab ) { |
|
246 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'licenses' === $tab) { |
|
247 | 247 | $found = true; |
248 | 248 | } |
249 | 249 | break; |
250 | 250 | case 'api': |
251 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab ) { |
|
251 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'api' === $tab) { |
|
252 | 252 | $found = true; |
253 | 253 | } |
254 | 254 | break; |
255 | 255 | case 'advanced': |
256 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab ) { |
|
256 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'advanced' === $tab) { |
|
257 | 257 | $found = true; |
258 | 258 | } |
259 | 259 | break; |
260 | 260 | case 'system_info': |
261 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab ) { |
|
261 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page && 'system_info' === $tab) { |
|
262 | 262 | $found = true; |
263 | 263 | } |
264 | 264 | break; |
265 | 265 | default: |
266 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-settings' === $page ) { |
|
266 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-settings' === $page) { |
|
267 | 267 | $found = true; |
268 | 268 | } |
269 | 269 | break; |
270 | 270 | } |
271 | 271 | break; |
272 | 272 | case 'addons': |
273 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-addons' === $page ) { |
|
273 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-addons' === $page) { |
|
274 | 274 | $found = true; |
275 | 275 | } |
276 | 276 | break; |
277 | 277 | case 'donors': |
278 | - switch ( $passed_view ) { |
|
278 | + switch ($passed_view) { |
|
279 | 279 | case 'list-table': |
280 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view ) { |
|
280 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && false === $view) { |
|
281 | 281 | $found = true; |
282 | 282 | } |
283 | 283 | break; |
284 | 284 | case 'overview': |
285 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view ) { |
|
285 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'overview' === $view) { |
|
286 | 286 | $found = true; |
287 | 287 | } |
288 | 288 | break; |
289 | 289 | case 'notes': |
290 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view ) { |
|
290 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page && 'notes' === $view) { |
|
291 | 291 | $found = true; |
292 | 292 | } |
293 | 293 | break; |
294 | 294 | default: |
295 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-donors' === $page ) { |
|
295 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-donors' === $page) { |
|
296 | 296 | $found = true; |
297 | 297 | } |
298 | 298 | break; |
299 | 299 | } |
300 | 300 | break; |
301 | 301 | case 'reports': |
302 | - if ( ( 'give_forms' == $typenow || 'give_forms' === $post_type ) && $pagenow == 'edit.php' && 'give-reports' === $page ) { |
|
302 | + if (('give_forms' == $typenow || 'give_forms' === $post_type) && $pagenow == 'edit.php' && 'give-reports' === $page) { |
|
303 | 303 | $found = true; |
304 | 304 | } |
305 | 305 | break; |
306 | 306 | default: |
307 | 307 | global $give_payments_page, $give_settings_page, $give_reports_page, $give_system_info_page, $give_add_ons_page, $give_settings_export, $give_donors_page, $give_tools_page; |
308 | 308 | |
309 | - $admin_pages = apply_filters( 'give_admin_pages', array( |
|
309 | + $admin_pages = apply_filters('give_admin_pages', array( |
|
310 | 310 | $give_payments_page, |
311 | 311 | $give_settings_page, |
312 | 312 | $give_reports_page, |
@@ -316,16 +316,16 @@ discard block |
||
316 | 316 | $give_donors_page, |
317 | 317 | $give_tools_page, |
318 | 318 | 'widgets.php' |
319 | - ) ); |
|
320 | - if ( 'give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow ) { |
|
319 | + )); |
|
320 | + if ('give_forms' == $typenow || 'index.php' == $pagenow || 'post-new.php' == $pagenow || 'post.php' == $pagenow) { |
|
321 | 321 | $found = true; |
322 | - } elseif ( in_array( $pagenow, $admin_pages ) ) { |
|
322 | + } elseif (in_array($pagenow, $admin_pages)) { |
|
323 | 323 | $found = true; |
324 | 324 | } |
325 | 325 | break; |
326 | 326 | } |
327 | 327 | |
328 | - return (bool) apply_filters( 'give_is_admin_page', $found, $page, $view, $passed_page, $passed_view ); |
|
328 | + return (bool) apply_filters('give_is_admin_page', $found, $page, $view, $passed_page, $passed_view); |
|
329 | 329 | |
330 | 330 | } |
331 | 331 | |
@@ -337,37 +337,37 @@ discard block |
||
337 | 337 | * @param array $settings |
338 | 338 | * @return array |
339 | 339 | */ |
340 | -function give_settings_page_pages( $settings ) { |
|
341 | - include( 'abstract-admin-settings-page.php' ); |
|
342 | - include( 'settings/class-settings-cmb2-backward-compatibility.php' ); |
|
340 | +function give_settings_page_pages($settings) { |
|
341 | + include('abstract-admin-settings-page.php'); |
|
342 | + include('settings/class-settings-cmb2-backward-compatibility.php'); |
|
343 | 343 | |
344 | 344 | $settings = array( |
345 | 345 | // General settings. |
346 | - include( 'settings/class-settings-general.php' ), |
|
346 | + include('settings/class-settings-general.php'), |
|
347 | 347 | |
348 | 348 | // Payment Gateways Settings. |
349 | - include( 'settings/class-settings-gateways.php' ), |
|
349 | + include('settings/class-settings-gateways.php'), |
|
350 | 350 | |
351 | 351 | // Display settings. |
352 | - include( 'settings/class-settings-display.php' ), |
|
352 | + include('settings/class-settings-display.php'), |
|
353 | 353 | |
354 | 354 | // Emails settings. |
355 | - include( 'settings/class-settings-email.php' ), |
|
355 | + include('settings/class-settings-email.php'), |
|
356 | 356 | |
357 | 357 | // Addons settings. |
358 | - include( 'settings/class-settings-addon.php' ), |
|
358 | + include('settings/class-settings-addon.php'), |
|
359 | 359 | |
360 | 360 | // License settings. |
361 | - include( 'settings/class-settings-license.php' ), |
|
361 | + include('settings/class-settings-license.php'), |
|
362 | 362 | |
363 | 363 | // Advanced settings. |
364 | - include( 'settings/class-settings-advanced.php' ) |
|
364 | + include('settings/class-settings-advanced.php') |
|
365 | 365 | ); |
366 | 366 | |
367 | 367 | // Output. |
368 | 368 | return $settings; |
369 | 369 | } |
370 | -add_filter( 'give-settings_get_settings_pages', 'give_settings_page_pages', 0, 1 ); |
|
370 | +add_filter('give-settings_get_settings_pages', 'give_settings_page_pages', 0, 1); |
|
371 | 371 | |
372 | 372 | |
373 | 373 | /** |
@@ -377,25 +377,25 @@ discard block |
||
377 | 377 | * @param array $settings |
378 | 378 | * @return array |
379 | 379 | */ |
380 | -function give_reports_page_pages( $settings ) { |
|
381 | - include( 'abstract-admin-settings-page.php' ); |
|
380 | +function give_reports_page_pages($settings) { |
|
381 | + include('abstract-admin-settings-page.php'); |
|
382 | 382 | |
383 | 383 | $settings = array( |
384 | 384 | // Earnings. |
385 | - include( 'reports/class-earnings-report.php' ), |
|
385 | + include('reports/class-earnings-report.php'), |
|
386 | 386 | |
387 | 387 | // Forms. |
388 | - include( 'reports/class-forms-report.php' ), |
|
388 | + include('reports/class-forms-report.php'), |
|
389 | 389 | |
390 | 390 | // Gateways. |
391 | - include( 'reports/class-gateways-report.php' ), |
|
391 | + include('reports/class-gateways-report.php'), |
|
392 | 392 | |
393 | 393 | ); |
394 | 394 | |
395 | 395 | // Output. |
396 | 396 | return $settings; |
397 | 397 | } |
398 | -add_filter( 'give-reports_get_settings_pages', 'give_reports_page_pages', 0, 1 ); |
|
398 | +add_filter('give-reports_get_settings_pages', 'give_reports_page_pages', 0, 1); |
|
399 | 399 | |
400 | 400 | /** |
401 | 401 | * Add setting tab to give-settings page |
@@ -404,34 +404,34 @@ discard block |
||
404 | 404 | * @param array $settings |
405 | 405 | * @return array |
406 | 406 | */ |
407 | -function give_tools_page_pages( $settings ) { |
|
408 | - include( 'abstract-admin-settings-page.php' ); |
|
407 | +function give_tools_page_pages($settings) { |
|
408 | + include('abstract-admin-settings-page.php'); |
|
409 | 409 | |
410 | 410 | $settings = array( |
411 | 411 | // System Info. |
412 | - include( 'tools/class-settings-system-info.php' ), |
|
412 | + include('tools/class-settings-system-info.php'), |
|
413 | 413 | |
414 | 414 | // Logs. |
415 | - include( 'tools/class-settings-logs.php' ), |
|
415 | + include('tools/class-settings-logs.php'), |
|
416 | 416 | |
417 | 417 | // API. |
418 | - include( 'tools/class-settings-api.php' ), |
|
418 | + include('tools/class-settings-api.php'), |
|
419 | 419 | |
420 | 420 | // Data. |
421 | - include( 'tools/class-settings-data.php' ), |
|
421 | + include('tools/class-settings-data.php'), |
|
422 | 422 | |
423 | 423 | // Export. |
424 | - include( 'tools/class-settings-export.php' ), |
|
424 | + include('tools/class-settings-export.php'), |
|
425 | 425 | |
426 | 426 | // Import. |
427 | - include( 'tools/class-settings-import.php' ), |
|
427 | + include('tools/class-settings-import.php'), |
|
428 | 428 | |
429 | 429 | ); |
430 | 430 | |
431 | 431 | // Output. |
432 | 432 | return $settings; |
433 | 433 | } |
434 | -add_filter( 'give-tools_get_settings_pages', 'give_tools_page_pages', 0, 1 ); |
|
434 | +add_filter('give-tools_get_settings_pages', 'give_tools_page_pages', 0, 1); |
|
435 | 435 | |
436 | 436 | /** |
437 | 437 | * Set default tools page tab. |
@@ -440,10 +440,10 @@ discard block |
||
440 | 440 | * @param string $default_tab Default tab name. |
441 | 441 | * @return string |
442 | 442 | */ |
443 | -function give_set_default_tab_form_tools_page( $default_tab ) { |
|
443 | +function give_set_default_tab_form_tools_page($default_tab) { |
|
444 | 444 | return 'system-info'; |
445 | 445 | } |
446 | -add_filter( 'give_default_setting_tab_give-tools', 'give_set_default_tab_form_tools_page', 10, 1 ); |
|
446 | +add_filter('give_default_setting_tab_give-tools', 'give_set_default_tab_form_tools_page', 10, 1); |
|
447 | 447 | |
448 | 448 | |
449 | 449 | /** |
@@ -453,10 +453,10 @@ discard block |
||
453 | 453 | * @param string $default_tab Default tab name. |
454 | 454 | * @return string |
455 | 455 | */ |
456 | -function give_set_default_tab_form_reports_page( $default_tab ) { |
|
456 | +function give_set_default_tab_form_reports_page($default_tab) { |
|
457 | 457 | return 'earnings'; |
458 | 458 | } |
459 | -add_filter( 'give_default_setting_tab_give-reports', 'give_set_default_tab_form_reports_page', 10, 1 ); |
|
459 | +add_filter('give_default_setting_tab_give-reports', 'give_set_default_tab_form_reports_page', 10, 1); |
|
460 | 460 | |
461 | 461 | |
462 | 462 | /** |
@@ -469,19 +469,19 @@ discard block |
||
469 | 469 | * |
470 | 470 | * @return array |
471 | 471 | */ |
472 | -function give_add_display_page_states( $post_states, $post ) { |
|
472 | +function give_add_display_page_states($post_states, $post) { |
|
473 | 473 | |
474 | - switch( $post->ID ) { |
|
475 | - case give_get_option( 'success_page' ): |
|
476 | - $post_states['give_successfully_page'] = __( 'Donation Success Page', 'give' ); |
|
474 | + switch ($post->ID) { |
|
475 | + case give_get_option('success_page'): |
|
476 | + $post_states['give_successfully_page'] = __('Donation Success Page', 'give'); |
|
477 | 477 | break; |
478 | 478 | |
479 | - case give_get_option( 'failure_page' ): |
|
480 | - $post_states['give_failure_page'] = __( 'Donation Failed Page', 'give' ); |
|
479 | + case give_get_option('failure_page'): |
|
480 | + $post_states['give_failure_page'] = __('Donation Failed Page', 'give'); |
|
481 | 481 | break; |
482 | 482 | |
483 | - case give_get_option( 'history_page' ): |
|
484 | - $post_states['give_history_page'] = __( 'Donation History Page', 'give' ); |
|
483 | + case give_get_option('history_page'): |
|
484 | + $post_states['give_history_page'] = __('Donation History Page', 'give'); |
|
485 | 485 | break; |
486 | 486 | } |
487 | 487 | |
@@ -489,4 +489,4 @@ discard block |
||
489 | 489 | } |
490 | 490 | |
491 | 491 | // Add a post display state for special Give pages. |
492 | -add_filter( 'display_post_states', 'give_add_display_page_states', 10, 2 ); |
|
493 | 492 | \ No newline at end of file |
493 | +add_filter('display_post_states', 'give_add_display_page_states', 10, 2); |
|
494 | 494 | \ No newline at end of file |
@@ -673,9 +673,9 @@ |
||
673 | 673 | } |
674 | 674 | |
675 | 675 | echo ' – ' |
676 | - . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) |
|
677 | - . ' – ' |
|
678 | - . esc_html( $plugin_data['Version'] ); |
|
676 | + . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) |
|
677 | + . ' – ' |
|
678 | + . esc_html( $plugin_data['Version'] ); |
|
679 | 679 | ?> |
680 | 680 | </td> |
681 | 681 | </tr> |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Admin View: System Info |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if ( ! defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | ?> |
24 | 24 | |
25 | 25 | <div class="give-debug-report-wrapper"> |
26 | - <p class="give-debug-report-text"><?php echo sprintf(__( 'Please copy and paste this information in your ticket when contacting support:', 'give' )); ?> </p> |
|
26 | + <p class="give-debug-report-text"><?php echo sprintf(__('Please copy and paste this information in your ticket when contacting support:', 'give')); ?> </p> |
|
27 | 27 | <div class="give-debug-report-actions"> |
28 | - <a class="button-primary js-give-debug-report-button" href="#"><?php _e( 'Get System Report', 'give' ); ?></a> |
|
29 | - <a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info" target="_blank"><?php _e( 'Understanding the System Report', 'give' ); ?> <span class="dashicons dashicons-external"></span></a> |
|
28 | + <a class="button-primary js-give-debug-report-button" href="#"><?php _e('Get System Report', 'give'); ?></a> |
|
29 | + <a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info" target="_blank"><?php _e('Understanding the System Report', 'give'); ?> <span class="dashicons dashicons-external"></span></a> |
|
30 | 30 | </div> |
31 | 31 | <div class="give-debug-report js-give-debug-report"> |
32 | 32 | <textarea readonly="readonly"></textarea> |
@@ -36,55 +36,55 @@ discard block |
||
36 | 36 | <table class="give-status-table widefat" cellspacing="0" id="status"> |
37 | 37 | <thead> |
38 | 38 | <tr> |
39 | - <th colspan="3" data-export-label="WordPress Environment"><h2><?php _e( 'WordPress Environment', 'give' ); ?></h2></th> |
|
39 | + <th colspan="3" data-export-label="WordPress Environment"><h2><?php _e('WordPress Environment', 'give'); ?></h2></th> |
|
40 | 40 | </tr> |
41 | 41 | </thead> |
42 | 42 | <tbody> |
43 | 43 | <tr> |
44 | - <td data-export-label="Home URL"><?php _e( 'Home URL', 'give' ); ?>:</td> |
|
45 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The URL of your site\'s homepage.', 'give' ) ); ?>"></span></td> |
|
46 | - <td><?php form_option( 'home' ); ?></td> |
|
44 | + <td data-export-label="Home URL"><?php _e('Home URL', 'give'); ?>:</td> |
|
45 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The URL of your site\'s homepage.', 'give')); ?>"></span></td> |
|
46 | + <td><?php form_option('home'); ?></td> |
|
47 | 47 | </tr> |
48 | 48 | <tr> |
49 | - <td data-export-label="Site URL"><?php _e( 'Site URL', 'give' ); ?>:</td> |
|
50 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The root URL of your site.', 'give' ) ); ?>"></span></td> |
|
51 | - <td><?php form_option( 'siteurl' ); ?></td> |
|
49 | + <td data-export-label="Site URL"><?php _e('Site URL', 'give'); ?>:</td> |
|
50 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The root URL of your site.', 'give')); ?>"></span></td> |
|
51 | + <td><?php form_option('siteurl'); ?></td> |
|
52 | 52 | </tr> |
53 | 53 | <tr> |
54 | - <td data-export-label="WP Version"><?php _e( 'WP Version', 'give' ); ?>:</td> |
|
55 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of WordPress installed on your site.', 'give' ) ); ?>"></span></td> |
|
54 | + <td data-export-label="WP Version"><?php _e('WP Version', 'give'); ?>:</td> |
|
55 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of WordPress installed on your site.', 'give')); ?>"></span></td> |
|
56 | 56 | <td><?php bloginfo('version'); ?></td> |
57 | 57 | </tr> |
58 | 58 | <tr> |
59 | - <td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'give' ); ?>:</td> |
|
60 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether or not you have WordPress Multisite enabled.', 'give' ) ); ?>"></span></td> |
|
61 | - <td><?php if ( is_multisite() ) echo '<span class="dashicons dashicons-yes"></span>'; else echo '–'; ?></td> |
|
59 | + <td data-export-label="WP Multisite"><?php _e('WP Multisite', 'give'); ?>:</td> |
|
60 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether or not you have WordPress Multisite enabled.', 'give')); ?>"></span></td> |
|
61 | + <td><?php if (is_multisite()) echo '<span class="dashicons dashicons-yes"></span>'; else echo '–'; ?></td> |
|
62 | 62 | </tr> |
63 | 63 | <tr> |
64 | - <td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'give' ); ?>:</td> |
|
65 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The maximum amount of memory (RAM) that your site can use at one time.', 'give' ) ); ?>"></span></td> |
|
64 | + <td data-export-label="WP Memory Limit"><?php _e('WP Memory Limit', 'give'); ?>:</td> |
|
65 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The maximum amount of memory (RAM) that your site can use at one time.', 'give')); ?>"></span></td> |
|
66 | 66 | <td> |
67 | 67 | <?php |
68 | - $memory = give_let_to_num( WP_MEMORY_LIMIT ); |
|
68 | + $memory = give_let_to_num(WP_MEMORY_LIMIT); |
|
69 | 69 | |
70 | - if ( function_exists( 'memory_get_usage' ) ) { |
|
71 | - $system_memory = give_let_to_num( @ini_get( 'memory_limit' ) ); |
|
72 | - $memory = max( $memory, $system_memory ); |
|
70 | + if (function_exists('memory_get_usage')) { |
|
71 | + $system_memory = give_let_to_num(@ini_get('memory_limit')); |
|
72 | + $memory = max($memory, $system_memory); |
|
73 | 73 | } |
74 | 74 | |
75 | - if ( $memory < 67108864 ) { |
|
76 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend setting memory to at least 64 MB. See: %s', 'give' ), size_format( $memory ), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">' . __( 'Increasing memory allocated to PHP', 'give' ) . '</a>' ) . '</mark>'; |
|
75 | + if ($memory < 67108864) { |
|
76 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend setting memory to at least 64 MB. See: %s', 'give'), size_format($memory), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">'.__('Increasing memory allocated to PHP', 'give').'</a>').'</mark>'; |
|
77 | 77 | } else { |
78 | - echo '<mark class="yes">' . size_format( $memory ) . '</mark>'; |
|
78 | + echo '<mark class="yes">'.size_format($memory).'</mark>'; |
|
79 | 79 | } |
80 | 80 | ?> |
81 | 81 | </td> |
82 | 82 | </tr> |
83 | 83 | <tr> |
84 | - <td data-export-label="WP Debug Mode"><?php _e( 'WP Debug Mode', 'give' ); ?>:</td> |
|
85 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Displays whether or not WordPress is in Debug Mode.', 'give' ) ); ?>"></span></td> |
|
84 | + <td data-export-label="WP Debug Mode"><?php _e('WP Debug Mode', 'give'); ?>:</td> |
|
85 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Displays whether or not WordPress is in Debug Mode.', 'give')); ?>"></span></td> |
|
86 | 86 | <td> |
87 | - <?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?> |
|
87 | + <?php if (defined('WP_DEBUG') && WP_DEBUG) : ?> |
|
88 | 88 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
89 | 89 | <?php else : ?> |
90 | 90 | <mark class="no">–</mark> |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | </td> |
93 | 93 | </tr> |
94 | 94 | <tr> |
95 | - <td data-export-label="WP Cron"><?php _e( 'WP Cron', 'give' ); ?>:</td> |
|
96 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Displays whether or not WP Cron Jobs are enabled.', 'give' ) ); ?>"></span></td> |
|
95 | + <td data-export-label="WP Cron"><?php _e('WP Cron', 'give'); ?>:</td> |
|
96 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Displays whether or not WP Cron Jobs are enabled.', 'give')); ?>"></span></td> |
|
97 | 97 | <td> |
98 | - <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?> |
|
98 | + <?php if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) : ?> |
|
99 | 99 | <mark class="no">–</mark> |
100 | 100 | <?php else : ?> |
101 | 101 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
@@ -103,55 +103,55 @@ discard block |
||
103 | 103 | </td> |
104 | 104 | </tr> |
105 | 105 | <tr> |
106 | - <td data-export-label="Language"><?php _e( 'Language', 'give' ); ?>:</td> |
|
107 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The current language used by WordPress. Default = English', 'give' ) ); ?>"></span></td> |
|
106 | + <td data-export-label="Language"><?php _e('Language', 'give'); ?>:</td> |
|
107 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The current language used by WordPress. Default = English', 'give')); ?>"></span></td> |
|
108 | 108 | <td><?php echo get_locale(); ?></td> |
109 | 109 | </tr> |
110 | 110 | <tr> |
111 | - <td data-export-label="Permalink Structure"><?php _e( 'Permalink Structure', 'give' ); ?>:</td> |
|
112 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The permalink structure as defined in Settings.', 'give' ) ); ?>"></span></td> |
|
113 | - <td><?php echo esc_html( get_option( 'permalink_structure', __( 'Default', 'give' ) ) ); ?></td> |
|
111 | + <td data-export-label="Permalink Structure"><?php _e('Permalink Structure', 'give'); ?>:</td> |
|
112 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The permalink structure as defined in Settings.', 'give')); ?>"></span></td> |
|
113 | + <td><?php echo esc_html(get_option('permalink_structure', __('Default', 'give'))); ?></td> |
|
114 | 114 | </tr> |
115 | 115 | <tr> |
116 | - <td data-export-label="Show on Front"><?php _e( 'Show on Front', 'give' ); ?>:</td> |
|
117 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether your front page is set to show posts or a static page.', 'give' ) ); ?>"></span></td> |
|
118 | - <td><?php echo esc_html( get_option( 'show_on_front', '–' ) ); ?></td> |
|
116 | + <td data-export-label="Show on Front"><?php _e('Show on Front', 'give'); ?>:</td> |
|
117 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether your front page is set to show posts or a static page.', 'give')); ?>"></span></td> |
|
118 | + <td><?php echo esc_html(get_option('show_on_front', '–')); ?></td> |
|
119 | 119 | </tr> |
120 | - <?php if ( 'page' === get_option( 'show_on_front' ) ) : ?> |
|
120 | + <?php if ('page' === get_option('show_on_front')) : ?> |
|
121 | 121 | <?php |
122 | - $front_page_id = absint( get_option( 'page_on_front' ) ); |
|
123 | - $blog_page_id = absint( get_option( 'page_for_posts' ) ); |
|
122 | + $front_page_id = absint(get_option('page_on_front')); |
|
123 | + $blog_page_id = absint(get_option('page_for_posts')); |
|
124 | 124 | ?> |
125 | 125 | <tr> |
126 | - <td data-export-label="Page on Front"><?php _e( 'Page on Front', 'give' ); ?>:</td> |
|
127 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page set to display as your front page.', 'give' ) ); ?>"></span></td> |
|
128 | - <td><?php echo 0 !== $front_page_id ? esc_html( get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' ) : __( 'Unset', 'give' ); ?></td> |
|
126 | + <td data-export-label="Page on Front"><?php _e('Page on Front', 'give'); ?>:</td> |
|
127 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page set to display as your front page.', 'give')); ?>"></span></td> |
|
128 | + <td><?php echo 0 !== $front_page_id ? esc_html(get_the_title($front_page_id).' (#'.$front_page_id.')') : __('Unset', 'give'); ?></td> |
|
129 | 129 | </tr> |
130 | 130 | <tr> |
131 | - <td data-export-label="Page for Posts"><?php _e( 'Page for Posts', 'give' ); ?>:</td> |
|
132 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page set to display your posts.', 'give' ) ); ?>"></span></td> |
|
133 | - <td><?php echo 0 !== $blog_page_id ? esc_html( get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' ) : __( 'Unset', 'give' ); ?></td> |
|
131 | + <td data-export-label="Page for Posts"><?php _e('Page for Posts', 'give'); ?>:</td> |
|
132 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page set to display your posts.', 'give')); ?>"></span></td> |
|
133 | + <td><?php echo 0 !== $blog_page_id ? esc_html(get_the_title($blog_page_id).' (#'.$blog_page_id.')') : __('Unset', 'give'); ?></td> |
|
134 | 134 | </tr> |
135 | - <?php endif;?> |
|
135 | + <?php endif; ?> |
|
136 | 136 | <tr> |
137 | - <td data-export-label="Table Prefix Length"><?php _e( 'Table Prefix Length', 'give' ); ?>:</td> |
|
138 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The length of the table prefix used in your WordPress database.', 'give' ) ); ?>"></span></td> |
|
139 | - <td><?php echo esc_html( strlen( $wpdb->prefix ) ); ?></td> |
|
137 | + <td data-export-label="Table Prefix Length"><?php _e('Table Prefix Length', 'give'); ?>:</td> |
|
138 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The length of the table prefix used in your WordPress database.', 'give')); ?>"></span></td> |
|
139 | + <td><?php echo esc_html(strlen($wpdb->prefix)); ?></td> |
|
140 | 140 | </tr> |
141 | 141 | <tr> |
142 | - <td data-export-label="Table Prefix Status"><?php _e( 'Table Prefix Status', 'give' ); ?>:</td> |
|
143 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The status of the table prefix used in your WordPress database.', 'give' ) ); ?>"></span></td> |
|
144 | - <td><?php echo strlen( $wpdb->prefix ) > 16 ? esc_html( 'Error: Too long', 'give' ) : esc_html( 'Acceptable', 'give' ); ?></td> |
|
142 | + <td data-export-label="Table Prefix Status"><?php _e('Table Prefix Status', 'give'); ?>:</td> |
|
143 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The status of the table prefix used in your WordPress database.', 'give')); ?>"></span></td> |
|
144 | + <td><?php echo strlen($wpdb->prefix) > 16 ? esc_html('Error: Too long', 'give') : esc_html('Acceptable', 'give'); ?></td> |
|
145 | 145 | </tr> |
146 | 146 | <tr> |
147 | - <td data-export-label="Admin AJAX"><?php _e( 'Admin AJAX', 'give' ); ?>:</td> |
|
148 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether Admin AJAX is accessible.', 'give' ) ); ?>"></span></td> |
|
149 | - <td><?php echo give_test_ajax_works() ? __( 'Accessible', 'give' ) : __( 'Inaccessible', 'give' ); ?></td> |
|
147 | + <td data-export-label="Admin AJAX"><?php _e('Admin AJAX', 'give'); ?>:</td> |
|
148 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether Admin AJAX is accessible.', 'give')); ?>"></span></td> |
|
149 | + <td><?php echo give_test_ajax_works() ? __('Accessible', 'give') : __('Inaccessible', 'give'); ?></td> |
|
150 | 150 | </tr> |
151 | 151 | <tr> |
152 | - <td data-export-label="Registered Post Statuses"><?php _e( 'Registered Post Statuses', 'give' ); ?>:</td> |
|
153 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'A list of all registered post statuses.', 'give' ) ); ?>"></span></td> |
|
154 | - <td><?php echo esc_html( implode( ', ', get_post_stati() ) ); ?></td> |
|
152 | + <td data-export-label="Registered Post Statuses"><?php _e('Registered Post Statuses', 'give'); ?>:</td> |
|
153 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('A list of all registered post statuses.', 'give')); ?>"></span></td> |
|
154 | + <td><?php echo esc_html(implode(', ', get_post_stati())); ?></td> |
|
155 | 155 | </tr> |
156 | 156 | </tbody> |
157 | 157 | </table> |
@@ -159,90 +159,90 @@ discard block |
||
159 | 159 | <table class="give-status-table widefat" cellspacing="0"> |
160 | 160 | <thead> |
161 | 161 | <tr> |
162 | - <th colspan="3" data-export-label="Server Environment"><h2><?php _e( 'Server Environment', 'give' ); ?></h2></th> |
|
162 | + <th colspan="3" data-export-label="Server Environment"><h2><?php _e('Server Environment', 'give'); ?></h2></th> |
|
163 | 163 | </tr> |
164 | 164 | </thead> |
165 | 165 | <tbody> |
166 | 166 | <tr> |
167 | - <td data-export-label="Hosting Provider"><?php _e( 'Hosting Provider', 'give' ); ?>:</td> |
|
168 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The hosting provider for this WordPress installation.', 'give' ) ); ?>"></span></td> |
|
169 | - <td><?php echo give_get_host() ? esc_html( give_get_host() ) : __( 'Unknown', 'give' ); ?></td> |
|
167 | + <td data-export-label="Hosting Provider"><?php _e('Hosting Provider', 'give'); ?>:</td> |
|
168 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The hosting provider for this WordPress installation.', 'give')); ?>"></span></td> |
|
169 | + <td><?php echo give_get_host() ? esc_html(give_get_host()) : __('Unknown', 'give'); ?></td> |
|
170 | 170 | </tr> |
171 | 171 | <tr> |
172 | - <td data-export-label="TLS Connection"><?php _e( 'TLS Connection', 'give' ); ?>:</td> |
|
173 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Most payment gateway APIs only support connections using the TLS 1.2 security protocol.', 'give' ) ); ?>"></span></td> |
|
172 | + <td data-export-label="TLS Connection"><?php _e('TLS Connection', 'give'); ?>:</td> |
|
173 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Most payment gateway APIs only support connections using the TLS 1.2 security protocol.', 'give')); ?>"></span></td> |
|
174 | 174 | <td><?php |
175 | - $tls_check = wp_remote_post( 'https://www.howsmyssl.com/a/check' ); |
|
176 | - if ( ! is_wp_error( $tls_check ) ) { |
|
177 | - $tls_check = json_decode( wp_remote_retrieve_body( $tls_check ) ); |
|
175 | + $tls_check = wp_remote_post('https://www.howsmyssl.com/a/check'); |
|
176 | + if ( ! is_wp_error($tls_check)) { |
|
177 | + $tls_check = json_decode(wp_remote_retrieve_body($tls_check)); |
|
178 | 178 | /* translators: %s: SSL connection response */ |
179 | - printf( __('Connection uses %s', 'give'), esc_html( $tls_check->tls_version )) ; |
|
179 | + printf(__('Connection uses %s', 'give'), esc_html($tls_check->tls_version)); |
|
180 | 180 | } |
181 | 181 | ?></td> |
182 | 182 | </tr> |
183 | 183 | <tr> |
184 | - <td data-export-label="TLS Connection"><?php _e( 'TLS Rating', 'give' ); ?>:</td> |
|
185 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The server\'s connection as rated by https://www.howsmyssl.com/', 'give' ) ); ?>"></span></td> |
|
186 | - <td><?php if ( ! is_wp_error( $tls_check ) ) { |
|
187 | - esc_html_e( $tls_check->rating); |
|
184 | + <td data-export-label="TLS Connection"><?php _e('TLS Rating', 'give'); ?>:</td> |
|
185 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The server\'s connection as rated by https://www.howsmyssl.com/', 'give')); ?>"></span></td> |
|
186 | + <td><?php if ( ! is_wp_error($tls_check)) { |
|
187 | + esc_html_e($tls_check->rating); |
|
188 | 188 | } ?></td> |
189 | 189 | </tr> |
190 | 190 | <tr> |
191 | - <td data-export-label="Server Info"><?php _e( 'Server Info', 'give' ); ?>:</td> |
|
192 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Information about the web server that is currently hosting your site.', 'give' ) ); ?>"></span></td> |
|
193 | - <td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td> |
|
191 | + <td data-export-label="Server Info"><?php _e('Server Info', 'give'); ?>:</td> |
|
192 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Information about the web server that is currently hosting your site.', 'give')); ?>"></span></td> |
|
193 | + <td><?php echo esc_html($_SERVER['SERVER_SOFTWARE']); ?></td> |
|
194 | 194 | </tr> |
195 | 195 | <tr> |
196 | - <td data-export-label="PHP Version"><?php _e( 'PHP Version', 'give' ); ?>:</td> |
|
197 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of PHP installed on your hosting server.', 'give' ) ); ?>"></span></td> |
|
196 | + <td data-export-label="PHP Version"><?php _e('PHP Version', 'give'); ?>:</td> |
|
197 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of PHP installed on your hosting server.', 'give')); ?>"></span></td> |
|
198 | 198 | <td><?php |
199 | 199 | // Check if phpversion function exists. |
200 | - if ( function_exists( 'phpversion' ) ) { |
|
200 | + if (function_exists('phpversion')) { |
|
201 | 201 | $php_version = phpversion(); |
202 | 202 | |
203 | - if ( version_compare( $php_version, '5.6', '<' ) ) { |
|
204 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum PHP version of 5.6. See: %s', 'give' ), esc_html( $php_version ), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">' . __( 'PHP Requirements in Give', 'give' ) . '</a>' ) . '</mark>'; |
|
203 | + if (version_compare($php_version, '5.6', '<')) { |
|
204 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum PHP version of 5.6. See: %s', 'give'), esc_html($php_version), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">'.__('PHP Requirements in Give', 'give').'</a>').'</mark>'; |
|
205 | 205 | } else { |
206 | - echo '<mark class="yes">' . esc_html( $php_version ) . '</mark>'; |
|
206 | + echo '<mark class="yes">'.esc_html($php_version).'</mark>'; |
|
207 | 207 | } |
208 | 208 | } else { |
209 | - _e( "Couldn't determine PHP version because phpversion() doesn't exist.", 'give' ); |
|
209 | + _e("Couldn't determine PHP version because phpversion() doesn't exist.", 'give'); |
|
210 | 210 | } |
211 | 211 | ?></td> |
212 | 212 | </tr> |
213 | - <?php if ( function_exists( 'ini_get' ) ) : ?> |
|
213 | + <?php if (function_exists('ini_get')) : ?> |
|
214 | 214 | <tr> |
215 | - <td data-export-label="PHP Post Max Size"><?php _e( 'PHP Post Max Size', 'give' ); ?>:</td> |
|
216 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The largest filesize that can be contained in one post.', 'give' ) ); ?>"></span></td> |
|
217 | - <td><?php echo size_format( give_let_to_num( ini_get( 'post_max_size' ) ) ); ?></td> |
|
215 | + <td data-export-label="PHP Post Max Size"><?php _e('PHP Post Max Size', 'give'); ?>:</td> |
|
216 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The largest filesize that can be contained in one post.', 'give')); ?>"></span></td> |
|
217 | + <td><?php echo size_format(give_let_to_num(ini_get('post_max_size'))); ?></td> |
|
218 | 218 | </tr> |
219 | 219 | <tr> |
220 | - <td data-export-label="PHP Time Limit"><?php _e( 'PHP Time Limit', 'give' ); ?>:</td> |
|
221 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'give' ) ); ?>"></span></td> |
|
222 | - <td><?php echo ini_get( 'max_execution_time' ); ?></td> |
|
220 | + <td data-export-label="PHP Time Limit"><?php _e('PHP Time Limit', 'give'); ?>:</td> |
|
221 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'give')); ?>"></span></td> |
|
222 | + <td><?php echo ini_get('max_execution_time'); ?></td> |
|
223 | 223 | </tr> |
224 | 224 | <tr> |
225 | - <td data-export-label="PHP Max Input Vars"><?php _e( 'PHP Max Input Vars', 'give' ); ?>:</td> |
|
226 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The maximum number of variables your server can use for a single function to avoid overloads.', 'give' ) ); ?>"></span></td> |
|
227 | - <td><?php echo ini_get( 'max_input_vars' ); ?></td> |
|
225 | + <td data-export-label="PHP Max Input Vars"><?php _e('PHP Max Input Vars', 'give'); ?>:</td> |
|
226 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The maximum number of variables your server can use for a single function to avoid overloads.', 'give')); ?>"></span></td> |
|
227 | + <td><?php echo ini_get('max_input_vars'); ?></td> |
|
228 | 228 | </tr> |
229 | 229 | <tr> |
230 | - <td data-export-label="PHP Max Upload Size"><?php _e( 'PHP Max Upload Size', 'give' ); ?>:</td> |
|
231 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The largest filesize that can be uploaded to your WordPress installation.', 'give' ) ); ?>"></span></td> |
|
232 | - <td><?php echo size_format( wp_max_upload_size() ); ?></td> |
|
230 | + <td data-export-label="PHP Max Upload Size"><?php _e('PHP Max Upload Size', 'give'); ?>:</td> |
|
231 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The largest filesize that can be uploaded to your WordPress installation.', 'give')); ?>"></span></td> |
|
232 | + <td><?php echo size_format(wp_max_upload_size()); ?></td> |
|
233 | 233 | </tr> |
234 | 234 | <tr> |
235 | - <td data-export-label="cURL Version"><?php _e( 'cURL Version', 'give' ); ?>:</td> |
|
236 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of cURL installed on your server.', 'give' ) ); ?>"></span></td> |
|
235 | + <td data-export-label="cURL Version"><?php _e('cURL Version', 'give'); ?>:</td> |
|
236 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of cURL installed on your server.', 'give')); ?>"></span></td> |
|
237 | 237 | <td> |
238 | 238 | <?php |
239 | - if ( function_exists( 'curl_version' ) ) { |
|
239 | + if (function_exists('curl_version')) { |
|
240 | 240 | $curl_version = curl_version(); |
241 | 241 | |
242 | - if ( version_compare( $curl_version['version'], '7.40', '<' ) ) { |
|
243 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum cURL version of 7.40.', 'give' ), esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) ) . '</mark>'; |
|
242 | + if (version_compare($curl_version['version'], '7.40', '<')) { |
|
243 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum cURL version of 7.40.', 'give'), esc_html($curl_version['version'].', '.$curl_version['ssl_version'])).'</mark>'; |
|
244 | 244 | } else { |
245 | - echo '<mark class="yes">' . esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) . '</mark>'; |
|
245 | + echo '<mark class="yes">'.esc_html($curl_version['version'].', '.$curl_version['ssl_version']).'</mark>'; |
|
246 | 246 | } |
247 | 247 | } else { |
248 | 248 | echo '&ndash'; |
@@ -251,42 +251,42 @@ discard block |
||
251 | 251 | </td> |
252 | 252 | </tr> |
253 | 253 | <tr> |
254 | - <td data-export-label="SUHOSIN Installed"><?php _e( 'SUHOSIN Installed', 'give' ); ?>:</td> |
|
255 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'give' ) ); ?>"></span></td> |
|
256 | - <td><?php echo extension_loaded( 'suhosin' ) ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td> |
|
254 | + <td data-export-label="SUHOSIN Installed"><?php _e('SUHOSIN Installed', 'give'); ?>:</td> |
|
255 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'give')); ?>"></span></td> |
|
256 | + <td><?php echo extension_loaded('suhosin') ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td> |
|
257 | 257 | </tr> |
258 | 258 | <?php endif; |
259 | 259 | |
260 | - if ( $wpdb->use_mysqli ) { |
|
261 | - $ver = mysqli_get_server_info( $wpdb->dbh ); |
|
260 | + if ($wpdb->use_mysqli) { |
|
261 | + $ver = mysqli_get_server_info($wpdb->dbh); |
|
262 | 262 | } else { |
263 | 263 | $ver = mysql_get_server_info(); |
264 | 264 | } |
265 | 265 | |
266 | - if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) ) : ?> |
|
266 | + if ( ! empty($wpdb->is_mysql) && ! stristr($ver, 'MariaDB')) : ?> |
|
267 | 267 | <tr> |
268 | - <td data-export-label="MySQL Version"><?php _e( 'MySQL Version', 'give' ); ?>:</td> |
|
269 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of MySQL installed on your hosting server.', 'give' ) ); ?>"></span></td> |
|
268 | + <td data-export-label="MySQL Version"><?php _e('MySQL Version', 'give'); ?>:</td> |
|
269 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of MySQL installed on your hosting server.', 'give')); ?>"></span></td> |
|
270 | 270 | <td> |
271 | 271 | <?php |
272 | 272 | $mysql_version = $wpdb->db_version(); |
273 | 273 | |
274 | - if ( version_compare( $mysql_version, '5.6', '<' ) ) { |
|
275 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum MySQL version of 5.6. See: %s', 'give' ), esc_html( $mysql_version ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'WordPress Requirements', 'give' ) . '</a>' ) . '</mark>'; |
|
274 | + if (version_compare($mysql_version, '5.6', '<')) { |
|
275 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum MySQL version of 5.6. See: %s', 'give'), esc_html($mysql_version), '<a href="https://wordpress.org/about/requirements/" target="_blank">'.__('WordPress Requirements', 'give').'</a>').'</mark>'; |
|
276 | 276 | } else { |
277 | - echo '<mark class="yes">' . esc_html( $mysql_version ) . '</mark>'; |
|
277 | + echo '<mark class="yes">'.esc_html($mysql_version).'</mark>'; |
|
278 | 278 | } |
279 | 279 | ?> |
280 | 280 | </td> |
281 | 281 | </tr> |
282 | 282 | <?php endif; ?> |
283 | 283 | <tr> |
284 | - <td data-export-label="Default Timezone is UTC"><?php _e( 'Default Timezone is UTC', 'give' ); ?>:</td> |
|
285 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The default timezone for your server.', 'give' ) ); ?>"></span></td> |
|
284 | + <td data-export-label="Default Timezone is UTC"><?php _e('Default Timezone is UTC', 'give'); ?>:</td> |
|
285 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The default timezone for your server.', 'give')); ?>"></span></td> |
|
286 | 286 | <td><?php |
287 | 287 | $default_timezone = date_default_timezone_get(); |
288 | - if ( 'UTC' !== $default_timezone ) { |
|
289 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( 'Default timezone is %s - it should be UTC', 'give' ), $default_timezone ) . '</mark>'; |
|
288 | + if ('UTC' !== $default_timezone) { |
|
289 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('Default timezone is %s - it should be UTC', 'give'), $default_timezone).'</mark>'; |
|
290 | 290 | } else { |
291 | 291 | echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
292 | 292 | } ?> |
@@ -297,118 +297,118 @@ discard block |
||
297 | 297 | |
298 | 298 | // fsockopen/cURL. |
299 | 299 | $posting['fsockopen_curl']['name'] = 'fsockopen/cURL'; |
300 | - $posting['fsockopen_curl']['help'] = __( 'Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'give' ); |
|
300 | + $posting['fsockopen_curl']['help'] = __('Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'give'); |
|
301 | 301 | |
302 | - if ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) { |
|
302 | + if (function_exists('fsockopen') || function_exists('curl_init')) { |
|
303 | 303 | $posting['fsockopen_curl']['success'] = true; |
304 | 304 | } else { |
305 | 305 | $posting['fsockopen_curl']['success'] = false; |
306 | - $posting['fsockopen_curl']['note'] = __( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'give' ); |
|
306 | + $posting['fsockopen_curl']['note'] = __('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'give'); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | // SOAP. |
310 | 310 | $posting['soap_client']['name'] = 'SoapClient'; |
311 | - $posting['soap_client']['help'] = __( 'Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'give' ); |
|
311 | + $posting['soap_client']['help'] = __('Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'give'); |
|
312 | 312 | |
313 | - if ( class_exists( 'SoapClient' ) ) { |
|
313 | + if (class_exists('SoapClient')) { |
|
314 | 314 | $posting['soap_client']['success'] = true; |
315 | 315 | } else { |
316 | 316 | $posting['soap_client']['success'] = false; |
317 | - $posting['soap_client']['note'] = sprintf( __( 'Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'give' ), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>' ); |
|
317 | + $posting['soap_client']['note'] = sprintf(__('Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'give'), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>'); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | // DOMDocument. |
321 | 321 | $posting['dom_document']['name'] = 'DOMDocument'; |
322 | - $posting['dom_document']['help'] = __( 'HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give' ); |
|
322 | + $posting['dom_document']['help'] = __('HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give'); |
|
323 | 323 | |
324 | - if ( class_exists( 'DOMDocument' ) ) { |
|
324 | + if (class_exists('DOMDocument')) { |
|
325 | 325 | $posting['dom_document']['success'] = true; |
326 | 326 | } else { |
327 | 327 | $posting['dom_document']['success'] = false; |
328 | - $posting['dom_document']['note'] = sprintf( __( 'Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'give' ), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>' ); |
|
328 | + $posting['dom_document']['note'] = sprintf(__('Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'give'), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>'); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | // gzip. |
332 | 332 | $posting['gzip']['name'] = 'gzip'; |
333 | - $posting['gzip']['help'] = __( 'gzip is used for file compression and decompression.', 'give' ); |
|
333 | + $posting['gzip']['help'] = __('gzip is used for file compression and decompression.', 'give'); |
|
334 | 334 | |
335 | - if ( is_callable( 'gzopen' ) ) { |
|
335 | + if (is_callable('gzopen')) { |
|
336 | 336 | $posting['gzip']['success'] = true; |
337 | 337 | } else { |
338 | 338 | $posting['gzip']['success'] = false; |
339 | - $posting['gzip']['note'] = sprintf( __( 'Your server does not support the %s function - this is used for file compression and decompression.', 'give' ), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>' ); |
|
339 | + $posting['gzip']['note'] = sprintf(__('Your server does not support the %s function - this is used for file compression and decompression.', 'give'), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>'); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | // GD Graphics Library. |
343 | 343 | $posting['gd']['name'] = 'GD Graphics Library'; |
344 | - $posting['gd']['help'] = __( 'GD Graphics Library is used for dynamically manipulating images.', 'give' ); |
|
345 | - $posting['gd']['success'] = extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ? true : false; |
|
344 | + $posting['gd']['help'] = __('GD Graphics Library is used for dynamically manipulating images.', 'give'); |
|
345 | + $posting['gd']['success'] = extension_loaded('gd') && function_exists('gd_info') ? true : false; |
|
346 | 346 | |
347 | 347 | // Multibyte String. |
348 | 348 | $posting['mbstring']['name'] = 'Multibyte String'; |
349 | - $posting['mbstring']['help'] = __( 'Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give' ); |
|
349 | + $posting['mbstring']['help'] = __('Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give'); |
|
350 | 350 | |
351 | - if ( extension_loaded( 'mbstring' ) ) { |
|
351 | + if (extension_loaded('mbstring')) { |
|
352 | 352 | $posting['mbstring']['success'] = true; |
353 | 353 | } else { |
354 | 354 | $posting['mbstring']['success'] = false; |
355 | - $posting['mbstring']['note'] = sprintf( __( 'Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'give' ), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>' ); |
|
355 | + $posting['mbstring']['note'] = sprintf(__('Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'give'), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>'); |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | // WP Remote Post Check. |
359 | - $posting['wp_remote_post']['name'] = __( 'Remote Post', 'give'); |
|
360 | - $posting['wp_remote_post']['help'] = __( 'PayPal uses this method of communicating when sending back transaction information.', 'give' ); |
|
359 | + $posting['wp_remote_post']['name'] = __('Remote Post', 'give'); |
|
360 | + $posting['wp_remote_post']['help'] = __('PayPal uses this method of communicating when sending back transaction information.', 'give'); |
|
361 | 361 | |
362 | - $response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array( |
|
362 | + $response = wp_safe_remote_post('https://www.paypal.com/cgi-bin/webscr', array( |
|
363 | 363 | 'timeout' => 60, |
364 | - 'user-agent' => 'Give/' . GIVE_VERSION, |
|
364 | + 'user-agent' => 'Give/'.GIVE_VERSION, |
|
365 | 365 | 'httpversion' => '1.1', |
366 | 366 | 'body' => array( |
367 | 367 | 'cmd' => '_notify-validate' |
368 | 368 | ) |
369 | - ) ); |
|
369 | + )); |
|
370 | 370 | |
371 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
371 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
372 | 372 | $posting['wp_remote_post']['success'] = true; |
373 | 373 | } else { |
374 | - $posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give' ); |
|
375 | - if ( is_wp_error( $response ) ) { |
|
376 | - $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), sanitize_text_field( $response->get_error_message() ) ); |
|
374 | + $posting['wp_remote_post']['note'] = __('wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give'); |
|
375 | + if (is_wp_error($response)) { |
|
376 | + $posting['wp_remote_post']['note'] .= ' '.sprintf(__('Error: %s', 'give'), sanitize_text_field($response->get_error_message())); |
|
377 | 377 | } else { |
378 | - $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), sanitize_text_field( $response['response']['code'] ) ); |
|
378 | + $posting['wp_remote_post']['note'] .= ' '.sprintf(__('Status code: %s', 'give'), sanitize_text_field($response['response']['code'])); |
|
379 | 379 | } |
380 | 380 | $posting['wp_remote_post']['success'] = false; |
381 | 381 | } |
382 | 382 | |
383 | 383 | // WP Remote Get Check. |
384 | - $posting['wp_remote_get']['name'] = __( 'Remote Get', 'give'); |
|
385 | - $posting['wp_remote_get']['help'] = __( 'Give plugins may use this method of communication when checking for plugin updates.', 'give' ); |
|
384 | + $posting['wp_remote_get']['name'] = __('Remote Get', 'give'); |
|
385 | + $posting['wp_remote_get']['help'] = __('Give plugins may use this method of communication when checking for plugin updates.', 'give'); |
|
386 | 386 | |
387 | - $response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) ); |
|
387 | + $response = wp_safe_remote_get('https://woocommerce.com/wc-api/product-key-api?request=ping&network='.(is_multisite() ? '1' : '0')); |
|
388 | 388 | |
389 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
389 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
390 | 390 | $posting['wp_remote_get']['success'] = true; |
391 | 391 | } else { |
392 | - $posting['wp_remote_get']['note'] = __( 'wp_remote_get() failed. The Give plugin updater won\'t work with your server. Contact your hosting provider.', 'give' ); |
|
393 | - if ( is_wp_error( $response ) ) { |
|
394 | - $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), give_clean( $response->get_error_message() ) ); |
|
392 | + $posting['wp_remote_get']['note'] = __('wp_remote_get() failed. The Give plugin updater won\'t work with your server. Contact your hosting provider.', 'give'); |
|
393 | + if (is_wp_error($response)) { |
|
394 | + $posting['wp_remote_get']['note'] .= ' '.sprintf(__('Error: %s', 'give'), give_clean($response->get_error_message())); |
|
395 | 395 | } else { |
396 | - $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), give_clean( $response['response']['code'] ) ); |
|
396 | + $posting['wp_remote_get']['note'] .= ' '.sprintf(__('Status code: %s', 'give'), give_clean($response['response']['code'])); |
|
397 | 397 | } |
398 | 398 | $posting['wp_remote_get']['success'] = false; |
399 | 399 | } |
400 | 400 | |
401 | - $posting = apply_filters( 'give_debug_posting', $posting ); |
|
401 | + $posting = apply_filters('give_debug_posting', $posting); |
|
402 | 402 | |
403 | - foreach ( $posting as $post ) { |
|
404 | - $mark = ! empty( $post['success'] ) ? 'yes' : 'error'; |
|
403 | + foreach ($posting as $post) { |
|
404 | + $mark = ! empty($post['success']) ? 'yes' : 'error'; |
|
405 | 405 | ?> |
406 | 406 | <tr> |
407 | - <td data-export-label="<?php echo esc_html( $post['name'] ); ?>"><?php echo esc_html( $post['name'] ); ?>:</td> |
|
408 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( isset( $post['help'] ) ? $post['help'] : '' ); ?>"></span></td> |
|
407 | + <td data-export-label="<?php echo esc_html($post['name']); ?>"><?php echo esc_html($post['name']); ?>:</td> |
|
408 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(isset($post['help']) ? $post['help'] : ''); ?>"></span></td> |
|
409 | 409 | <td> |
410 | 410 | <mark class="<?php echo $mark; ?>"> |
411 | - <?php echo ! empty( $post['success'] ) ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no-alt"></span>'; ?> <?php echo ! empty( $post['note'] ) ? wp_kses_data( $post['note'] ) : ''; ?> |
|
411 | + <?php echo ! empty($post['success']) ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no-alt"></span>'; ?> <?php echo ! empty($post['note']) ? wp_kses_data($post['note']) : ''; ?> |
|
412 | 412 | </mark> |
413 | 413 | </td> |
414 | 414 | </tr> |
@@ -421,36 +421,36 @@ discard block |
||
421 | 421 | <table class="give-status-table widefat" cellspacing="0"> |
422 | 422 | <thead> |
423 | 423 | <tr> |
424 | - <th colspan="3" data-export-label="Give Configuration"><h2><?php _e( 'Give Configuration', 'give' ); ?></h2></th> |
|
424 | + <th colspan="3" data-export-label="Give Configuration"><h2><?php _e('Give Configuration', 'give'); ?></h2></th> |
|
425 | 425 | </tr> |
426 | 426 | </thead> |
427 | 427 | <tbody> |
428 | 428 | <tr> |
429 | - <td data-export-label="Give Version"><?php _e( 'Give Version', 'give' ); ?>:</td> |
|
430 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of Give installed on your site.', 'give' ) ); ?>"></span></td> |
|
431 | - <td><?php echo esc_html( GIVE_VERSION ); ?></td> |
|
429 | + <td data-export-label="Give Version"><?php _e('Give Version', 'give'); ?>:</td> |
|
430 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of Give installed on your site.', 'give')); ?>"></span></td> |
|
431 | + <td><?php echo esc_html(GIVE_VERSION); ?></td> |
|
432 | 432 | </tr> |
433 | 433 | <tr> |
434 | - <td data-export-label="Database Updates"><?php _e( 'Database Updates', 'give' ); ?>:</td> |
|
435 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e( 'This will show the number of pending database updates.', 'give' ); ?>"></span></td> |
|
434 | + <td data-export-label="Database Updates"><?php _e('Database Updates', 'give'); ?>:</td> |
|
435 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php _e('This will show the number of pending database updates.', 'give'); ?>"></span></td> |
|
436 | 436 | <td> |
437 | 437 | <?php |
438 | - $updates_text = __( 'All DB Updates Completed.', 'give' ); |
|
438 | + $updates_text = __('All DB Updates Completed.', 'give'); |
|
439 | 439 | $pending_updates = $give_updates->get_db_update_count(); |
440 | 440 | $total_updates = $give_updates->get_total_db_update_count(); |
441 | 441 | |
442 | - if( $pending_updates === $total_updates ) { |
|
442 | + if ($pending_updates === $total_updates) { |
|
443 | 443 | |
444 | 444 | // When all the db updates are pending. |
445 | 445 | $updates_text = sprintf( |
446 | - __( '%1$s updates still need to run.', 'give' ), |
|
446 | + __('%1$s updates still need to run.', 'give'), |
|
447 | 447 | $total_updates |
448 | 448 | ); |
449 | - } elseif( $pending_updates > 0 ) { |
|
449 | + } elseif ($pending_updates > 0) { |
|
450 | 450 | |
451 | 451 | // When some of the db updates are completed and some are pending. |
452 | 452 | $updates_text = sprintf( |
453 | - __( '%1$s of %2$s updates still need to run.', 'give' ), |
|
453 | + __('%1$s of %2$s updates still need to run.', 'give'), |
|
454 | 454 | $pending_updates, |
455 | 455 | $total_updates |
456 | 456 | ); |
@@ -461,112 +461,112 @@ discard block |
||
461 | 461 | </td> |
462 | 462 | </tr> |
463 | 463 | <tr> |
464 | - <td data-export-label="Upgraded From"><?php _e( 'Upgraded From', 'give' ); ?>:</td> |
|
465 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of Give installed prior to the last update.', 'give' ) ); ?>"></span></td> |
|
466 | - <td><?php echo esc_html( get_option( 'give_version_upgraded_from', '–' ) ); ?></td> |
|
464 | + <td data-export-label="Upgraded From"><?php _e('Upgraded From', 'give'); ?>:</td> |
|
465 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of Give installed prior to the last update.', 'give')); ?>"></span></td> |
|
466 | + <td><?php echo esc_html(get_option('give_version_upgraded_from', '–')); ?></td> |
|
467 | 467 | </tr> |
468 | 468 | <tr> |
469 | - <td data-export-label="Test Mode"><?php _e( 'Test Mode', 'give' ); ?>:</td> |
|
470 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether Test Mode is enabled in Give settings.', 'give' ) ); ?>"></span></td> |
|
471 | - <td><?php echo give_is_test_mode() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
469 | + <td data-export-label="Test Mode"><?php _e('Test Mode', 'give'); ?>:</td> |
|
470 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether Test Mode is enabled in Give settings.', 'give')); ?>"></span></td> |
|
471 | + <td><?php echo give_is_test_mode() ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
472 | 472 | </tr> |
473 | 473 | <tr> |
474 | - <td data-export-label="Currency Code"><?php _e( 'Currency Code', 'give' ); ?>:</td> |
|
475 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The currency code selected in Give settings.', 'give' ) ); ?>"></span></td> |
|
476 | - <td><?php echo esc_html( give_get_currency() ); ?></td> |
|
474 | + <td data-export-label="Currency Code"><?php _e('Currency Code', 'give'); ?>:</td> |
|
475 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The currency code selected in Give settings.', 'give')); ?>"></span></td> |
|
476 | + <td><?php echo esc_html(give_get_currency()); ?></td> |
|
477 | 477 | </tr> |
478 | 478 | <tr> |
479 | - <td data-export-label="Currency Position"><?php _e( 'Currency Position', 'give' ); ?>:</td> |
|
480 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The currency position selected in Give settings.', 'give' ) ); ?>"></span></td> |
|
481 | - <td><?php echo 'before' === give_get_option( 'currency_position' ) ? __( 'Before', 'give' ) : __( 'After', 'give' ); ?></td> |
|
479 | + <td data-export-label="Currency Position"><?php _e('Currency Position', 'give'); ?>:</td> |
|
480 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The currency position selected in Give settings.', 'give')); ?>"></span></td> |
|
481 | + <td><?php echo 'before' === give_get_option('currency_position') ? __('Before', 'give') : __('After', 'give'); ?></td> |
|
482 | 482 | </tr> |
483 | 483 | <tr> |
484 | - <td data-export-label="Decimal Separator"><?php _e( 'Decimal Separator', 'give' ); ?>:</td> |
|
485 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The decimal separator defined in Give settings.', 'give' ) ); ?>"></span></td> |
|
486 | - <td><?php echo esc_html( give_get_price_decimal_separator() ); ?></td> |
|
484 | + <td data-export-label="Decimal Separator"><?php _e('Decimal Separator', 'give'); ?>:</td> |
|
485 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The decimal separator defined in Give settings.', 'give')); ?>"></span></td> |
|
486 | + <td><?php echo esc_html(give_get_price_decimal_separator()); ?></td> |
|
487 | 487 | </tr> |
488 | 488 | <tr> |
489 | - <td data-export-label="Thousands Separator"><?php _e( 'Thousands Separator', 'give' ); ?>:</td> |
|
490 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The thousands separator defined in Give settings.', 'give' ) ); ?>"></span></td> |
|
491 | - <td><?php echo esc_html( give_get_price_thousand_separator() ); ?></td> |
|
489 | + <td data-export-label="Thousands Separator"><?php _e('Thousands Separator', 'give'); ?>:</td> |
|
490 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The thousands separator defined in Give settings.', 'give')); ?>"></span></td> |
|
491 | + <td><?php echo esc_html(give_get_price_thousand_separator()); ?></td> |
|
492 | 492 | </tr> |
493 | 493 | <tr> |
494 | - <td data-export-label="Success Page"><?php _e( 'Success Page', 'give' ); ?>:</td> |
|
495 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page where donors land following a successful transaction.', 'give' ) ); ?>"></span></td> |
|
496 | - <td><?php echo ! empty( $give_options['success_page'] ) ? esc_url( get_permalink( $give_options['success_page'] ) ) : '–'; ?></td> |
|
494 | + <td data-export-label="Success Page"><?php _e('Success Page', 'give'); ?>:</td> |
|
495 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page where donors land following a successful transaction.', 'give')); ?>"></span></td> |
|
496 | + <td><?php echo ! empty($give_options['success_page']) ? esc_url(get_permalink($give_options['success_page'])) : '–'; ?></td> |
|
497 | 497 | </tr> |
498 | 498 | <tr> |
499 | - <td data-export-label="Failure Page"><?php _e( 'Failure Page', 'give' ); ?>:</td> |
|
500 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page where donors land following a failed transaction.', 'give' ) ); ?>"></span></td> |
|
501 | - <td><?php echo ! empty( $give_options['failure_page'] ) ? esc_url( get_permalink( $give_options['failure_page'] ) ) : '–'; ?></td> |
|
499 | + <td data-export-label="Failure Page"><?php _e('Failure Page', 'give'); ?>:</td> |
|
500 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page where donors land following a failed transaction.', 'give')); ?>"></span></td> |
|
501 | + <td><?php echo ! empty($give_options['failure_page']) ? esc_url(get_permalink($give_options['failure_page'])) : '–'; ?></td> |
|
502 | 502 | </tr> |
503 | 503 | <tr> |
504 | - <td data-export-label="Donation History Page"><?php _e( 'Donation History Page', 'give' ); ?>:</td> |
|
505 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page where past donations are listed.', 'give' ) ); ?>"></span></td> |
|
506 | - <td><?php echo ! empty( $give_options['history_page'] ) ? esc_url( get_permalink( $give_options['history_page'] ) ) : '–'; ?></td> |
|
504 | + <td data-export-label="Donation History Page"><?php _e('Donation History Page', 'give'); ?>:</td> |
|
505 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page where past donations are listed.', 'give')); ?>"></span></td> |
|
506 | + <td><?php echo ! empty($give_options['history_page']) ? esc_url(get_permalink($give_options['history_page'])) : '–'; ?></td> |
|
507 | 507 | </tr> |
508 | 508 | <tr> |
509 | - <td data-export-label="Give Forms Slug"><?php _e( 'Give Forms Slug', 'give' ); ?>:</td> |
|
510 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The slug used for Give donation forms.', 'give' ) ); ?>"></span></td> |
|
511 | - <td><?php echo esc_html( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . '/' : '/donations/' ); ?></td> |
|
509 | + <td data-export-label="Give Forms Slug"><?php _e('Give Forms Slug', 'give'); ?>:</td> |
|
510 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The slug used for Give donation forms.', 'give')); ?>"></span></td> |
|
511 | + <td><?php echo esc_html(defined('GIVE_SLUG') ? '/'.GIVE_SLUG.'/' : '/donations/'); ?></td> |
|
512 | 512 | </tr> |
513 | 513 | <?php |
514 | 514 | $active_gateways = give_get_enabled_payment_gateways(); |
515 | 515 | $enabled_gateways = $default_gateway = ''; |
516 | 516 | |
517 | - if ( $active_gateways ) { |
|
518 | - $default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) ); |
|
517 | + if ($active_gateways) { |
|
518 | + $default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null)); |
|
519 | 519 | |
520 | - if ( $default_gateway_is_active ) { |
|
521 | - $default_gateway = give_get_default_gateway( null ); |
|
522 | - $default_gateway = $active_gateways[ $default_gateway ]['admin_label']; |
|
520 | + if ($default_gateway_is_active) { |
|
521 | + $default_gateway = give_get_default_gateway(null); |
|
522 | + $default_gateway = $active_gateways[$default_gateway]['admin_label']; |
|
523 | 523 | } else { |
524 | - $default_gateway = __( 'Test Donation', 'give' ); |
|
524 | + $default_gateway = __('Test Donation', 'give'); |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | $gateways = array(); |
528 | 528 | |
529 | - foreach ( $active_gateways as $gateway ) { |
|
529 | + foreach ($active_gateways as $gateway) { |
|
530 | 530 | $gateways[] = $gateway['admin_label']; |
531 | 531 | } |
532 | 532 | |
533 | - $enabled_gateways = implode( ', ', $gateways ); |
|
533 | + $enabled_gateways = implode(', ', $gateways); |
|
534 | 534 | } |
535 | 535 | ?> |
536 | 536 | <tr> |
537 | - <td data-export-label="Enabled Payment Gateways"><?php _e( 'Enabled Payment Gateways', 'give' ); ?>:</td> |
|
538 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'All payment gateways enabled in Give settings.', 'give' ) ); ?>"></span></td> |
|
539 | - <td><?php echo esc_html( ! empty( $enabled_gateways ) ? $enabled_gateways : '–' ); ?></td> |
|
537 | + <td data-export-label="Enabled Payment Gateways"><?php _e('Enabled Payment Gateways', 'give'); ?>:</td> |
|
538 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('All payment gateways enabled in Give settings.', 'give')); ?>"></span></td> |
|
539 | + <td><?php echo esc_html( ! empty($enabled_gateways) ? $enabled_gateways : '–'); ?></td> |
|
540 | 540 | </tr> |
541 | 541 | <tr> |
542 | - <td data-export-label="Default Payment Gateway"><?php _e( 'Default Payment Gateway', 'give' ); ?>:</td> |
|
543 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The default payment gateway selected in Give settings.', 'give' ) ); ?>"></span></td> |
|
544 | - <td><?php echo esc_html( ! empty( $default_gateway ) ? $default_gateway : '–' ); ?></td> |
|
542 | + <td data-export-label="Default Payment Gateway"><?php _e('Default Payment Gateway', 'give'); ?>:</td> |
|
543 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The default payment gateway selected in Give settings.', 'give')); ?>"></span></td> |
|
544 | + <td><?php echo esc_html( ! empty($default_gateway) ? $default_gateway : '–'); ?></td> |
|
545 | 545 | </tr> |
546 | 546 | <tr> |
547 | - <td data-export-label="PayPal IPN Verification"><?php _e( 'PayPal IPN Verification', 'give' ); ?>:</td> |
|
548 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether admins requires verification of IPN notifications with PayPal.', 'give' ) ); ?>"></span></td> |
|
549 | - <td><?php echo 'enabled' === give_get_option( 'paypal_verification' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
547 | + <td data-export-label="PayPal IPN Verification"><?php _e('PayPal IPN Verification', 'give'); ?>:</td> |
|
548 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether admins requires verification of IPN notifications with PayPal.', 'give')); ?>"></span></td> |
|
549 | + <td><?php echo 'enabled' === give_get_option('paypal_verification') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
550 | 550 | </tr> |
551 | 551 | <tr> |
552 | - <td data-export-label="PayPal IPN Notifications"><?php _e( 'PayPal IPN Notifications', 'give' ); ?>:</td> |
|
553 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Displays whether when last PayPal IPN is received with which donation or transaction.', 'give' ) ); ?>"></span></td> |
|
552 | + <td data-export-label="PayPal IPN Notifications"><?php _e('PayPal IPN Notifications', 'give'); ?>:</td> |
|
553 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Displays whether when last PayPal IPN is received with which donation or transaction.', 'give')); ?>"></span></td> |
|
554 | 554 | <td> |
555 | 555 | <?php |
556 | - $last_paypal_ipn_received = get_option( 'give_last_paypal_ipn_received' ); |
|
557 | - if( is_array( $last_paypal_ipn_received ) && count( $last_paypal_ipn_received ) > 0 ) { |
|
556 | + $last_paypal_ipn_received = get_option('give_last_paypal_ipn_received'); |
|
557 | + if (is_array($last_paypal_ipn_received) && count($last_paypal_ipn_received) > 0) { |
|
558 | 558 | $donation_id = $last_paypal_ipn_received['payment_id']; |
559 | - $ipn_timestamp = give_get_meta( $donation_id, 'give_last_paypal_ipn_received', true ); |
|
560 | - $transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=' . $last_paypal_ipn_received['transaction_id']; |
|
561 | - $donation_url = site_url() . '/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $donation_id; |
|
559 | + $ipn_timestamp = give_get_meta($donation_id, 'give_last_paypal_ipn_received', true); |
|
560 | + $transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id='.$last_paypal_ipn_received['transaction_id']; |
|
561 | + $donation_url = site_url().'/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$donation_id; |
|
562 | 562 | echo sprintf( |
563 | - __( 'IPN received for <a href="%s">#%s</a> ( <a href="%s" target="_blank">%s</a> ) on %s at %s. Status %s', 'give' ), |
|
563 | + __('IPN received for <a href="%s">#%s</a> ( <a href="%s" target="_blank">%s</a> ) on %s at %s. Status %s', 'give'), |
|
564 | 564 | $donation_url, |
565 | 565 | $donation_id, |
566 | 566 | $transaction_url, |
567 | 567 | $last_paypal_ipn_received['transaction_id'], |
568 | - date_i18n( 'm/d/Y', $ipn_timestamp ), |
|
569 | - date_i18n( 'H:i', $ipn_timestamp ), |
|
568 | + date_i18n('m/d/Y', $ipn_timestamp), |
|
569 | + date_i18n('H:i', $ipn_timestamp), |
|
570 | 570 | $last_paypal_ipn_received['auth_status'] |
571 | 571 | ); |
572 | 572 | } else { |
@@ -576,14 +576,14 @@ discard block |
||
576 | 576 | </td> |
577 | 577 | </tr> |
578 | 578 | <tr> |
579 | - <td data-export-label="Admin Email Notifications"><?php _e( 'Admin Email Notifications', 'give' ); ?>:</td> |
|
580 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether admins receive email notifications of transactions.', 'give' ) ); ?>"></span></td> |
|
581 | - <td><?php echo 'enabled' === give_get_option( 'admin_notices' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
579 | + <td data-export-label="Admin Email Notifications"><?php _e('Admin Email Notifications', 'give'); ?>:</td> |
|
580 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether admins receive email notifications of transactions.', 'give')); ?>"></span></td> |
|
581 | + <td><?php echo 'enabled' === give_get_option('admin_notices') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
582 | 582 | </tr> |
583 | 583 | <tr> |
584 | - <td data-export-label="Donor Email Access"><?php _e( 'Donor Email Access', 'give' ); ?>:</td> |
|
585 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether donors can access their donation history using only email.', 'give' ) ); ?>"></span></td> |
|
586 | - <td><?php echo 'enabled' === give_get_option( 'email_access' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
584 | + <td data-export-label="Donor Email Access"><?php _e('Donor Email Access', 'give'); ?>:</td> |
|
585 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether donors can access their donation history using only email.', 'give')); ?>"></span></td> |
|
586 | + <td><?php echo 'enabled' === give_get_option('email_access') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
587 | 587 | </tr> |
588 | 588 | </tbody> |
589 | 589 | </table> |
@@ -591,45 +591,45 @@ discard block |
||
591 | 591 | <table class="give-status-table widefat" cellspacing="0"> |
592 | 592 | <thead> |
593 | 593 | <tr> |
594 | - <th colspan="3" data-export-label="Session Configuration"><h2><?php _e( 'Session Configuration', 'give' ); ?></h2></th> |
|
594 | + <th colspan="3" data-export-label="Session Configuration"><h2><?php _e('Session Configuration', 'give'); ?></h2></th> |
|
595 | 595 | </tr> |
596 | 596 | </thead> |
597 | 597 | <tbody> |
598 | 598 | <tr> |
599 | - <td data-export-label="Give Use Sessions"><?php _e( 'Give Use Sessions', 'give' ); ?>:</td> |
|
600 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether PHP sessions are enforced, enabled, or disabled.', 'give' ) ); ?>"></span></td> |
|
601 | - <td><?php echo defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? __( 'Enforced', 'give' ) : ( Give()->session->use_php_sessions() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ) ); ?></td> |
|
599 | + <td data-export-label="Give Use Sessions"><?php _e('Give Use Sessions', 'give'); ?>:</td> |
|
600 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether PHP sessions are enforced, enabled, or disabled.', 'give')); ?>"></span></td> |
|
601 | + <td><?php echo defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? __('Enforced', 'give') : (Give()->session->use_php_sessions() ? __('Enabled', 'give') : __('Disabled', 'give')); ?></td> |
|
602 | 602 | </tr> |
603 | 603 | <tr> |
604 | - <td data-export-label="Session"><?php _e( 'Session', 'give' ); ?>:</td> |
|
605 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether a PHP session is currently set.', 'give' ) ); ?>"></span></td> |
|
606 | - <td><?php echo isset( $_SESSION ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
604 | + <td data-export-label="Session"><?php _e('Session', 'give'); ?>:</td> |
|
605 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether a PHP session is currently set.', 'give')); ?>"></span></td> |
|
606 | + <td><?php echo isset($_SESSION) ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
607 | 607 | </tr> |
608 | - <?php if ( isset( $_SESSION ) ) { ?> |
|
608 | + <?php if (isset($_SESSION)) { ?> |
|
609 | 609 | <tr> |
610 | - <td data-export-label="Session Name"><?php _e( 'Session Name', 'give' ); ?>:</td> |
|
611 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The name of the current PHP session.', 'give' ) ); ?>"></span></td> |
|
612 | - <td><?php echo esc_html( ini_get( 'session.name' ) ); ?></td> |
|
610 | + <td data-export-label="Session Name"><?php _e('Session Name', 'give'); ?>:</td> |
|
611 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The name of the current PHP session.', 'give')); ?>"></span></td> |
|
612 | + <td><?php echo esc_html(ini_get('session.name')); ?></td> |
|
613 | 613 | </tr> |
614 | 614 | <tr> |
615 | - <td data-export-label="Cookie Path"><?php _e( 'Cookie Path', 'give' ); ?>:</td> |
|
616 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The cookie path of the current PHP session.', 'give' ) ); ?>"></span></td> |
|
617 | - <td><?php echo esc_html( ini_get( 'session.cookie_path' ) ); ?></td> |
|
615 | + <td data-export-label="Cookie Path"><?php _e('Cookie Path', 'give'); ?>:</td> |
|
616 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The cookie path of the current PHP session.', 'give')); ?>"></span></td> |
|
617 | + <td><?php echo esc_html(ini_get('session.cookie_path')); ?></td> |
|
618 | 618 | </tr> |
619 | 619 | <tr> |
620 | - <td data-export-label="Save Path"><?php _e( 'Save Path', 'give' ); ?>:</td> |
|
621 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The save path of the current PHP session.', 'give' ) ); ?>"></span></td> |
|
622 | - <td><?php echo esc_html( ini_get( 'session.save_path' ) ); ?></td> |
|
620 | + <td data-export-label="Save Path"><?php _e('Save Path', 'give'); ?>:</td> |
|
621 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The save path of the current PHP session.', 'give')); ?>"></span></td> |
|
622 | + <td><?php echo esc_html(ini_get('session.save_path')); ?></td> |
|
623 | 623 | </tr> |
624 | 624 | <tr> |
625 | - <td data-export-label="Use Cookies"><?php _e( 'Use Cookies', 'give' ); ?>:</td> |
|
626 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether the current PHP session is set to use cookies.', 'give' ) ); ?>"></span></td> |
|
627 | - <td><?php echo ini_get( 'session.use_cookies' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
625 | + <td data-export-label="Use Cookies"><?php _e('Use Cookies', 'give'); ?>:</td> |
|
626 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether the current PHP session is set to use cookies.', 'give')); ?>"></span></td> |
|
627 | + <td><?php echo ini_get('session.use_cookies') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
628 | 628 | </tr> |
629 | 629 | <tr> |
630 | - <td data-export-label="Use Only Cookies"><?php _e( 'Use Only Cookies', 'give' ); ?>:</td> |
|
631 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether the current PHP session is set to use only cookies.', 'give' ) ); ?>"></span></td> |
|
632 | - <td><?php echo ini_get( 'session.use_only_cookies' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
630 | + <td data-export-label="Use Only Cookies"><?php _e('Use Only Cookies', 'give'); ?>:</td> |
|
631 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether the current PHP session is set to use only cookies.', 'give')); ?>"></span></td> |
|
632 | + <td><?php echo ini_get('session.use_only_cookies') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
633 | 633 | </tr> |
634 | 634 | <?php } ?> |
635 | 635 | </tbody> |
@@ -638,13 +638,13 @@ discard block |
||
638 | 638 | <table class="give-status-table widefat" cellspacing="0"> |
639 | 639 | <thead> |
640 | 640 | <tr> |
641 | - <th colspan="3" data-export-label="Active Give Add-ons"><h2><?php _e( 'Active Give Add-ons', 'give' ); ?></h2></th> |
|
641 | + <th colspan="3" data-export-label="Active Give Add-ons"><h2><?php _e('Active Give Add-ons', 'give'); ?></h2></th> |
|
642 | 642 | </tr> |
643 | 643 | </thead> |
644 | 644 | <tbody> |
645 | 645 | <?php |
646 | - foreach ( $plugins as $plugin_data ) { |
|
647 | - if ( 'active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type'] ) { |
|
646 | + foreach ($plugins as $plugin_data) { |
|
647 | + if ('active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type']) { |
|
648 | 648 | continue; |
649 | 649 | } |
650 | 650 | |
@@ -652,30 +652,30 @@ discard block |
||
652 | 652 | $author_name = $plugin_data['Author']; |
653 | 653 | |
654 | 654 | // Link the plugin name to the plugin URL if available. |
655 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
656 | - $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
655 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
656 | + $plugin_name = '<a href="'.esc_url($plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
657 | 657 | } |
658 | 658 | |
659 | 659 | // Link the author name to the author URL if available. |
660 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
661 | - $author_name = '<a href="' . esc_url( $plugin_data['AuthorURI'] ) . '" title="' . esc_attr__( 'Visit author homepage' , 'give' ) . '">' . $author_name . '</a>'; |
|
660 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
661 | + $author_name = '<a href="'.esc_url($plugin_data['AuthorURI']).'" title="'.esc_attr__('Visit author homepage', 'give').'">'.$author_name.'</a>'; |
|
662 | 662 | } |
663 | 663 | ?> |
664 | 664 | <tr> |
665 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
665 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
666 | 666 | <td class="help"> </td> |
667 | 667 | <td> |
668 | 668 | <?php |
669 | - if ( true === $plugin_data['License'] ) { |
|
670 | - echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> ' . __( 'Licensed', 'give' ); |
|
669 | + if (true === $plugin_data['License']) { |
|
670 | + echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> '.__('Licensed', 'give'); |
|
671 | 671 | } else { |
672 | - echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> ' . __( 'Unlicensed', 'give' ); |
|
672 | + echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> '.__('Unlicensed', 'give'); |
|
673 | 673 | } |
674 | 674 | |
675 | 675 | echo ' – ' |
676 | - . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) |
|
676 | + . sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))) |
|
677 | 677 | . ' – ' |
678 | - . esc_html( $plugin_data['Version'] ); |
|
678 | + . esc_html($plugin_data['Version']); |
|
679 | 679 | ?> |
680 | 680 | </td> |
681 | 681 | </tr> |
@@ -688,18 +688,18 @@ discard block |
||
688 | 688 | <table class="give-status-table widefat" cellspacing="0"> |
689 | 689 | <thead> |
690 | 690 | <tr> |
691 | - <th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e( 'Other Active Plugins', 'give' ); ?></h2></th> |
|
691 | + <th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e('Other Active Plugins', 'give'); ?></h2></th> |
|
692 | 692 | </tr> |
693 | 693 | </thead> |
694 | 694 | <tbody> |
695 | 695 | <?php |
696 | - foreach ( $plugins as $plugin_data ) { |
|
697 | - if ( 'active' != $plugin_data['Status'] || 'other' != $plugin_data['Type'] ) { |
|
696 | + foreach ($plugins as $plugin_data) { |
|
697 | + if ('active' != $plugin_data['Status'] || 'other' != $plugin_data['Type']) { |
|
698 | 698 | continue; |
699 | 699 | } |
700 | 700 | |
701 | 701 | // Do not show Give core plugin. |
702 | - if ( 'Give - Donation Plugin' === $plugin_data['Name'] ) { |
|
702 | + if ('Give - Donation Plugin' === $plugin_data['Name']) { |
|
703 | 703 | continue; |
704 | 704 | } |
705 | 705 | |
@@ -707,19 +707,19 @@ discard block |
||
707 | 707 | $author_name = $plugin_data['Author']; |
708 | 708 | |
709 | 709 | // Link the plugin name to the plugin URL if available. |
710 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
711 | - $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
710 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
711 | + $plugin_name = '<a href="'.esc_url($plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
712 | 712 | } |
713 | 713 | |
714 | 714 | // Link the author name to the author URL if available. |
715 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
716 | - $author_name = '<a href="' . esc_url( $plugin_data['AuthorURI'] ) . '" title="' . esc_attr__( 'Visit author homepage' , 'give' ) . '">' . $author_name . '</a>'; |
|
715 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
716 | + $author_name = '<a href="'.esc_url($plugin_data['AuthorURI']).'" title="'.esc_attr__('Visit author homepage', 'give').'">'.$author_name.'</a>'; |
|
717 | 717 | } |
718 | 718 | ?> |
719 | 719 | <tr> |
720 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
720 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
721 | 721 | <td class="help"> </td> |
722 | - <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' – ' . esc_html( $plugin_data['Version'] ); ?></td> |
|
722 | + <td><?php echo sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))).' – '.esc_html($plugin_data['Version']); ?></td> |
|
723 | 723 | </tr> |
724 | 724 | <?php |
725 | 725 | } |
@@ -730,13 +730,13 @@ discard block |
||
730 | 730 | <table class="give-status-table widefat" cellspacing="0"> |
731 | 731 | <thead> |
732 | 732 | <tr> |
733 | - <th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e( 'Inactive Plugins', 'give' ); ?></h2></th> |
|
733 | + <th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e('Inactive Plugins', 'give'); ?></h2></th> |
|
734 | 734 | </tr> |
735 | 735 | </thead> |
736 | 736 | <tbody> |
737 | 737 | <?php |
738 | - foreach ( $plugins as $plugin_data ) { |
|
739 | - if ( 'inactive' != $plugin_data['Status'] ) { |
|
738 | + foreach ($plugins as $plugin_data) { |
|
739 | + if ('inactive' != $plugin_data['Status']) { |
|
740 | 740 | continue; |
741 | 741 | } |
742 | 742 | |
@@ -744,19 +744,19 @@ discard block |
||
744 | 744 | $author_name = $plugin_data['Author']; |
745 | 745 | |
746 | 746 | // Link the plugin name to the plugin URL if available. |
747 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
748 | - $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
747 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
748 | + $plugin_name = '<a href="'.esc_url($plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
749 | 749 | } |
750 | 750 | |
751 | 751 | // Link the author name to the author URL if available. |
752 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
753 | - $author_name = '<a href="' . esc_url( $plugin_data['AuthorURI'] ) . '" title="' . esc_attr__( 'Visit author homepage' , 'give' ) . '">' . $author_name . '</a>'; |
|
752 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
753 | + $author_name = '<a href="'.esc_url($plugin_data['AuthorURI']).'" title="'.esc_attr__('Visit author homepage', 'give').'">'.$author_name.'</a>'; |
|
754 | 754 | } |
755 | 755 | ?> |
756 | 756 | <tr> |
757 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
757 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
758 | 758 | <td class="help"> </td> |
759 | - <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' – ' . esc_html( $plugin_data['Version'] ); ?></td> |
|
759 | + <td><?php echo sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))).' – '.esc_html($plugin_data['Version']); ?></td> |
|
760 | 760 | </tr> |
761 | 761 | <?php |
762 | 762 | } |
@@ -766,37 +766,37 @@ discard block |
||
766 | 766 | |
767 | 767 | <?php |
768 | 768 | $active_mu_plugins = (array) get_mu_plugins(); |
769 | -if ( ! empty( $active_mu_plugins ) ) { |
|
769 | +if ( ! empty($active_mu_plugins)) { |
|
770 | 770 | ?> |
771 | 771 | <table class="give-status-table widefat" cellspacing="0"> |
772 | 772 | <thead> |
773 | 773 | <tr> |
774 | - <th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e( 'Active MU Plugins', 'give' ); ?></h2></th> |
|
774 | + <th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e('Active MU Plugins', 'give'); ?></h2></th> |
|
775 | 775 | </tr> |
776 | 776 | </thead> |
777 | 777 | <tbody> |
778 | 778 | <?php |
779 | 779 | |
780 | - foreach ( $active_mu_plugins as $mu_plugin_data ) { |
|
781 | - if ( ! empty( $mu_plugin_data['Name'] ) ) { |
|
780 | + foreach ($active_mu_plugins as $mu_plugin_data) { |
|
781 | + if ( ! empty($mu_plugin_data['Name'])) { |
|
782 | 782 | // Link the plugin name to the plugin URL if available. |
783 | - $plugin_name = esc_html( $mu_plugin_data['Name'] ); |
|
783 | + $plugin_name = esc_html($mu_plugin_data['Name']); |
|
784 | 784 | |
785 | - if ( ! empty( $mu_plugin_data['PluginURI'] ) ) { |
|
786 | - $plugin_name = '<a href="' . esc_url( $mu_plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
785 | + if ( ! empty($mu_plugin_data['PluginURI'])) { |
|
786 | + $plugin_name = '<a href="'.esc_url($mu_plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
787 | 787 | } |
788 | 788 | |
789 | 789 | // Link the author name to the author URL if available. |
790 | - $author_name = esc_html( $mu_plugin_data['Author'] ); |
|
790 | + $author_name = esc_html($mu_plugin_data['Author']); |
|
791 | 791 | |
792 | - if ( ! empty( $mu_plugin_data['AuthorURI'] ) ) { |
|
793 | - $author_name = '<a href="' . esc_url( $mu_plugin_data['AuthorURI'] ) . '">' . $author_name . '</a>'; |
|
792 | + if ( ! empty($mu_plugin_data['AuthorURI'])) { |
|
793 | + $author_name = '<a href="'.esc_url($mu_plugin_data['AuthorURI']).'">'.$author_name.'</a>'; |
|
794 | 794 | } |
795 | 795 | ?> |
796 | 796 | <tr> |
797 | 797 | <td><?php echo $plugin_name; ?></td> |
798 | 798 | <td class="help"> </td> |
799 | - <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), $author_name ) . ' – ' . esc_html( $mu_plugin_data['Version'] ); ?></td> |
|
799 | + <td><?php echo sprintf(_x('by %s', 'by author', 'give'), $author_name).' – '.esc_html($mu_plugin_data['Version']); ?></td> |
|
800 | 800 | </tr> |
801 | 801 | <?php |
802 | 802 | } |
@@ -809,53 +809,53 @@ discard block |
||
809 | 809 | <table class="give-status-table widefat" cellspacing="0"> |
810 | 810 | <thead> |
811 | 811 | <tr> |
812 | - <th colspan="3" data-export-label="Theme"><h2><?php _e( 'Theme', 'give' ); ?></h2></th> |
|
812 | + <th colspan="3" data-export-label="Theme"><h2><?php _e('Theme', 'give'); ?></h2></th> |
|
813 | 813 | </tr> |
814 | 814 | </thead> |
815 | 815 | <?php |
816 | - include_once( ABSPATH . 'wp-admin/includes/theme-install.php' ); |
|
816 | + include_once(ABSPATH.'wp-admin/includes/theme-install.php'); |
|
817 | 817 | $active_theme = wp_get_theme(); |
818 | 818 | ?> |
819 | 819 | <tbody> |
820 | 820 | <tr> |
821 | - <td data-export-label="Name"><?php _e( 'Name', 'give' ); ?>:</td> |
|
822 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The name of the current active theme.', 'give' ) ); ?>"></span></td> |
|
823 | - <td><?php echo esc_html( $active_theme->Name ); ?></td> |
|
821 | + <td data-export-label="Name"><?php _e('Name', 'give'); ?>:</td> |
|
822 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The name of the current active theme.', 'give')); ?>"></span></td> |
|
823 | + <td><?php echo esc_html($active_theme->Name); ?></td> |
|
824 | 824 | </tr> |
825 | 825 | <tr> |
826 | - <td data-export-label="Version"><?php _e( 'Version', 'give' ); ?>:</td> |
|
827 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The installed version of the current active theme.', 'give' ) ); ?>"></span></td> |
|
828 | - <td><?php echo esc_html( $active_theme->Version ); ?></td> |
|
826 | + <td data-export-label="Version"><?php _e('Version', 'give'); ?>:</td> |
|
827 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The installed version of the current active theme.', 'give')); ?>"></span></td> |
|
828 | + <td><?php echo esc_html($active_theme->Version); ?></td> |
|
829 | 829 | </tr> |
830 | 830 | <tr> |
831 | - <td data-export-label="Author URL"><?php _e( 'Author URL', 'give' ); ?>:</td> |
|
832 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The theme developer\'s URL.', 'give' ) ); ?>"></span></td> |
|
831 | + <td data-export-label="Author URL"><?php _e('Author URL', 'give'); ?>:</td> |
|
832 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The theme developer\'s URL.', 'give')); ?>"></span></td> |
|
833 | 833 | <td><?php echo $active_theme->{'Author URI'}; ?></td> |
834 | 834 | </tr> |
835 | 835 | <tr> |
836 | - <td data-export-label="Child Theme"><?php _e( 'Child Theme', 'give' ); ?>:</td> |
|
837 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether the current theme is a child theme.', 'give' ) ); ?>"></span></td> |
|
836 | + <td data-export-label="Child Theme"><?php _e('Child Theme', 'give'); ?>:</td> |
|
837 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether the current theme is a child theme.', 'give')); ?>"></span></td> |
|
838 | 838 | <td><?php |
839 | - echo is_child_theme() ? __( 'Yes', 'give' ) : __( 'No', 'give' ) . ' – ' . sprintf( __( 'If you\'re modifying Give on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to Create a Child Theme</a>', 'give' ), 'https://codex.wordpress.org/Child_Themes' ); |
|
839 | + echo is_child_theme() ? __('Yes', 'give') : __('No', 'give').' – '.sprintf(__('If you\'re modifying Give on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to Create a Child Theme</a>', 'give'), 'https://codex.wordpress.org/Child_Themes'); |
|
840 | 840 | ?></td> |
841 | 841 | </tr> |
842 | 842 | <?php |
843 | - if( is_child_theme() ) { |
|
844 | - $parent_theme = wp_get_theme( $active_theme->Template ); |
|
843 | + if (is_child_theme()) { |
|
844 | + $parent_theme = wp_get_theme($active_theme->Template); |
|
845 | 845 | ?> |
846 | 846 | <tr> |
847 | - <td data-export-label="Parent Theme Name"><?php _e( 'Parent Theme Name', 'give' ); ?>:</td> |
|
848 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The name of the parent theme.', 'give' ) ); ?>"></span></td> |
|
849 | - <td><?php echo esc_html( $parent_theme->Name ); ?></td> |
|
847 | + <td data-export-label="Parent Theme Name"><?php _e('Parent Theme Name', 'give'); ?>:</td> |
|
848 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The name of the parent theme.', 'give')); ?>"></span></td> |
|
849 | + <td><?php echo esc_html($parent_theme->Name); ?></td> |
|
850 | 850 | </tr> |
851 | 851 | <tr> |
852 | - <td data-export-label="Parent Theme Version"><?php _e( 'Parent Theme Version', 'give' ); ?>:</td> |
|
853 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The installed version of the parent theme.', 'give' ) ); ?>"></span></td> |
|
854 | - <td><?php echo esc_html( $parent_theme->Version ); ?></td> |
|
852 | + <td data-export-label="Parent Theme Version"><?php _e('Parent Theme Version', 'give'); ?>:</td> |
|
853 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The installed version of the parent theme.', 'give')); ?>"></span></td> |
|
854 | + <td><?php echo esc_html($parent_theme->Version); ?></td> |
|
855 | 855 | </tr> |
856 | 856 | <tr> |
857 | - <td data-export-label="Parent Theme Author URL"><?php _e( 'Parent Theme Author URL', 'give' ); ?>:</td> |
|
858 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The parent theme developers URL.', 'give' ) ); ?>"></span></td> |
|
857 | + <td data-export-label="Parent Theme Author URL"><?php _e('Parent Theme Author URL', 'give'); ?>:</td> |
|
858 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The parent theme developers URL.', 'give')); ?>"></span></td> |
|
859 | 859 | <td><?php echo $parent_theme->{'Author URI'}; ?></td> |
860 | 860 | </tr> |
861 | 861 | <?php } ?> |
@@ -58,7 +58,12 @@ discard block |
||
58 | 58 | <tr> |
59 | 59 | <td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'give' ); ?>:</td> |
60 | 60 | <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether or not you have WordPress Multisite enabled.', 'give' ) ); ?>"></span></td> |
61 | - <td><?php if ( is_multisite() ) echo '<span class="dashicons dashicons-yes"></span>'; else echo '–'; ?></td> |
|
61 | + <td><?php if ( is_multisite() ) { |
|
62 | + echo '<span class="dashicons dashicons-yes"></span>'; |
|
63 | +} else { |
|
64 | + echo '–'; |
|
65 | +} |
|
66 | +?></td> |
|
62 | 67 | </tr> |
63 | 68 | <tr> |
64 | 69 | <td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'give' ); ?>:</td> |
@@ -86,9 +91,12 @@ discard block |
||
86 | 91 | <td> |
87 | 92 | <?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?> |
88 | 93 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
89 | - <?php else : ?> |
|
94 | + <?php else { |
|
95 | + : ?> |
|
90 | 96 | <mark class="no">–</mark> |
91 | - <?php endif; ?> |
|
97 | + <?php endif; |
|
98 | +} |
|
99 | +?> |
|
92 | 100 | </td> |
93 | 101 | </tr> |
94 | 102 | <tr> |
@@ -97,9 +105,12 @@ discard block |
||
97 | 105 | <td> |
98 | 106 | <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?> |
99 | 107 | <mark class="no">–</mark> |
100 | - <?php else : ?> |
|
108 | + <?php else { |
|
109 | + : ?> |
|
101 | 110 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
102 | - <?php endif; ?> |
|
111 | + <?php endif; |
|
112 | +} |
|
113 | +?> |
|
103 | 114 | </td> |
104 | 115 | </tr> |
105 | 116 | <tr> |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly. |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -80,108 +80,106 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function get_data() { |
82 | 82 | |
83 | - $totals = $this->get_stored_data( 'give_temp_recount_all_stats' ); |
|
84 | - $payment_items = $this->get_stored_data( 'give_temp_payment_items' ); |
|
85 | - $processed_payments = $this->get_stored_data( 'give_temp_processed_payments' ); |
|
86 | - $accepted_statuses = apply_filters( 'give_recount_accepted_statuses', array( 'publish' ) ); |
|
83 | + $totals = $this->get_stored_data('give_temp_recount_all_stats'); |
|
84 | + $payment_items = $this->get_stored_data('give_temp_payment_items'); |
|
85 | + $processed_payments = $this->get_stored_data('give_temp_processed_payments'); |
|
86 | + $accepted_statuses = apply_filters('give_recount_accepted_statuses', array('publish')); |
|
87 | 87 | |
88 | - if ( false === $totals ) { |
|
88 | + if (false === $totals) { |
|
89 | 89 | $totals = array(); |
90 | 90 | } |
91 | 91 | |
92 | - if ( false === $payment_items ) { |
|
92 | + if (false === $payment_items) { |
|
93 | 93 | $payment_items = array(); |
94 | 94 | } |
95 | 95 | |
96 | - if ( false === $processed_payments ) { |
|
96 | + if (false === $processed_payments) { |
|
97 | 97 | $processed_payments = array(); |
98 | 98 | } |
99 | 99 | |
100 | - $all_forms = $this->get_stored_data( 'give_temp_form_ids' ); |
|
100 | + $all_forms = $this->get_stored_data('give_temp_form_ids'); |
|
101 | 101 | |
102 | - $payments = $this->get_stored_data( 'give_temp_all_payments_data' ); |
|
102 | + $payments = $this->get_stored_data('give_temp_all_payments_data'); |
|
103 | 103 | |
104 | - if ( empty( $payments ) ) { |
|
105 | - $args = apply_filters( 'give_recount_form_stats_args', array( |
|
104 | + if (empty($payments)) { |
|
105 | + $args = apply_filters('give_recount_form_stats_args', array( |
|
106 | 106 | 'give_forms' => $all_forms, |
107 | 107 | 'number' => $this->per_step, |
108 | 108 | 'status' => $accepted_statuses, |
109 | 109 | 'paged' => $this->step, |
110 | 110 | 'output' => 'give_payments', |
111 | - ) ); |
|
111 | + )); |
|
112 | 112 | |
113 | - $payments_query = new Give_Payments_Query( $args ); |
|
113 | + $payments_query = new Give_Payments_Query($args); |
|
114 | 114 | $payments = $payments_query->get_payments(); |
115 | 115 | } |
116 | 116 | |
117 | - if ( ! empty( $payments ) ) { |
|
117 | + if ( ! empty($payments)) { |
|
118 | 118 | |
119 | 119 | //Loop through payments |
120 | - foreach ( $payments as $payment ) { |
|
120 | + foreach ($payments as $payment) { |
|
121 | 121 | |
122 | - $payment_id = ( ! empty( $payment['ID'] ) ? absint( $payment['ID'] ) : ( ! empty( $payment->ID ) ? absint( $payment->ID ) : false ) ); |
|
123 | - $payment = new Give_Payment( $payment_id ); |
|
122 | + $payment_id = ( ! empty($payment['ID']) ? absint($payment['ID']) : ( ! empty($payment->ID) ? absint($payment->ID) : false)); |
|
123 | + $payment = new Give_Payment($payment_id); |
|
124 | 124 | |
125 | 125 | // Prevent payments that have all ready been retrieved from a previous sales log from counting again. |
126 | - if ( in_array( $payment->ID, $processed_payments ) ) { |
|
126 | + if (in_array($payment->ID, $processed_payments)) { |
|
127 | 127 | continue; |
128 | 128 | } |
129 | 129 | |
130 | 130 | // Verify accepted status. |
131 | - if ( ! in_array( $payment->post_status, $accepted_statuses ) ) { |
|
131 | + if ( ! in_array($payment->post_status, $accepted_statuses)) { |
|
132 | 132 | $processed_payments[] = $payment->ID; |
133 | 133 | continue; |
134 | 134 | } |
135 | 135 | |
136 | - $payment_item = $payment_items[ $payment->ID ]; |
|
136 | + $payment_item = $payment_items[$payment->ID]; |
|
137 | 137 | |
138 | - $form_id = isset( $payment_item['id'] ) ? $payment_item['id'] : ''; |
|
138 | + $form_id = isset($payment_item['id']) ? $payment_item['id'] : ''; |
|
139 | 139 | |
140 | 140 | // Must have a form ID. |
141 | - if ( empty( $form_id ) ) { |
|
141 | + if (empty($form_id)) { |
|
142 | 142 | continue; |
143 | 143 | } |
144 | 144 | |
145 | 145 | // Form ID must be within $all_forms array to be validated. |
146 | - if ( ! in_array( $form_id, $all_forms ) ) { |
|
146 | + if ( ! in_array($form_id, $all_forms)) { |
|
147 | 147 | continue; |
148 | 148 | } |
149 | 149 | |
150 | 150 | // Set Sales count |
151 | - $totals[ $form_id ]['sales'] = isset( $totals[ $form_id ]['sales'] ) ? |
|
152 | - ++ $totals[ $form_id ]['sales'] : |
|
153 | - 1; |
|
151 | + $totals[$form_id]['sales'] = isset($totals[$form_id]['sales']) ? |
|
152 | + ++$totals[$form_id]['sales'] : 1; |
|
154 | 153 | |
155 | 154 | // Set Total Earnings |
156 | - $totals[ $form_id ]['earnings'] = isset( $totals[ $form_id ]['earnings'] ) ? |
|
157 | - ( $totals[ $form_id ]['earnings'] + $payment_item['price'] ) : |
|
158 | - $payment_item['price']; |
|
155 | + $totals[$form_id]['earnings'] = isset($totals[$form_id]['earnings']) ? |
|
156 | + ($totals[$form_id]['earnings'] + $payment_item['price']) : $payment_item['price']; |
|
159 | 157 | |
160 | 158 | $processed_payments[] = $payment->ID; |
161 | 159 | } |
162 | 160 | |
163 | 161 | // Get the list of form ids which does not contain any payment record. |
164 | - $remaining_form_ids = array_diff( $all_forms, array_keys( $totals ) ); |
|
165 | - foreach ( $remaining_form_ids as $form_id ) { |
|
162 | + $remaining_form_ids = array_diff($all_forms, array_keys($totals)); |
|
163 | + foreach ($remaining_form_ids as $form_id) { |
|
166 | 164 | //If array key doesn't exist, create it |
167 | - if ( ! array_key_exists( $form_id, $totals ) ) { |
|
168 | - $totals[ $form_id ] = array( |
|
165 | + if ( ! array_key_exists($form_id, $totals)) { |
|
166 | + $totals[$form_id] = array( |
|
169 | 167 | 'sales' => (int) 0, |
170 | 168 | 'earnings' => (float) 0, |
171 | 169 | ); |
172 | 170 | } |
173 | 171 | } |
174 | 172 | |
175 | - $this->store_data( 'give_temp_processed_payments', $processed_payments ); |
|
176 | - $this->store_data( 'give_temp_recount_all_stats', $totals ); |
|
173 | + $this->store_data('give_temp_processed_payments', $processed_payments); |
|
174 | + $this->store_data('give_temp_recount_all_stats', $totals); |
|
177 | 175 | |
178 | 176 | return true; |
179 | 177 | } |
180 | 178 | |
181 | 179 | |
182 | - foreach ( $totals as $key => $stats ) { |
|
183 | - give_update_meta( $key, '_give_form_sales', $stats['sales'] ); |
|
184 | - give_update_meta( $key, '_give_form_earnings', give_sanitize_amount_for_db( $stats['earnings'] ) ); |
|
180 | + foreach ($totals as $key => $stats) { |
|
181 | + give_update_meta($key, '_give_form_sales', $stats['sales']); |
|
182 | + give_update_meta($key, '_give_form_earnings', give_sanitize_amount_for_db($stats['earnings'])); |
|
185 | 183 | } |
186 | 184 | |
187 | 185 | return false; |
@@ -196,20 +194,20 @@ discard block |
||
196 | 194 | */ |
197 | 195 | public function get_percentage_complete() { |
198 | 196 | |
199 | - $total = $this->get_stored_data( 'give_recount_all_total' ); |
|
197 | + $total = $this->get_stored_data('give_recount_all_total'); |
|
200 | 198 | |
201 | - if ( false === $total ) { |
|
199 | + if (false === $total) { |
|
202 | 200 | $this->pre_fetch(); |
203 | - $total = $this->get_stored_data( 'give_recount_all_total' ); |
|
201 | + $total = $this->get_stored_data('give_recount_all_total'); |
|
204 | 202 | } |
205 | 203 | |
206 | 204 | $percentage = 100; |
207 | 205 | |
208 | - if ( $total > 0 ) { |
|
209 | - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; |
|
206 | + if ($total > 0) { |
|
207 | + $percentage = (($this->per_step * $this->step) / $total) * 100; |
|
210 | 208 | } |
211 | 209 | |
212 | - if ( $percentage > 100 ) { |
|
210 | + if ($percentage > 100) { |
|
213 | 211 | $percentage = 100; |
214 | 212 | } |
215 | 213 | |
@@ -223,8 +221,8 @@ discard block |
||
223 | 221 | * |
224 | 222 | * @param array $request The Form Data passed into the batch processing |
225 | 223 | */ |
226 | - public function set_properties( $request ) { |
|
227 | - $this->form_id = isset( $request['form_id'] ) ? sanitize_text_field( $request['form_id'] ) : false; |
|
224 | + public function set_properties($request) { |
|
225 | + $this->form_id = isset($request['form_id']) ? sanitize_text_field($request['form_id']) : false; |
|
228 | 226 | } |
229 | 227 | |
230 | 228 | /** |
@@ -235,25 +233,25 @@ discard block |
||
235 | 233 | */ |
236 | 234 | public function process_step() { |
237 | 235 | |
238 | - if ( ! $this->can_export() ) { |
|
239 | - wp_die( esc_html__( 'You do not have permission to recount stats.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
236 | + if ( ! $this->can_export()) { |
|
237 | + wp_die(esc_html__('You do not have permission to recount stats.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
240 | 238 | } |
241 | 239 | |
242 | 240 | $had_data = $this->get_data(); |
243 | 241 | |
244 | - if ( $had_data ) { |
|
242 | + if ($had_data) { |
|
245 | 243 | $this->done = false; |
246 | 244 | |
247 | 245 | return true; |
248 | 246 | } else { |
249 | - $this->delete_data( 'give_recount_total_' . $this->form_id ); |
|
250 | - $this->delete_data( 'give_recount_all_total' ); |
|
251 | - $this->delete_data( 'give_temp_recount_all_stats' ); |
|
252 | - $this->delete_data( 'give_temp_payment_items' ); |
|
253 | - $this->delete_data( 'give_temp_form_ids' ); |
|
254 | - $this->delete_data( 'give_temp_processed_payments' ); |
|
247 | + $this->delete_data('give_recount_total_'.$this->form_id); |
|
248 | + $this->delete_data('give_recount_all_total'); |
|
249 | + $this->delete_data('give_temp_recount_all_stats'); |
|
250 | + $this->delete_data('give_temp_payment_items'); |
|
251 | + $this->delete_data('give_temp_form_ids'); |
|
252 | + $this->delete_data('give_temp_processed_payments'); |
|
255 | 253 | $this->done = true; |
256 | - $this->message = esc_html__( 'Donation form income amounts and donation counts stats successfully recounted.', 'give' ); |
|
254 | + $this->message = esc_html__('Donation form income amounts and donation counts stats successfully recounted.', 'give'); |
|
257 | 255 | |
258 | 256 | return false; |
259 | 257 | } |
@@ -289,70 +287,70 @@ discard block |
||
289 | 287 | */ |
290 | 288 | public function pre_fetch() { |
291 | 289 | |
292 | - if ( 1 == $this->step ) { |
|
293 | - $this->delete_data( 'give_temp_recount_all_total' ); |
|
294 | - $this->delete_data( 'give_temp_recount_all_stats' ); |
|
295 | - $this->delete_data( 'give_temp_payment_items' ); |
|
296 | - $this->delete_data( 'give_temp_processed_payments' ); |
|
297 | - $this->delete_data( 'give_temp_all_payments_data' ); |
|
290 | + if (1 == $this->step) { |
|
291 | + $this->delete_data('give_temp_recount_all_total'); |
|
292 | + $this->delete_data('give_temp_recount_all_stats'); |
|
293 | + $this->delete_data('give_temp_payment_items'); |
|
294 | + $this->delete_data('give_temp_processed_payments'); |
|
295 | + $this->delete_data('give_temp_all_payments_data'); |
|
298 | 296 | } |
299 | 297 | |
300 | - $accepted_statuses = apply_filters( 'give_recount_accepted_statuses', array( 'publish' ) ); |
|
301 | - $total = $this->get_stored_data( 'give_temp_recount_all_total' ); |
|
298 | + $accepted_statuses = apply_filters('give_recount_accepted_statuses', array('publish')); |
|
299 | + $total = $this->get_stored_data('give_temp_recount_all_total'); |
|
302 | 300 | |
303 | - if ( false === $total ) { |
|
301 | + if (false === $total) { |
|
304 | 302 | |
305 | - $payment_items = $this->get_stored_data( 'give_temp_payment_items' ); |
|
303 | + $payment_items = $this->get_stored_data('give_temp_payment_items'); |
|
306 | 304 | |
307 | - if ( false === $payment_items ) { |
|
305 | + if (false === $payment_items) { |
|
308 | 306 | $payment_items = array(); |
309 | - $this->store_data( 'give_temp_payment_items', $payment_items ); |
|
307 | + $this->store_data('give_temp_payment_items', $payment_items); |
|
310 | 308 | } |
311 | 309 | |
312 | 310 | $args = array( |
313 | 311 | 'post_status' => 'publish', |
314 | 312 | 'post_type' => 'give_forms', |
315 | - 'posts_per_page' => - 1, |
|
313 | + 'posts_per_page' => -1, |
|
316 | 314 | 'fields' => 'ids', |
317 | 315 | ); |
318 | 316 | |
319 | - $all_forms = get_posts( $args ); |
|
317 | + $all_forms = get_posts($args); |
|
320 | 318 | |
321 | - $this->store_data( 'give_temp_form_ids', $all_forms ); |
|
319 | + $this->store_data('give_temp_form_ids', $all_forms); |
|
322 | 320 | |
323 | - $args = apply_filters( 'give_recount_form_stats_total_args', array( |
|
321 | + $args = apply_filters('give_recount_form_stats_total_args', array( |
|
324 | 322 | 'give_forms' => $all_forms, |
325 | 323 | 'number' => $this->per_step, |
326 | 324 | 'status' => $accepted_statuses, |
327 | 325 | 'page' => $this->step, |
328 | 326 | 'output' => 'payments', |
329 | - ) ); |
|
327 | + )); |
|
330 | 328 | |
331 | - $payments_query = new Give_Payments_Query( $args ); |
|
329 | + $payments_query = new Give_Payments_Query($args); |
|
332 | 330 | $payments = $payments_query->get_payments(); |
333 | 331 | |
334 | - $total = wp_count_posts( 'give_payment' )->publish; |
|
332 | + $total = wp_count_posts('give_payment')->publish; |
|
335 | 333 | |
336 | - $this->store_data( 'give_temp_all_payments_data', $payments ); |
|
334 | + $this->store_data('give_temp_all_payments_data', $payments); |
|
337 | 335 | |
338 | - if ( $payments ) { |
|
336 | + if ($payments) { |
|
339 | 337 | |
340 | - foreach ( $payments as $payment ) { |
|
338 | + foreach ($payments as $payment) { |
|
341 | 339 | |
342 | 340 | $form_id = $payment->form_id; |
343 | 341 | |
344 | 342 | //If for some reason somehow the form_ID isn't set check payment meta |
345 | - if ( empty( $payment->form_id ) ) { |
|
343 | + if (empty($payment->form_id)) { |
|
346 | 344 | $payment_meta = $payment->get_meta(); |
347 | - $form_id = isset( $payment_meta['form_id'] ) ? $payment_meta['form_id'] : 0; |
|
345 | + $form_id = isset($payment_meta['form_id']) ? $payment_meta['form_id'] : 0; |
|
348 | 346 | } |
349 | 347 | |
350 | - if ( ! in_array( $payment->post_status, $accepted_statuses ) ) { |
|
348 | + if ( ! in_array($payment->post_status, $accepted_statuses)) { |
|
351 | 349 | continue; |
352 | 350 | } |
353 | 351 | |
354 | - if ( ! array_key_exists( $payment->ID, $payment_items ) ) { |
|
355 | - $payment_items[ $payment->ID ] = array( |
|
352 | + if ( ! array_key_exists($payment->ID, $payment_items)) { |
|
353 | + $payment_items[$payment->ID] = array( |
|
356 | 354 | 'id' => $form_id, |
357 | 355 | 'payment_id' => $payment->ID, |
358 | 356 | 'price' => $payment->total, |
@@ -360,8 +358,8 @@ discard block |
||
360 | 358 | } |
361 | 359 | } |
362 | 360 | } |
363 | - $this->store_data( 'give_temp_payment_items', $payment_items ); |
|
364 | - $this->store_data( 'give_recount_all_total', $total ); |
|
361 | + $this->store_data('give_temp_payment_items', $payment_items); |
|
362 | + $this->store_data('give_recount_all_total', $total); |
|
365 | 363 | } |
366 | 364 | |
367 | 365 | } |
@@ -375,17 +373,17 @@ discard block |
||
375 | 373 | * |
376 | 374 | * @return mixed Returns the data from the database |
377 | 375 | */ |
378 | - private function get_stored_data( $key ) { |
|
376 | + private function get_stored_data($key) { |
|
379 | 377 | global $wpdb; |
380 | - $value = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key ) ); |
|
381 | - if ( empty( $value ) ) { |
|
378 | + $value = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key)); |
|
379 | + if (empty($value)) { |
|
382 | 380 | return false; |
383 | 381 | } |
384 | 382 | |
385 | - $maybe_json = json_decode( $value ); |
|
383 | + $maybe_json = json_decode($value); |
|
386 | 384 | |
387 | - if ( ! is_null( $maybe_json ) ) { |
|
388 | - $value = json_decode( $value, true ); |
|
385 | + if ( ! is_null($maybe_json)) { |
|
386 | + $value = json_decode($value, true); |
|
389 | 387 | } |
390 | 388 | |
391 | 389 | return $value; |
@@ -401,10 +399,10 @@ discard block |
||
401 | 399 | * |
402 | 400 | * @return void |
403 | 401 | */ |
404 | - private function store_data( $key, $value ) { |
|
402 | + private function store_data($key, $value) { |
|
405 | 403 | global $wpdb; |
406 | 404 | |
407 | - $value = is_array( $value ) ? wp_json_encode( $value ) : esc_attr( $value ); |
|
405 | + $value = is_array($value) ? wp_json_encode($value) : esc_attr($value); |
|
408 | 406 | |
409 | 407 | $data = array( |
410 | 408 | 'option_name' => $key, |
@@ -418,7 +416,7 @@ discard block |
||
418 | 416 | '%s', |
419 | 417 | ); |
420 | 418 | |
421 | - $wpdb->replace( $wpdb->options, $data, $formats ); |
|
419 | + $wpdb->replace($wpdb->options, $data, $formats); |
|
422 | 420 | } |
423 | 421 | |
424 | 422 | /** |
@@ -430,9 +428,9 @@ discard block |
||
430 | 428 | * |
431 | 429 | * @return void |
432 | 430 | */ |
433 | - private function delete_data( $key ) { |
|
431 | + private function delete_data($key) { |
|
434 | 432 | global $wpdb; |
435 | - $wpdb->delete( $wpdb->options, array( 'option_name' => $key ) ); |
|
433 | + $wpdb->delete($wpdb->options, array('option_name' => $key)); |
|
436 | 434 | } |
437 | 435 | |
438 | 436 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly. |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -53,40 +53,40 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function get_data() { |
55 | 55 | |
56 | - $donor = new Give_Donor( $this->customer_id ); |
|
57 | - $payments = $this->get_stored_data( 'give_recount_donor_payments_' . $donor->id ); |
|
56 | + $donor = new Give_Donor($this->customer_id); |
|
57 | + $payments = $this->get_stored_data('give_recount_donor_payments_'.$donor->id); |
|
58 | 58 | |
59 | - $offset = ( $this->step - 1 ) * $this->per_step; |
|
60 | - $step_items = array_slice( $payments, $offset, $this->per_step ); |
|
59 | + $offset = ($this->step - 1) * $this->per_step; |
|
60 | + $step_items = array_slice($payments, $offset, $this->per_step); |
|
61 | 61 | |
62 | - if ( count( $step_items ) > 0 ) { |
|
63 | - $pending_total = (float) $this->get_stored_data( 'give_stats_donor_pending_total' . $donor->id ); |
|
62 | + if (count($step_items) > 0) { |
|
63 | + $pending_total = (float) $this->get_stored_data('give_stats_donor_pending_total'.$donor->id); |
|
64 | 64 | $step_total = 0; |
65 | 65 | |
66 | - $found_payment_ids = $this->get_stored_data( 'give_stats_found_payments_' . $donor->id ); |
|
66 | + $found_payment_ids = $this->get_stored_data('give_stats_found_payments_'.$donor->id); |
|
67 | 67 | |
68 | - foreach ( $step_items as $payment ) { |
|
69 | - $payment = get_post( $payment->ID ); |
|
68 | + foreach ($step_items as $payment) { |
|
69 | + $payment = get_post($payment->ID); |
|
70 | 70 | |
71 | - if ( is_null( $payment ) || is_wp_error( $payment ) || 'give_payment' !== $payment->post_type ) { |
|
71 | + if (is_null($payment) || is_wp_error($payment) || 'give_payment' !== $payment->post_type) { |
|
72 | 72 | |
73 | - $missing_payments = $this->get_stored_data( 'give_stats_missing_payments' . $donor->id ); |
|
73 | + $missing_payments = $this->get_stored_data('give_stats_missing_payments'.$donor->id); |
|
74 | 74 | $missing_payments[] = $payment->ID; |
75 | - $this->store_data( 'give_stats_missing_payments' . $donor->id, $missing_payments ); |
|
75 | + $this->store_data('give_stats_missing_payments'.$donor->id, $missing_payments); |
|
76 | 76 | |
77 | 77 | continue; |
78 | 78 | } |
79 | 79 | |
80 | 80 | $should_process_payment = 'publish' == $payment->post_status ? true : false; |
81 | - $should_process_payment = apply_filters( 'give_donor_recount_should_process_donation', $should_process_payment, $payment ); |
|
81 | + $should_process_payment = apply_filters('give_donor_recount_should_process_donation', $should_process_payment, $payment); |
|
82 | 82 | |
83 | - if ( true === $should_process_payment ) { |
|
83 | + if (true === $should_process_payment) { |
|
84 | 84 | |
85 | 85 | $found_payment_ids[] = $payment->ID; |
86 | 86 | |
87 | - if ( apply_filters( 'give_donor_recount_should_increase_value', true, $payment ) ) { |
|
88 | - $payment_amount = (float) give_donation_amount( $payment->ID, array( 'type' => 'stats' ) ); |
|
89 | - $step_total += $payment_amount; |
|
87 | + if (apply_filters('give_donor_recount_should_increase_value', true, $payment)) { |
|
88 | + $payment_amount = (float) give_donation_amount($payment->ID, array('type' => 'stats')); |
|
89 | + $step_total += $payment_amount; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | } |
@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | $updated_total = $pending_total + $step_total; |
97 | - $this->store_data( 'give_stats_donor_pending_total' . $donor->id, $updated_total ); |
|
98 | - $this->store_data( 'give_stats_found_payments_' . $donor->id, $found_payment_ids ); |
|
97 | + $this->store_data('give_stats_donor_pending_total'.$donor->id, $updated_total); |
|
98 | + $this->store_data('give_stats_found_payments_'.$donor->id, $found_payment_ids); |
|
99 | 99 | |
100 | 100 | return true; |
101 | 101 | } |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function get_percentage_complete() { |
114 | 114 | |
115 | - $payments = $this->get_stored_data( 'give_recount_donor_payments_' . $this->customer_id ); |
|
116 | - $total = count( $payments ); |
|
115 | + $payments = $this->get_stored_data('give_recount_donor_payments_'.$this->customer_id); |
|
116 | + $total = count($payments); |
|
117 | 117 | |
118 | 118 | $percentage = 100; |
119 | 119 | |
120 | - if ( $total > 0 ) { |
|
121 | - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; |
|
120 | + if ($total > 0) { |
|
121 | + $percentage = (($this->per_step * $this->step) / $total) * 100; |
|
122 | 122 | } |
123 | 123 | |
124 | - if ( $percentage > 100 ) { |
|
124 | + if ($percentage > 100) { |
|
125 | 125 | $percentage = 100; |
126 | 126 | } |
127 | 127 | |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @param array $request The Form Data passed into the batch processing |
137 | 137 | */ |
138 | - public function set_properties( $request ) { |
|
139 | - $this->customer_id = isset( $request['customer_id'] ) ? sanitize_text_field( $request['customer_id'] ) : false; |
|
138 | + public function set_properties($request) { |
|
139 | + $this->customer_id = isset($request['customer_id']) ? sanitize_text_field($request['customer_id']) : false; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -147,53 +147,53 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function process_step() { |
149 | 149 | |
150 | - if ( ! $this->can_export() ) { |
|
151 | - wp_die( esc_html__( 'You do not have permission to recount stats.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
150 | + if ( ! $this->can_export()) { |
|
151 | + wp_die(esc_html__('You do not have permission to recount stats.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | $had_data = $this->get_data(); |
155 | 155 | |
156 | - if ( $had_data ) { |
|
156 | + if ($had_data) { |
|
157 | 157 | $this->done = false; |
158 | 158 | |
159 | 159 | return true; |
160 | 160 | } else { |
161 | - $donor = new Give_Donor( $this->customer_id ); |
|
162 | - $payment_ids = get_option( 'give_stats_found_payments_' . $donor->id, array() ); |
|
163 | - $this->delete_data( 'give_stats_found_payments_' . $donor->id ); |
|
161 | + $donor = new Give_Donor($this->customer_id); |
|
162 | + $payment_ids = get_option('give_stats_found_payments_'.$donor->id, array()); |
|
163 | + $this->delete_data('give_stats_found_payments_'.$donor->id); |
|
164 | 164 | |
165 | - $removed_payments = array_unique( get_option( 'give_stats_missing_payments' . $donor->id, array() ) ); |
|
165 | + $removed_payments = array_unique(get_option('give_stats_missing_payments'.$donor->id, array())); |
|
166 | 166 | |
167 | 167 | // Find non-existing payments (deleted) and total up the donation count |
168 | 168 | $purchase_count = 0; |
169 | - foreach ( $payment_ids as $key => $payment_id ) { |
|
170 | - if ( in_array( $payment_id, $removed_payments ) ) { |
|
171 | - unset( $payment_ids[ $key ] ); |
|
169 | + foreach ($payment_ids as $key => $payment_id) { |
|
170 | + if (in_array($payment_id, $removed_payments)) { |
|
171 | + unset($payment_ids[$key]); |
|
172 | 172 | continue; |
173 | 173 | } |
174 | 174 | |
175 | - $payment = get_post( $payment_id ); |
|
176 | - if ( apply_filters( 'give_donor_recount_should_increase_count', true, $payment ) ) { |
|
177 | - $purchase_count ++; |
|
175 | + $payment = get_post($payment_id); |
|
176 | + if (apply_filters('give_donor_recount_should_increase_count', true, $payment)) { |
|
177 | + $purchase_count++; |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | |
181 | - $this->delete_data( 'give_stats_missing_payments' . $donor->id ); |
|
181 | + $this->delete_data('give_stats_missing_payments'.$donor->id); |
|
182 | 182 | |
183 | - $pending_total = $this->get_stored_data( 'give_stats_donor_pending_total' . $donor->id ); |
|
184 | - $this->delete_data( 'give_stats_donor_pending_total' . $donor->id ); |
|
185 | - $this->delete_data( 'give_recount_donor_stats_' . $donor->id ); |
|
186 | - $this->delete_data( 'give_recount_donor_payments_' . $this->customer_id ); |
|
183 | + $pending_total = $this->get_stored_data('give_stats_donor_pending_total'.$donor->id); |
|
184 | + $this->delete_data('give_stats_donor_pending_total'.$donor->id); |
|
185 | + $this->delete_data('give_recount_donor_stats_'.$donor->id); |
|
186 | + $this->delete_data('give_recount_donor_payments_'.$this->customer_id); |
|
187 | 187 | |
188 | - $payment_ids = implode( ',', $payment_ids ); |
|
189 | - $donor->update( array( |
|
188 | + $payment_ids = implode(',', $payment_ids); |
|
189 | + $donor->update(array( |
|
190 | 190 | 'payment_ids' => $payment_ids, |
191 | 191 | 'purchase_count' => $purchase_count, |
192 | 192 | 'purchase_value' => $pending_total, |
193 | - ) ); |
|
193 | + )); |
|
194 | 194 | |
195 | 195 | $this->done = true; |
196 | - $this->message = esc_html__( 'Donor stats have been successfully recounted.', 'give' ); |
|
196 | + $this->message = esc_html__('Donor stats have been successfully recounted.', 'give'); |
|
197 | 197 | |
198 | 198 | return false; |
199 | 199 | } |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | * @return void |
227 | 227 | */ |
228 | 228 | public function pre_fetch() { |
229 | - if ( $this->step === 1 ) { |
|
230 | - $allowed_payment_status = apply_filters( 'give_recount_donors_donation_statuses', give_get_payment_status_keys() ); |
|
229 | + if ($this->step === 1) { |
|
230 | + $allowed_payment_status = apply_filters('give_recount_donors_donation_statuses', give_get_payment_status_keys()); |
|
231 | 231 | |
232 | 232 | // Before we start, let's zero out the customer's data |
233 | - $donor = new Give_Donor( $this->customer_id ); |
|
234 | - $donor->update( array( 'purchase_value' => give_format_amount( 0, array( 'sanitize' => false ) ), 'purchase_count' => 0 ) ); |
|
233 | + $donor = new Give_Donor($this->customer_id); |
|
234 | + $donor->update(array('purchase_value' => give_format_amount(0, array('sanitize' => false)), 'purchase_count' => 0)); |
|
235 | 235 | |
236 | - $attached_payment_ids = explode( ',', $donor->payment_ids ); |
|
236 | + $attached_payment_ids = explode(',', $donor->payment_ids); |
|
237 | 237 | |
238 | 238 | $attached_args = array( |
239 | 239 | 'post__in' => $attached_payment_ids, |
240 | - 'number' => - 1, |
|
240 | + 'number' => -1, |
|
241 | 241 | 'status' => $allowed_payment_status, |
242 | 242 | ); |
243 | 243 | |
244 | - $attached_payments = give_get_payments( $attached_args ); |
|
244 | + $attached_payments = give_get_payments($attached_args); |
|
245 | 245 | |
246 | 246 | $unattached_args = array( |
247 | 247 | 'post__not_in' => $attached_payment_ids, |
248 | - 'number' => - 1, |
|
248 | + 'number' => -1, |
|
249 | 249 | 'status' => $allowed_payment_status, |
250 | 250 | 'meta_query' => array( |
251 | 251 | array( |
@@ -255,11 +255,11 @@ discard block |
||
255 | 255 | ), |
256 | 256 | ); |
257 | 257 | |
258 | - $unattached_payments = give_get_payments( $unattached_args ); |
|
258 | + $unattached_payments = give_get_payments($unattached_args); |
|
259 | 259 | |
260 | - $payments = array_merge( $attached_payments, $unattached_payments ); |
|
260 | + $payments = array_merge($attached_payments, $unattached_payments); |
|
261 | 261 | |
262 | - $this->store_data( 'give_recount_donor_payments_' . $donor->id, $payments ); |
|
262 | + $this->store_data('give_recount_donor_payments_'.$donor->id, $payments); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
@@ -272,17 +272,17 @@ discard block |
||
272 | 272 | * |
273 | 273 | * @return mixed Returns the data from the database |
274 | 274 | */ |
275 | - private function get_stored_data( $key ) { |
|
275 | + private function get_stored_data($key) { |
|
276 | 276 | global $wpdb; |
277 | - $value = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key ) ); |
|
277 | + $value = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key)); |
|
278 | 278 | |
279 | - if ( empty( $value ) ) { |
|
279 | + if (empty($value)) { |
|
280 | 280 | return false; |
281 | 281 | } |
282 | 282 | |
283 | - $maybe_json = json_decode( $value ); |
|
284 | - if ( ! is_null( $maybe_json ) ) { |
|
285 | - $value = json_decode( $value, true ); |
|
283 | + $maybe_json = json_decode($value); |
|
284 | + if ( ! is_null($maybe_json)) { |
|
285 | + $value = json_decode($value, true); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | return $value; |
@@ -298,10 +298,10 @@ discard block |
||
298 | 298 | * |
299 | 299 | * @return void |
300 | 300 | */ |
301 | - private function store_data( $key, $value ) { |
|
301 | + private function store_data($key, $value) { |
|
302 | 302 | global $wpdb; |
303 | 303 | |
304 | - $value = is_array( $value ) ? wp_json_encode( $value ) : esc_attr( $value ); |
|
304 | + $value = is_array($value) ? wp_json_encode($value) : esc_attr($value); |
|
305 | 305 | |
306 | 306 | $data = array( |
307 | 307 | 'option_name' => $key, |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | '%s', |
316 | 316 | ); |
317 | 317 | |
318 | - $wpdb->replace( $wpdb->options, $data, $formats ); |
|
318 | + $wpdb->replace($wpdb->options, $data, $formats); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | * |
328 | 328 | * @return void |
329 | 329 | */ |
330 | - private function delete_data( $key ) { |
|
330 | + private function delete_data($key) { |
|
331 | 331 | global $wpdb; |
332 | - $wpdb->delete( $wpdb->options, array( 'option_name' => $key ) ); |
|
332 | + $wpdb->delete($wpdb->options, array('option_name' => $key)); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly. |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -53,49 +53,49 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function get_data() { |
55 | 55 | |
56 | - if ( $this->step == 1 ) { |
|
57 | - $this->delete_data( 'give_temp_recount_earnings' ); |
|
56 | + if ($this->step == 1) { |
|
57 | + $this->delete_data('give_temp_recount_earnings'); |
|
58 | 58 | } |
59 | 59 | |
60 | - $total = get_option( 'give_temp_recount_earnings', false ); |
|
60 | + $total = get_option('give_temp_recount_earnings', false); |
|
61 | 61 | |
62 | - if ( false === $total ) { |
|
62 | + if (false === $total) { |
|
63 | 63 | $total = (float) 0; |
64 | - $this->store_data( 'give_temp_recount_earnings', $total ); |
|
64 | + $this->store_data('give_temp_recount_earnings', $total); |
|
65 | 65 | } |
66 | 66 | |
67 | - $accepted_statuses = apply_filters( 'give_recount_accepted_statuses', array( 'publish' ) ); |
|
67 | + $accepted_statuses = apply_filters('give_recount_accepted_statuses', array('publish')); |
|
68 | 68 | |
69 | - $args = apply_filters( 'give_recount_earnings_args', array( |
|
69 | + $args = apply_filters('give_recount_earnings_args', array( |
|
70 | 70 | 'number' => $this->per_step, |
71 | 71 | 'page' => $this->step, |
72 | 72 | 'status' => $accepted_statuses, |
73 | 73 | 'fields' => 'ids' |
74 | - ) ); |
|
74 | + )); |
|
75 | 75 | |
76 | - $payments = give_get_payments( $args ); |
|
76 | + $payments = give_get_payments($args); |
|
77 | 77 | |
78 | - if ( ! empty( $payments ) ) { |
|
78 | + if ( ! empty($payments)) { |
|
79 | 79 | |
80 | - foreach ( $payments as $payment ) { |
|
80 | + foreach ($payments as $payment) { |
|
81 | 81 | |
82 | - $total += (float) give_donation_amount( $payment, array( 'type' => 'stats' ) ); |
|
82 | + $total += (float) give_donation_amount($payment, array('type' => 'stats')); |
|
83 | 83 | |
84 | 84 | } |
85 | 85 | |
86 | - if ( $total < 0 ) { |
|
86 | + if ($total < 0) { |
|
87 | 87 | $totals = 0; |
88 | 88 | } |
89 | 89 | |
90 | - $total = round( $total, give_get_price_decimals() ); |
|
90 | + $total = round($total, give_get_price_decimals()); |
|
91 | 91 | |
92 | - $this->store_data( 'give_temp_recount_earnings', $total ); |
|
92 | + $this->store_data('give_temp_recount_earnings', $total); |
|
93 | 93 | |
94 | 94 | return true; |
95 | 95 | |
96 | 96 | } |
97 | 97 | |
98 | - update_option( 'give_earnings_total', $total ); |
|
98 | + update_option('give_earnings_total', $total); |
|
99 | 99 | |
100 | 100 | return false; |
101 | 101 | |
@@ -109,25 +109,25 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function get_percentage_complete() { |
111 | 111 | |
112 | - $total = $this->get_stored_data( 'give_recount_earnings_total' ); |
|
112 | + $total = $this->get_stored_data('give_recount_earnings_total'); |
|
113 | 113 | |
114 | - if ( false === $total ) { |
|
115 | - $args = apply_filters( 'give_recount_earnings_total_args', array() ); |
|
114 | + if (false === $total) { |
|
115 | + $args = apply_filters('give_recount_earnings_total_args', array()); |
|
116 | 116 | |
117 | - $counts = give_count_payments( $args ); |
|
118 | - $total = absint( $counts->publish ); |
|
119 | - $total = apply_filters( 'give_recount_store_earnings_total', $total ); |
|
117 | + $counts = give_count_payments($args); |
|
118 | + $total = absint($counts->publish); |
|
119 | + $total = apply_filters('give_recount_store_earnings_total', $total); |
|
120 | 120 | |
121 | - $this->store_data( 'give_recount_earnings_total', $total ); |
|
121 | + $this->store_data('give_recount_earnings_total', $total); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $percentage = 100; |
125 | 125 | |
126 | - if ( $total > 0 ) { |
|
127 | - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; |
|
126 | + if ($total > 0) { |
|
127 | + $percentage = (($this->per_step * $this->step) / $total) * 100; |
|
128 | 128 | } |
129 | 129 | |
130 | - if ( $percentage > 100 ) { |
|
130 | + if ($percentage > 100) { |
|
131 | 131 | $percentage = 100; |
132 | 132 | } |
133 | 133 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * |
142 | 142 | * @param array $request The Form Data passed into the batch processing |
143 | 143 | */ |
144 | - public function set_properties( $request ) { |
|
144 | + public function set_properties($request) { |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -152,21 +152,21 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function process_step() { |
154 | 154 | |
155 | - if ( ! $this->can_export() ) { |
|
156 | - wp_die( esc_html__( 'You do not have permission to recount stats.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
155 | + if ( ! $this->can_export()) { |
|
156 | + wp_die(esc_html__('You do not have permission to recount stats.', 'give'), esc_html__('Error', 'give'), array('response' => 403)); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $had_data = $this->get_data(); |
160 | 160 | |
161 | - if ( $had_data ) { |
|
161 | + if ($had_data) { |
|
162 | 162 | $this->done = false; |
163 | 163 | |
164 | 164 | return true; |
165 | 165 | } else { |
166 | - $this->delete_data( 'give_recount_earnings_total' ); |
|
167 | - $this->delete_data( 'give_temp_recount_earnings' ); |
|
166 | + $this->delete_data('give_recount_earnings_total'); |
|
167 | + $this->delete_data('give_temp_recount_earnings'); |
|
168 | 168 | $this->done = true; |
169 | - $this->message = esc_html__( 'Income stats have been successfully recounted.', 'give' ); |
|
169 | + $this->message = esc_html__('Income stats have been successfully recounted.', 'give'); |
|
170 | 170 | |
171 | 171 | return false; |
172 | 172 | } |
@@ -203,17 +203,17 @@ discard block |
||
203 | 203 | * |
204 | 204 | * @return mixed Returns the data from the database |
205 | 205 | */ |
206 | - private function get_stored_data( $key ) { |
|
206 | + private function get_stored_data($key) { |
|
207 | 207 | global $wpdb; |
208 | - $value = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key ) ); |
|
208 | + $value = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key)); |
|
209 | 209 | |
210 | - if ( empty( $value ) ) { |
|
210 | + if (empty($value)) { |
|
211 | 211 | return false; |
212 | 212 | } |
213 | 213 | |
214 | - $maybe_json = json_decode( $value ); |
|
215 | - if ( ! is_null( $maybe_json ) ) { |
|
216 | - $value = json_decode( $value, true ); |
|
214 | + $maybe_json = json_decode($value); |
|
215 | + if ( ! is_null($maybe_json)) { |
|
216 | + $value = json_decode($value, true); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | return $value; |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | * |
230 | 230 | * @return void |
231 | 231 | */ |
232 | - private function store_data( $key, $value ) { |
|
232 | + private function store_data($key, $value) { |
|
233 | 233 | global $wpdb; |
234 | 234 | |
235 | - $value = is_array( $value ) ? wp_json_encode( $value ) : esc_attr( $value ); |
|
235 | + $value = is_array($value) ? wp_json_encode($value) : esc_attr($value); |
|
236 | 236 | |
237 | 237 | $data = array( |
238 | 238 | 'option_name' => $key, |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | '%s', |
247 | 247 | ); |
248 | 248 | |
249 | - $wpdb->replace( $wpdb->options, $data, $formats ); |
|
249 | + $wpdb->replace($wpdb->options, $data, $formats); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -258,9 +258,9 @@ discard block |
||
258 | 258 | * |
259 | 259 | * @return void |
260 | 260 | */ |
261 | - private function delete_data( $key ) { |
|
261 | + private function delete_data($key) { |
|
262 | 262 | global $wpdb; |
263 | - $wpdb->delete( $wpdb->options, array( 'option_name' => $key ) ); |
|
263 | + $wpdb->delete($wpdb->options, array('option_name' => $key)); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | } |
@@ -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 | |
@@ -57,32 +57,32 @@ discard block |
||
57 | 57 | |
58 | 58 | $args = array( |
59 | 59 | 'number' => $this->per_step, |
60 | - 'offset' => $this->per_step * ( $this->step - 1 ), |
|
60 | + 'offset' => $this->per_step * ($this->step - 1), |
|
61 | 61 | 'orderby' => 'id', |
62 | 62 | 'order' => 'DESC', |
63 | 63 | ); |
64 | 64 | |
65 | - $donors = Give()->donors->get_donors( $args ); |
|
65 | + $donors = Give()->donors->get_donors($args); |
|
66 | 66 | |
67 | - if ( $donors ) { |
|
67 | + if ($donors) { |
|
68 | 68 | |
69 | - $allowed_payment_status = apply_filters( 'give_recount_donors_donation_statuses', give_get_payment_status_keys() ); |
|
69 | + $allowed_payment_status = apply_filters('give_recount_donors_donation_statuses', give_get_payment_status_keys()); |
|
70 | 70 | |
71 | - foreach ( $donors as $donor ) { |
|
71 | + foreach ($donors as $donor) { |
|
72 | 72 | |
73 | - $attached_payment_ids = explode( ',', $donor->payment_ids ); |
|
73 | + $attached_payment_ids = explode(',', $donor->payment_ids); |
|
74 | 74 | |
75 | 75 | $attached_args = array( |
76 | 76 | 'post__in' => $attached_payment_ids, |
77 | - 'number' => - 1, |
|
77 | + 'number' => -1, |
|
78 | 78 | 'status' => $allowed_payment_status, |
79 | 79 | ); |
80 | 80 | |
81 | - $attached_payments = (array) give_get_payments( $attached_args ); |
|
81 | + $attached_payments = (array) give_get_payments($attached_args); |
|
82 | 82 | |
83 | 83 | $unattached_args = array( |
84 | 84 | 'post__not_in' => $attached_payment_ids, |
85 | - 'number' => - 1, |
|
85 | + 'number' => -1, |
|
86 | 86 | 'status' => $allowed_payment_status, |
87 | 87 | 'meta_query' => array( |
88 | 88 | array( |
@@ -93,29 +93,29 @@ discard block |
||
93 | 93 | ), |
94 | 94 | ); |
95 | 95 | |
96 | - $unattached_payments = give_get_payments( $unattached_args ); |
|
96 | + $unattached_payments = give_get_payments($unattached_args); |
|
97 | 97 | |
98 | - $payments = array_merge( $attached_payments, $unattached_payments ); |
|
98 | + $payments = array_merge($attached_payments, $unattached_payments); |
|
99 | 99 | |
100 | 100 | $purchase_value = 0.00; |
101 | 101 | $purchase_count = 0; |
102 | 102 | $payment_ids = array(); |
103 | 103 | |
104 | - if ( $payments ) { |
|
104 | + if ($payments) { |
|
105 | 105 | |
106 | - foreach ( $payments as $payment ) { |
|
106 | + foreach ($payments as $payment) { |
|
107 | 107 | |
108 | 108 | $should_process_payment = 'publish' == $payment->post_status ? true : false; |
109 | - $should_process_payment = apply_filters( 'give_donor_recount_should_process_donation', $should_process_payment, $payment ); |
|
109 | + $should_process_payment = apply_filters('give_donor_recount_should_process_donation', $should_process_payment, $payment); |
|
110 | 110 | |
111 | - if ( true === $should_process_payment ) { |
|
111 | + if (true === $should_process_payment) { |
|
112 | 112 | |
113 | - if ( apply_filters( 'give_donor_recount_should_increase_value', true, $payment ) ) { |
|
114 | - $purchase_value += (float) give_donation_amount( $payment->ID, array( 'type' => 'stats' ) ); |
|
113 | + if (apply_filters('give_donor_recount_should_increase_value', true, $payment)) { |
|
114 | + $purchase_value += (float) give_donation_amount($payment->ID, array('type' => 'stats')); |
|
115 | 115 | } |
116 | 116 | |
117 | - if ( apply_filters( 'give_donor_recount_should_increase_count', true, $payment ) ) { |
|
118 | - $purchase_count ++; |
|
117 | + if (apply_filters('give_donor_recount_should_increase_count', true, $payment)) { |
|
118 | + $purchase_count++; |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | - $payment_ids = implode( ',', $payment_ids ); |
|
126 | + $payment_ids = implode(',', $payment_ids); |
|
127 | 127 | |
128 | 128 | $donor_update_data = array( |
129 | 129 | 'purchase_count' => $purchase_count, |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | 'payment_ids' => $payment_ids, |
132 | 132 | ); |
133 | 133 | |
134 | - $donor_instance = new Give_Donor( $donor->id ); |
|
135 | - $donor_instance->update( $donor_update_data ); |
|
134 | + $donor_instance = new Give_Donor($donor->id); |
|
135 | + $donor_instance->update($donor_update_data); |
|
136 | 136 | |
137 | 137 | }// End foreach(). |
138 | 138 | |
@@ -152,21 +152,21 @@ discard block |
||
152 | 152 | public function get_percentage_complete() { |
153 | 153 | |
154 | 154 | $args = array( |
155 | - 'number' => - 1, |
|
155 | + 'number' => -1, |
|
156 | 156 | 'orderby' => 'id', |
157 | 157 | 'order' => 'DESC', |
158 | 158 | ); |
159 | 159 | |
160 | - $donors = Give()->donors->get_donors( $args ); |
|
161 | - $total = count( $donors ); |
|
160 | + $donors = Give()->donors->get_donors($args); |
|
161 | + $total = count($donors); |
|
162 | 162 | |
163 | 163 | $percentage = 100; |
164 | 164 | |
165 | - if ( $total > 0 ) { |
|
166 | - $percentage = ( ( $this->per_step * $this->step ) / $total ) * 100; |
|
165 | + if ($total > 0) { |
|
166 | + $percentage = (($this->per_step * $this->step) / $total) * 100; |
|
167 | 167 | } |
168 | 168 | |
169 | - if ( $percentage > 100 ) { |
|
169 | + if ($percentage > 100) { |
|
170 | 170 | $percentage = 100; |
171 | 171 | } |
172 | 172 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * |
181 | 181 | * @param array $request The Form Data passed into the batch processing |
182 | 182 | */ |
183 | - public function set_properties( $request ) { |
|
183 | + public function set_properties($request) { |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -191,21 +191,21 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function process_step() { |
193 | 193 | |
194 | - if ( ! $this->can_export() ) { |
|
195 | - wp_die( esc_html__( 'You do not have permission to recount stats.', 'give' ), esc_html__( 'Error', 'give' ), array( |
|
194 | + if ( ! $this->can_export()) { |
|
195 | + wp_die(esc_html__('You do not have permission to recount stats.', 'give'), esc_html__('Error', 'give'), array( |
|
196 | 196 | 'response' => 403, |
197 | - ) ); |
|
197 | + )); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $had_data = $this->get_data(); |
201 | 201 | |
202 | - if ( $had_data ) { |
|
202 | + if ($had_data) { |
|
203 | 203 | $this->done = false; |
204 | 204 | |
205 | 205 | return true; |
206 | 206 | } else { |
207 | 207 | $this->done = true; |
208 | - $this->message = esc_html__( 'Donor stats have been successfully recounted.', 'give' ); |
|
208 | + $this->message = esc_html__('Donor stats have been successfully recounted.', 'give'); |
|
209 | 209 | |
210 | 210 | return false; |
211 | 211 | } |