PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 All 257 releases
← All changes | includes/admin/reports/class-gateways-reports-table.php +39 -31 2.3.0 → 4.18.0 View file →
@@ -3,9 +3,9 @@
3 3 * Gateways Reports Table Class
4 4 *
5 5 * @package Give
6 6 * @subpackage Admin/Reports
7 - * @copyright Copyright (c) 2016, WordImpress
7 + * @copyright Copyright (c) 2016, GiveWP
8 8 * @license https://opensource.org/licenses/gpl-license GNU Public License
9 9 * @since 1.0
10 10 */
11 11
@@ -44,13 +44,15 @@
44 44 public function __construct() {
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
51 - 'ajax' => false // Does this table support ajax?
52 - ) );
48 + parent::__construct(
49 + array(
50 + 'singular' => give_get_forms_label_singular(), // Singular name of the listed records
51 + 'plural' => give_get_forms_label_plural(), // Plural name of the listed records
52 + 'ajax' => false, // Does this table support ajax?
53 + )
54 + );
53 55
54 56 }
55 57
56 58 /**
@@ -71,15 +73,17 @@
71 73 case 'complete_sales':
72 74 $value = $item[ $column_name ] ?
73 75 sprintf(
74 76 '<a href="%s">%s</a>',
75 - add_query_arg(
76 - array(
77 - 'status' => 'publish',
78 - 'gateway' => $item['ID']
79 - ),
80 - $donation_list_page_url
81 - ),
77 + esc_url(
78 + add_query_arg(
79 + array(
80 + 'status' => 'publish',
81 + 'gateway' => $item['ID'],
82 + ),
83 + $donation_list_page_url
84 + )
85 + ),
82 86 $item[ $column_name ]
83 87 ) :
84 88 $item[ $column_name ];
85 89 break;
@@ -87,15 +91,17 @@
87 91 case 'pending_sales':
88 92 $value = $item[ $column_name ] ?
89 93 sprintf(
90 94 '<a href="%s">%s</a>',
91 - add_query_arg(
92 - array(
93 - 'status' => 'pending',
94 - 'gateway' => $item['ID']
95 - ),
96 - $donation_list_page_url
97 - ),
95 + esc_url(
96 + add_query_arg(
97 + array(
98 + 'status' => 'pending',
99 + 'gateway' => $item['ID'],
100 + ),
101 + $donation_list_page_url
102 + )
103 + ),
98 104 $item[ $column_name ]
99 105 ) :
100 106 $item[ $column_name ];
101 107 break;
@@ -103,14 +109,16 @@
103 109 case 'total_sales':
104 110 $value = $item[ $column_name ] ?
105 111 sprintf(
106 112 '<a href="%s">%s</a>',
107 - add_query_arg(
108 - array(
109 - 'gateway' => $item['ID']
110 - ),
111 - $donation_list_page_url
112 - ),
113 + esc_url(
114 + add_query_arg(
115 + array(
116 + 'gateway' => $item['ID'],
117 + ),
118 + $donation_list_page_url
119 + )
120 + ),
113 121 $item[ $column_name ]
114 122 ) :
115 123 $item[ $column_name ];
116 124
@@ -135,9 +143,9 @@
135 143 'label' => esc_attr__( 'Gateway', 'give' ),
136 144 'complete_sales' => esc_attr__( 'Complete Payments', 'give' ),
137 145 'pending_sales' => esc_attr__( 'Pending / Failed Payments', 'give' ),
138 146 'total_sales' => esc_attr__( 'Total Payments', 'give' ),
139 - 'total_donations' => esc_attr__( 'Total Donated', 'give' )
147 + 'total_donations' => esc_attr__( 'Total Donated', 'give' ),
140 148 );
141 149
142 150 return $columns;
143 151 }
@@ -150,9 +158,9 @@
150 158 * @return array Array of all the sortable columns
151 159 */
152 160 public function get_sortable_columns() {
153 161 return array(
154 - 'total_donations' => array( 'total_donations', false )
162 + 'total_donations' => array( 'total_donations', false ),
155 163 );
156 164 }
157 165
158 166
@@ -232,12 +240,12 @@
232 240 public function give_sort_total_donations( $old_value, $new_value ) {
233 241 // If no sort, default to label.
234 242 $orderby = ( ! empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'label';
235 243
236 - //If no order, default to asc.
244 + // If no order, default to asc.
237 245 $order = ( ! empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'asc';
238 246
239 - //Determine sort order.
247 + // Determine sort order.
240 248 $result = strcmp( $old_value[ $orderby ], $new_value[ $orderby ] );
241 249
242 250 return ( $order === 'asc' ) ? $result : -$result;
243 251 }
@@ -266,9 +274,9 @@
266 274 'label' => $gateway['admin_label'],
267 275 'complete_sales' => $complete_count,
268 276 'pending_sales' => $pending_count,
269 277 '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 ) ) ),
278 + '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 279 );
272 280 }
273 281
274 282 return $reports_data;