PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 3.1.14
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v3.1.14
3.1.14 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 All 123 releases
← All changes | Inc/Core/Controllers/Dashboard.php +39 -64 1.0.7 → 3.1.14 View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2 /**
3 3 * @package FireBox
4 - * @version 1.0.7 Free
4 + * @version 3.1.14 Free
5 5 *
6 6 * @author FirePlugins <[email protected]>
7 7 * @link https://www.fireplugins.com
8 - * @copyright Copyright © 2021 FirePlugins All Rights Reserved
8 + * @copyright Copyright © 2026 FirePlugins All Rights Reserved
9 9 * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
10 10 */
11 11
12 12 namespace FireBox\Core\Controllers;
@@ -15,23 +15,19 @@
15 15 {
16 16 exit; // Exit if accessed directly.
17 17 }
18 18
19 -use FireBox\Core\Admin\Analytics\Overview\Overview;
20 -
21 19 class Dashboard extends BaseController
22 20 {
23 21 /**
24 - * The Main Buttons of the Dashboard
22 + * Render view
25 23 *
26 - * @var array
24 + * @return void
27 25 */
28 - protected $main_buttons;
29 -
30 - public function __construct()
26 + public function render()
31 27 {
32 - $this->setMainButtons();
33 - }
28 + firebox()->renderer->admin->render('pages/dashboard');
29 + }
34 30
35 31 /**
36 32 * Load required media files
37 33 *
@@ -38,8 +34,23 @@
38 34 * @return void
39 35 */
40 36 public function addMedia()
41 37 {
38 + wp_register_script('firebox-react', FBOX_MEDIA_ADMIN_URL . 'js/vendor/react.production.min.js', [], FBOX_VERSION, true);
39 + wp_enqueue_script('firebox-react');
40 + wp_register_script('firebox-react-dom', FBOX_MEDIA_ADMIN_URL . 'js/vendor/react-dom.production.min.js', [], FBOX_VERSION, true);
41 + wp_enqueue_script('firebox-react-dom');
42 +
43 + // load dashboard
44 + wp_register_script(
45 + 'firebox-dashboard',
46 + FBOX_MEDIA_ADMIN_URL . 'js/dashboard.js',
47 + ['wp-api-fetch'],
48 + FBOX_VERSION,
49 + true
50 + );
51 + wp_enqueue_script('firebox-dashboard');
52 +
42 53 // load geoip js
43 54 wp_register_script(
44 55 'fpf-geoip',
45 56 FPF_MEDIA_URL . 'admin/js/fpf_geoip.js',
@@ -44,66 +55,30 @@
44 55 'fpf-geoip',
45 56 FPF_MEDIA_URL . 'admin/js/fpf_geoip.js',
46 57 [],
47 58 FPF_VERSION,
48 - false
59 + true
49 60 );
50 - wp_enqueue_script( 'fpf-geoip' );
61 + wp_enqueue_script('fpf-geoip');
62 +
63 + // Load appropriate revenue attribution bundle based on plan
64 + $this->loadRevenueAttributionBundle();
51 65 }
52 66
53 67 /**
54 - * Render view
55 - *
56 - * @return void
68 + * Load the appropriate revenue attribution bundle based on user's plan
57 69 */
58 - public function render()
70 + private function loadRevenueAttributionBundle()
59 71 {
60 - $payload = [
61 - 'main_buttons' => $this->main_buttons
62 - ];
72 + $is_ra_plan = in_array(FBOX_LICENSE_PLAN, ['pro', 'growth']);
73 + $bundle_name = $is_ra_plan ? 'revenue_attribution_pro' : 'revenue_attribution_basic';
63 74
64 - firebox()->renderer->admin->render('pages/dashboard', $payload);
65 - }
66 -
67 - /**
68 - * Sets the Main Buttons of the Dashboard
69 - *
70 - * @return void
71 - */
72 - protected function setMainButtons()
73 - {
74 - $this->main_buttons = [
75 - [
76 - 'label' => 'FB_NEW_POPUP',
77 - 'icon' => 'dashicons-plus-alt',
78 - 'url' => admin_url('post-new.php?post_type=firebox'),
79 - 'li_class' => 'fpf-open-library-modal'
80 - ],
81 - [
82 - 'label' => 'FB_POPUPS',
83 - 'icon' => 'dashicons-menu-alt',
84 - 'url' => admin_url('edit.php?post_type=firebox')
85 - ],
86 - [
87 - 'label' => 'FPF_ANALYTICS',
88 - 'icon' => 'dashicons-chart-bar',
89 - 'url' => admin_url('admin.php?page=firebox-analytics')
90 - ],
91 - [
92 - 'label' => 'FPF_IMPORT',
93 - 'icon' => 'dashicons-upload',
94 - 'url' => admin_url('admin.php?page=firebox-import')
95 - ],
96 - [
97 - 'label' => 'FPF_SETTINGS',
98 - 'icon' => 'dashicons-admin-generic',
99 - 'url' => admin_url('admin.php?page=firebox-settings')
100 - ],
101 - [
102 - 'label' => 'FPF_DOCUMENTATION',
103 - 'icon' => 'dashicons-editor-help',
104 - 'url' => FBOX_DOC_URL,
105 - 'target' => '_blank'
106 - ]
107 - ];
75 + wp_register_script(
76 + $bundle_name,
77 + FBOX_MEDIA_ADMIN_URL . 'js/blocks/' . $bundle_name . '.js',
78 + ['firebox-dashboard'],
79 + FBOX_VERSION,
80 + true
81 + );
82 + wp_enqueue_script($bundle_name);
108 83 }
109 84 }