PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 3.1.9
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v3.1.9
3.1.13 3.1.12 3.1.11 3.1.10 3.1.9 3.1.8 3.1.7 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 All 122 releases
firebox / Inc / Core / Analytics / QueryBuilders / Views / EventsStrategy.php

EventsStrategy.php in FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment 3.1.9, at Inc/Core/Analytics/QueryBuilders/Views/EventsStrategy.php

57 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package FireBox
4 * @version 3.1.9 Free
5 *
6 * @author FirePlugins <info@fireplugins.com>
7 * @link https://www.fireplugins.com
8 * @copyright Copyright © 2026 FirePlugins All Rights Reserved
9 * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
10 */
11
12 namespace FireBox\Core\Analytics\QueryBuilders\Views;
13
14 if (!defined('ABSPATH'))
15 {
16 exit; // Exit if accessed directly.
17 }
18
19 class EventsStrategy extends BaseViewsQueryStrategy
20 {
21 public function getSelect(): string
22 {
23 $filter = '';
24 $filters = $this->metric->getFilters();
25
26 if (array_key_exists('campaign', $filters) && isset($filters['campaign']['value']) && is_array($filters['campaign']['value']))
27 {
28 $filter .= 'AND ll.box IN (' . implode(',', array_map('intval', $filters['campaign']['value'])) . ')';
29 }
30
31 $options = $this->metric->getOptions();
32 $start_date = $options['start_date'] ?? '';
33 $end_date = $options['end_date'] ?? '';
34
35 return '
36 IF(ld.event IS NOT NULL, ld.event, \'open\') AS label,
37 IF(ld.event IS NOT NULL, COUNT(l.id), (
38 SELECT COUNT(ll.id)
39 FROM ' . $this->metric->getTableLogs() . ' AS ll
40 WHERE (ll.date >= \'' . esc_sql($start_date) . '\'
41 AND ll.date <= \'' . esc_sql($end_date) . '\')
42 ' . $filter . '
43 )) AS total
44 ';
45 }
46
47 public function getGroupBy(): string
48 {
49 return 'GROUP BY ld.event';
50 }
51
52 public function getOrderBy(): string
53 {
54 return $this->getTotalOrderBy();
55 }
56 }
57