← All changes
|
includes/admin/components/analytics/discount/summary.php
+3
-3
1.1.4
→
2.7.0
View file →
| @@ -59,9 +59,9 @@ | ||
| 59 | 59 | */ |
| 60 | 60 | public function set_discounts_details() { |
| 61 | 61 | global $wpdb; |
| 62 | 62 | |
| 63 | - $discount_id = filter_input( INPUT_GET, 'target_id', FILTER_SANITIZE_STRING ); | |
| 63 | + $discount_id = sellkit_htmlspecialchars( INPUT_GET, 'target_id' ); | |
| 64 | 64 | |
| 65 | 65 | $start_date = time() - ( 60 * 60 * 24 * Analytics::$date_range ); |
| 66 | 66 | |
| 67 | 67 | $sellkit_prefix = Database::DATABASE_PREFIX; |
| @@ -94,9 +94,9 @@ | ||
| 94 | 94 | $wpdb->prepare( "SELECT SUM( total_amount ) as total_discount FROM {$discount_table} |
| 95 | 95 | where applied_at > {$start_date} and order_id IS NOT NULL and discount_id " . Analytics::target_id_condition( $discount_id ) . " %d", $discount_id ), |
| 96 | 96 | ARRAY_A ); |
| 97 | 97 | |
| 98 | - $this->data['total_discount'] = ! empty( $discounts[0]['total_discount'] ) ? $discounts[0]['total_discount'] : 0; | |
| 98 | + $this->data['total_discount'] = ! empty( $discounts[0]['total_discount'] ) ? round( $discounts[0]['total_discount'], 2 ) : 0; | |
| 99 | 99 | |
| 100 | 100 | $customers = $wpdb->get_results( |
| 101 | 101 | $wpdb->prepare( "SELECT count(DISTINCT(email)) as customers FROM {$discount_table} |
| 102 | 102 | where applied_at > {$start_date} and discount_id " . Analytics::target_id_condition( $discount_id ) . " %d GROUP BY email; ", $discount_id ), |
| @@ -113,7 +113,7 @@ | ||
| 113 | 113 | $this->data['conversion_rate'] = ( $this->data['converted'] / $this->data['applied_discount'] ) * 100; |
| 114 | 114 | $this->data['conversion_rate'] = round( $this->data['conversion_rate'], 2 ); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $this->data['target_title'] = get_the_title( $discount_id ); | |
| 117 | + $this->data['target_title'] = sellkit_decode_entity_title( get_the_title( $discount_id ) ); | |
| 118 | 118 | } |
| 119 | 119 | } |