PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.4.5
Fluent Support – Helpdesk & Customer Support Ticket System v2.4.5
2.4.5 2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 All 69 releases
← All changes | app/Hooks/Handlers/Menu.php +292 -126 1.5.4 → 2.4.5 View file →
@@ -3,45 +3,45 @@
3 3 namespace FluentSupport\App\Hooks\Handlers;
4 4
5 5 use FluentSupport\App\App;
6 6 use FluentSupport\App\Models\Agent;
7 +use FluentSupport\App\Models\AgentGroup;
7 8 use FluentSupport\App\Models\MailBox;
8 9 use FluentSupport\App\Models\Product;
10 +use FluentSupport\App\Models\TagPivot;
9 11 use FluentSupport\App\Models\TicketTag;
10 12 use FluentSupport\App\Modules\PermissionManager;
11 13 use FluentSupport\App\Services\Helper;
12 -use FluentSupport\App\Services\TransStrings;
14 +use FluentSupport\App\Services\Notifications\NotificationSettings;
15 +use FluentSupport\App\Services\TranslationStrings;
16 +use FluentSupport\App\Services\Integrations\FluentBooking\FluentBookingService;
17 +use FluentSupport\App\Vite;
13 18
14 19 class Menu
15 20 {
16 21 public function add()
17 22 {
18 - $currentUserPermissions = PermissionManager::currentUserPermissions();
23 + $capability = PermissionManager::getMenuPermission();
19 24
20 - if (!$currentUserPermissions) {
25 + if (!$capability) {
21 26 return;
22 27 }
23 28
24 - $permission = 'fst_view_dashboard';
25 -
26 - $isAdmin = false;
27 -
28 - if (current_user_can('manage_options')) {
29 - $permission = 'manage_options';
30 - $isAdmin = true;
31 - }
32 -
33 29 $menuPosition = 25;
34 30 if (defined('FLUENTCRM')) {
35 31 $menuPosition = 4;
36 32 }
37 33
34 + /*
35 + * Filter Fluent Support menu position in WordPress dashboard
36 + * @param integer $menuPosition
37 + */
38 38 $menuPosition = apply_filters('fluent_support/admin_menu_position', $menuPosition);
39 39
40 40 add_menu_page(
41 41 __('Fluent Support', 'fluent-support'),
42 42 __('Fluent Support', 'fluent-support'),
43 - $permission,
43 + $capability,
44 44 'fluent-support',
45 45 array($this, 'renderApp'),
46 46 $this->getMenuIcon(),
47 47 $menuPosition
@@ -46,14 +46,13 @@
46 46 $this->getMenuIcon(),
47 47 $menuPosition
48 48 );
49 49
50 -
51 50 add_submenu_page(
52 51 'fluent-support',
53 52 __('Dashboard', 'fluent-support'),
54 53 __('Dashboard', 'fluent-support'),
55 - $permission,
54 + $capability,
56 55 'fluent-support',
57 56 array($this, 'renderApp')
58 57 );
59 58
@@ -60,160 +59,262 @@
60 59 add_submenu_page(
61 60 'fluent-support',
62 61 __('Tickets', 'fluent-support'),
63 62 __('Tickets', 'fluent-support'),
64 - ($isAdmin) ? 'manage_options' : 'fst_manage_own_tickets',
63 + $capability,
65 64 'fluent-support#/tickets',
66 65 array($this, 'renderApp')
67 66 );
68 67
69 - add_submenu_page(
70 - 'fluent-support',
71 - __('Workflows', 'fluent-support'),
72 - __('Workflows', 'fluent-support'),
73 - ($isAdmin) ? 'manage_options' : 'fst_manage_workflows',
74 - 'fluent-support#/workflows',
75 - array($this, 'renderApp')
76 - );
68 + if (PermissionManager::currentUserCan('fst_view_all_reports')) {
69 + add_submenu_page(
70 + 'fluent-support',
71 + __('Reports', 'fluent-support'),
72 + __('Reports', 'fluent-support'),
73 + $capability,
74 + 'fluent-support#/reports',
75 + array($this, 'renderApp')
76 + );
77 + }
77 78
78 - add_submenu_page(
79 - 'fluent-support',
80 - __('Activities', 'fluent-support'),
81 - __('Activities', 'fluent-support'),
82 - ($isAdmin) ? 'manage_options' : 'fst_view_activity_logs',
83 - 'fluent-support#/activity-logger',
84 - array($this, 'renderApp')
85 - );
79 + if (PermissionManager::currentUserCan('fst_sensitive_data')) {
80 + add_submenu_page(
81 + 'fluent-support',
82 + __('Customers', 'fluent-support'),
83 + __('Customers', 'fluent-support'),
84 + $capability,
85 + 'fluent-support#/customers',
86 + array($this, 'renderApp')
87 + );
88 + }
86 89
87 - add_submenu_page(
88 - 'fluent-support',
89 - __('Settings', 'fluent-support'),
90 - __('Settings', 'fluent-support'),
91 - ($isAdmin) ? 'manage_options' : 'fst_manage_settings',
92 - 'fluent-support#/settings',
93 - array($this, 'renderApp')
94 - );
90 + if (PermissionManager::currentUserCan('fst_view_activity_logs')) {
91 + add_submenu_page(
92 + 'fluent-support',
93 + __('Activities', 'fluent-support'),
94 + __('Activities', 'fluent-support'),
95 + $capability,
96 + 'fluent-support#/activity',
97 + array($this, 'renderApp')
98 + );
99 + }
95 100
96 - add_submenu_page(
97 - 'fluent-support',
98 - __('Reports', 'fluent-support'),
99 - __('Reports', 'fluent-support'),
100 - ($isAdmin) ? 'manage_options' : 'fst_sensitive_data',
101 - 'fluent-support#/reports',
102 - array($this, 'renderApp')
103 - );
101 + if (PermissionManager::currentUserCan('fst_manage_settings')) {
102 + add_submenu_page(
103 + 'fluent-support',
104 + __('Business Inboxes', 'fluent-support'),
105 + __('Business Inboxes', 'fluent-support'),
106 + $capability,
107 + 'fluent-support#/mailboxes',
108 + array($this, 'renderApp')
109 + );
110 + }
104 111
112 + if (PermissionManager::currentUserCan('fst_manage_workflows')) {
113 + add_submenu_page(
114 + 'fluent-support',
115 + __('Workflows', 'fluent-support'),
116 + __('Workflows', 'fluent-support'),
117 + $capability,
118 + 'fluent-support#/workflows',
119 + array($this, 'renderApp')
120 + );
121 + }
122 +
123 + if (PermissionManager::currentUserCan('fst_manage_saved_replies')) {
124 + add_submenu_page(
125 + 'fluent-support',
126 + __('Saved Replies', 'fluent-support'),
127 + __('Saved Replies', 'fluent-support'),
128 + $capability,
129 + 'fluent-support#/saved-replies',
130 + array($this, 'renderApp')
131 + );
132 + }
133 +
134 + if (PermissionManager::currentUserCan('fst_manage_settings')) {
135 + add_submenu_page(
136 + 'fluent-support',
137 + __('Settings', 'fluent-support'),
138 + __('Settings', 'fluent-support'),
139 + $capability,
140 + 'fluent-support#/settings',
141 + array($this, 'renderApp')
142 + );
143 + }
105 144 }
106 145
107 - public function renderApp()
146 + public function getMenuItems()
108 147 {
109 - $app = App::getInstance();
110 -
111 - $assets = $app['url.assets'];
112 -
113 148 $baseUrl = apply_filters('fluent_support/base_url', admin_url('admin.php?page=fluent-support#/'));
114 149
115 150 $menuItems = [
116 - [
151 + 'dashboard' => [
117 152 'key' => 'dashboard',
118 153 'label' => __('Dashboard', 'fluent-support'),
119 - 'permalink' => $baseUrl
154 + 'permalink' => $baseUrl,
120 155 ],
121 - [
156 + 'tickets' => [
122 157 'key' => 'tickets',
123 158 'label' => __('Tickets', 'fluent-support'),
124 159 'permalink' => $baseUrl . 'tickets',
125 160 ],
126 - [
161 + 'reports' => [
127 162 'key' => 'reports',
128 163 'label' => __('Reports', 'fluent-support'),
129 - 'permalink' => $baseUrl . 'reports'
130 - ]
164 + 'permalink' => $baseUrl . 'reports',
165 + ],
131 166 ];
132 167
133 - $hasSensitiveAccess = PermissionManager::currentUserCan('fst_sensitive_data');
134 - if ($hasSensitiveAccess) {
135 - $menuItems[] = [
136 - 'key' => 'customers',
137 - 'label' => __('Customers', 'fluent-support'),
138 - 'permalink' => $baseUrl . 'customers'
168 + $canManageSettings = PermissionManager::currentUserCan('fst_manage_settings');
169 +
170 + if ($canManageSettings) {
171 + $menuItems['mailboxes'] = [
172 + 'key' => 'mailboxes',
173 + 'label' => __('Business Inboxes', 'fluent-support'),
174 + 'permalink' => $baseUrl . 'mailboxes',
139 175 ];
140 176 }
141 177
142 - if (PermissionManager::currentUserCan('fst_manage_saved_replies')) {
143 - $secondayItems = [
144 - [
145 - 'key' => 'saved_replies',
146 - 'label' => __('Saved Replies', 'fluent-support'),
147 - 'permalink' => $baseUrl . 'saved-replies'
148 - ]
178 + if (PermissionManager::currentUserCan('fst_view_activity_logs')) {
179 + $menuItems['activity'] = [
180 + 'key' => 'activity',
181 + 'label' => __('Activities', 'fluent-support'),
182 + 'permalink' => $baseUrl . 'activity',
149 183 ];
150 184 }
151 185
152 - if (PermissionManager::currentUserCan('fst_view_activity_logs')) {
153 - $secondayItems[] = [
154 - 'key' => 'activity_logger',
155 - 'label' => __('Activities', 'fluent-support'),
156 - 'permalink' => $baseUrl . 'activity-logger'
186 + if (PermissionManager::currentUserCan('fst_sensitive_data')) {
187 + $menuItems['customers'] = [
188 + 'key' => 'customers',
189 + 'label' => __('Customers', 'fluent-support'),
190 + 'permalink' => $baseUrl . 'customers',
157 191 ];
158 192 }
159 193
160 - $canManageSettings = PermissionManager::currentUserCan('fst_manage_settings');
194 + $moreChildren = [];
161 195
162 - if ($canManageSettings) {
163 - $secondayItems[] = [
164 - 'key' => 'mailboxes',
165 - 'label' => __('Business Inboxes', 'fluent-support'),
166 - 'permalink' => $baseUrl . 'mailboxes'
196 + if (PermissionManager::currentUserCan('fst_manage_saved_replies')) {
197 + $moreChildren['saved_replies'] = [
198 + 'key' => 'saved_replies',
199 + 'label' => __('Saved Replies', 'fluent-support'),
200 + 'permalink' => $baseUrl . 'saved-replies',
167 201 ];
168 202 }
169 203
170 204 if (PermissionManager::currentUserCan('fst_manage_workflows')) {
171 - $secondayItems[] = [
205 + $moreChildren['workflows'] = [
172 206 'key' => 'workflows',
173 207 'label' => __('Workflows', 'fluent-support'),
174 - 'permalink' => $baseUrl . 'workflows'
208 + 'permalink' => $baseUrl . 'workflows',
175 209 ];
176 210 }
177 211
212 + if (!empty($moreChildren)) {
213 + $menuItems['more'] = [
214 + 'key' => 'more',
215 + 'label' => __('More', 'fluent-support'),
216 + 'permalink' => '#',
217 + 'children' => $moreChildren,
218 + ];
219 + }
220 +
178 221 if ($canManageSettings) {
179 - $secondayItems[] = [
222 + $menuItems['settings'] = [
180 223 'key' => 'settings',
181 224 'label' => __('Global Settings', 'fluent-support'),
182 - 'permalink' => $baseUrl . 'settings'
225 + 'permalink' => $baseUrl . 'settings',
183 226 ];
184 227 }
185 228
229 + return apply_filters('fluent_support/menu_items', $menuItems);
230 + }
186 231
232 + public function renderApp()
233 + {
234 + $app = App::getInstance();
235 +
236 + $assets = $app['url.assets'];
237 +
238 + $allItems = $this->getMenuItems();
239 +
240 + $secondaryKeys = ['settings'];
241 + $menuItems = [];
242 + $secondaryItems = [];
243 +
244 + foreach ($allItems as $key => $item) {
245 + if (in_array($key, $secondaryKeys, true)) {
246 + $secondaryItems[] = $item;
247 + } else {
248 + $menuItems[] = $item;
249 + }
250 + }
251 +
187 252 $menuItems = apply_filters('fluent_support/primary_menu_items', $menuItems);
188 - $secondayItems = apply_filters('fluent_support/secondary_menu_items', $secondayItems);
253 + $secondaryItems = apply_filters('fluent_support/secondary_menu_items', $secondaryItems);
189 254
190 -
191 255 if (!defined('FLUENT_SUPPORT_PRO_DIR_FILE')) {
192 - $secondayItems[] = [
256 + $secondaryItems[] = [
193 257 'key' => 'upgrade_to_pro',
194 - 'label' => 'Upgrade to Pro',
195 - 'permalink' => 'https://fluentsupport.com'
258 + 'label' => __('Upgrade to Pro', 'fluent-support'),
259 + 'permalink' => Helper::getUpgradeUrl('sidebar_cta')
196 260 ];
197 261 }
198 262
199 - $app = App::getInstance();
263 + $baseUrl = apply_filters('fluent_support/base_url', admin_url('admin.php?page=fluent-support#/'));
264 +
200 265 $this->enqueueAssets();
266 +
267 + do_action('fluent_support/admin_app_loaded', $app);
201 268 $app->view->render('admin.menu', [
202 269 'base_url' => $baseUrl,
203 270 'logo' => $assets . 'images/logo.svg',
271 + 'settingsLogo' => $assets . 'images/gear.svg',
272 + 'upgradeLogo' => $assets . 'images/crown.svg',
273 + 'assets' => $assets,
204 274 'menuItems' => $menuItems,
205 - 'secondaryItems' => $secondayItems
275 + 'secondaryItems' => isset($secondaryItems) ? $secondaryItems : [],
206 276 ]);
207 277 }
208 278
209 279 public function maybeEnqueueAssets()
210 280 {
211 - if (isset($_GET['page']) && $_GET['page'] == 'fluent-support') {
281 + if (isset($_GET['page']) && sanitize_text_field(wp_unslash($_GET['page'])) === 'fluent-support') {
282 + add_action('admin_head', [$this, 'printDarkModeInit'], 1);
212 283 $this->enqueueAssets();
213 284 }
214 285 }
215 286
287 + public function printDarkModeInit()
288 + {
289 + ?>
290 + <script>
291 + (function () {
292 + var savedTheme = localStorage.getItem('fs-theme');
293 +
294 + // Check if dark mode should be active
295 + // localStorage stores: 'dark', 'light', or 'system:dark' / 'system:light'
296 + var isDark = savedTheme
297 + ? savedTheme.split(':').pop() === 'dark'
298 + : window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
299 +
300 + if (isDark) {
301 + // Apply immediately to <html> to prevent white flash
302 + document.documentElement.classList.add('fs-dark-mode');
303 +
304 + // Watch for <body> to appear and apply class as soon as it exists
305 + new MutationObserver(function (mutations, observer) {
306 + if (document.body) {
307 + document.body.classList.add('fs-dark-mode');
308 + observer.disconnect();
309 + }
310 + }).observe(document.documentElement, { childList: true });
311 + }
312 + })();
313 + </script>
314 + <?php
315 + }
316 +
216 317 public function enqueueAssets()
217 318 {
218 319 $app = App::getInstance();
219 320
@@ -218,12 +319,21 @@
218 319 $app = App::getInstance();
219 320
220 321 $assets = $app['url.assets'];
221 322
222 - wp_enqueue_style(
223 - 'fluent_support_admin_app', $assets . 'admin/css/alpha-admin.css', [], FLUENT_SUPPORT_VERSION
224 - );
323 + // Inject Vite HMR client for dev mode
324 + add_action('admin_head', function () {
325 + Vite::injectViteClient();
326 + }, 1);
225 327
328 + wp_enqueue_script('dompurify', $assets . 'libs/purify/purify.min.js', [], '3.4.16');
329 +
330 + if (is_rtl()) {
331 + wp_enqueue_style('fluent_support_admin_app_rtl', $assets . 'admin/css/alpha-admin-rtl.css', [], FLUENT_SUPPORT_VERSION);
332 + } else {
333 + wp_enqueue_style('fluent_support_admin_app', Vite::getEnqueuePath('admin/css/alpha-admin.css'), [], FLUENT_SUPPORT_VERSION);
334 + }
335 +
226 336 $agents = Agent::select(['id', 'first_name', 'last_name'])
227 337 ->where('person_type', 'agent')
228 338 ->get()->toArray();
229 339
@@ -230,8 +340,18 @@
230 340 foreach ($agents as $index => $agent) {
231 341 $agents[$index]['id'] = strval($agent['id']);
232 342 }
233 343
344 + $agentGroups = AgentGroup::select(['id', 'title', 'settings'])->get();
345 + $groupPivots = TagPivot::where('source_type', 'agent_group')->get();
346 + foreach ($agentGroups as $group) {
347 + $group->agent_ids = $groupPivots->where('tag_id', $group->id)
348 + ->pluck('source_id')
349 + ->map(function ($id) { return strval($id); })
350 + ->values()
351 + ->toArray();
352 + }
353 +
234 354 $me = Helper::getAgentByUserId(get_current_user_id());
235 355
236 356 if (!$me && current_user_can('manage_options')) {
237 357 // we should create the agent
@@ -255,9 +375,9 @@
255 375 wp_enqueue_media();
256 376
257 377 wp_enqueue_script(
258 378 'fluent_support_admin_app_start',
259 - $assets . 'admin/js/start.js',
379 + Vite::getEnqueuePath('admin/js/start.js'),
260 380 array('jquery'),
261 381 FLUENT_SUPPORT_VERSION,
262 382 true
263 383 );
@@ -263,9 +383,9 @@
263 383 );
264 384
265 385 wp_enqueue_script(
266 386 'fluent_support_global_admin',
267 - $assets . 'admin/js/global_admin.js',
387 + Vite::getEnqueuePath('admin/js/global_admin.js'),
268 388 array('jquery'),
269 389 FLUENT_SUPPORT_VERSION,
270 390 true
271 391 );
@@ -289,8 +409,12 @@
289 409 ]
290 410 ];
291 411 }
292 412
413 + /*
414 + * Filter integration driver
415 + * @param array $integrationDrivers
416 + */
293 417 $integrationDrivers = apply_filters('fluent_support/integration_drivers', $integrationDrivers);
294 418
295 419 $tags = TicketTag::select(['id', 'title'])->get()->toArray();
296 420
@@ -298,47 +422,87 @@
298 422 $tag['id'] = strval($tag['id']);
299 423 return $tag;
300 424 }, $tags);
301 425
302 - $i18ns = TransStrings::getTransStrings();
426 + $i18ns = TranslationStrings::getAdminStrings();
303 427 $i18ns['allowed_files_and_size'] = Helper::getFileUploadMessage();
428 + $i18ns['open'] = __('Open', 'fluent-support');
429 + $i18ns['all'] = __('All', 'fluent-support');
304 430
431 + /*
432 + * Filter agent portal localize javascript data
433 + *
434 + * @since v1.0.0
435 + *
436 + * @param array $appVars
437 + */
305 438 $appVars = apply_filters('fluent_support_app_vars', array(
306 - 'slug' => $slug = $app->config->get('app.slug'),
307 - 'nonce' => wp_create_nonce($slug),
308 - 'rest' => $this->getRestInfo($app),
309 - 'brand_logo' => $this->getMenuIcon(),
310 - 'firstEntry' => '',
311 - 'lastEntry' => '',
312 - 'asset_url' => $assets,
313 - 'support_agents' => $agents,
314 - 'support_products' => Product::select(['id', 'title'])->get(),
315 - 'client_priorities' => Helper::customerTicketPriorities(),
316 - 'ticket_statuses' => Helper::ticketStatuses(),
317 - 'admin_priorities' => Helper::adminTicketPriorities(),
318 - 'mailboxes' => MailBox::select(['id', 'name', 'settings'])->get(),
319 - 'me' => $me,
320 - 'pref' => [
439 + 'slug' => $slug = $app->config->get('app.slug'),
440 + 'nonce' => wp_create_nonce($slug),
441 + 'rest' => $this->getRestInfo($app),
442 + 'brand_logo' => $this->getMenuIcon(),
443 + 'firstEntry' => '',
444 + 'lastEntry' => '',
445 + 'asset_url' => $assets,
446 + 'support_agents' => $agents,
447 + 'agent_groups' => $agentGroups,
448 + 'support_products' => Product::select(['id', 'title'])->orderedByTitle()->get(),
449 + 'client_priorities' => Helper::customerTicketPriorities(),
450 + 'ticket_statuses' => Helper::ticketStatuses(),
451 + 'ticket_statuses_group' => Helper::ticketStatusGroups(),
452 + 'changeable_ticket_statuses' => Helper::changeableTicketStatuses(),
453 + 'admin_priorities' => Helper::adminTicketPriorities(),
454 + 'mailboxes' => MailBox::getAccessibleBoxes(),
455 + // Whether the site has any inbox at all, regardless of what this agent may see.
456 + // `mailboxes` is restriction-filtered and can legitimately be empty, so it cannot
457 + // double as the "is Fluent Support set up yet?" signal the setup wizard keys off.
458 + 'has_mailboxes' => MailBox::count() > 0,
459 + 'me' => $me,
460 + // Deleting a customer needs fst_sensitive_data plus administrator rights unless
461 + // the site turns the administrator part off.
462 + 'customer_delete_requires_admin' => (bool) apply_filters('fluent_support/customer_delete_requires_admin', true),
463 + 'pref' => [
321 464 'go_back_after_reply' => 'yes'
322 465 ],
323 - 'notification_integrations' => $integrationDrivers,
324 - 'server_time' => current_time('mysql'),
325 - 'has_email_parser' => defined('FLUENTSUPPORTPRO_PLUGIN_VERSION'),
326 - 'ticket_tags' => $tags,
327 - 'i18n' => $i18ns,
328 - 'custom_fields' => apply_filters('fluent_support/ticket_custom_fields', []),
329 - 'has_file_upload' => !!Helper::ticketAcceptedFileMiles()
466 + 'notification_integrations' => $integrationDrivers,
467 + 'internal_notification_settings' => (new NotificationSettings())->get(false),
468 + // Site time, like every date the API sends; relative times compare the two.
469 + 'server_time' => current_time('mysql'),
470 + 'has_email_parser' => defined('FLUENTSUPPORTPRO_PLUGIN_VERSION'),
471 + 'ticket_tags' => $tags,
472 + 'i18n' => $i18ns,
473 + 'custom_fields' => apply_filters('fluent_support/ticket_custom_fields', []),
474 + 'has_file_upload' => !!Helper::ticketAcceptedFileMiles(),
475 + 'repost_export_options' => Helper::getExportOptions(),
476 + 'enable_draft_mode' => Helper::getBusinessSettings('enable_draft_mode', 'no'),
477 + 'keyboard_shortcuts' => Helper::getBusinessSettings('keyboard_shortcuts', 'no'),
478 + 'agent_time_tracking' => Helper::getBusinessSettings('agent_time_tracking', 'no'),
479 + 'max_file_upload' => Helper::getBusinessSettings('max_file_upload', 3),
480 + 'ajaxurl' => admin_url('admin-ajax.php'),
481 + 'auth_provider' => Helper::getAuthProvider(),
482 + 'fluent_bot_integration' => Helper::fluentBotIntegrationStatus(),
330 483 ));
331 484
485 + $appVars['fluent_booking'] = (new FluentBookingService())->getStatus();
486 +
332 487 if (defined('FLUENTCRM')) {
333 488 $appVars['fluentcrm_config'] = Helper::getFluentCRMTagConfig();
334 489 }
335 490
491 + if (defined('FLUENT_BOARDS')) {
492 + $appVars['fluent_boards'] = true;
493 + }
494 +
336 495 $appVars['has_pro'] = defined('FLUENTSUPPORTPRO_PLUGIN_VERSION');
496 + $appVars['version'] = FLUENT_SUPPORT_VERSION;
497 + // Single source of truth for upgrade CTAs; the SPA only re-points utm_content on this.
498 + $appVars['upgrade_url'] = Helper::getUpgradeUrl();
499 + if ($appVars['has_pro']) {
500 + $appVars['agent_feedback_rating'] = Helper::getBusinessSettings('agent_feedback_rating', 'no');
501 + $appVars['open_ai_integration'] = Helper::openAIIntegrationStatus();
502 + }
337 503
338 504 wp_localize_script('fluent_support_admin_app_start', 'fluentSupportAdmin', $appVars);
339 - do_action('fluent_support/admin_app_loaded', $app);
340 -
341 505 }
342 506
343 507 protected function getRestInfo($app)
344 508 {
@@ -360,8 +524,10 @@
360 524
361 525 $assets = $app['path.assets'];
362 526
363 527 return 'data:image/svg+xml;base64,' . base64_encode(
364 - '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 1200"><defs><style>.cls-1{fill:#fff;fill-rule:evenodd;}</style></defs><path class="cls-1" d="M1154.68,162.74v328l-.06-.05c-28.42-68.67-94.1-118-171.88-122.75a193.27,193.27,0,0,0-64.45,6.17L137.57,583.44A70.3,70.3,0,0,1,122.08,586a62.79,62.79,0,0,1-10.77.94A66.34,66.34,0,0,1,45,521.43a73.54,73.54,0,0,1-.61-9.28v-111c0-.16,0-.33,0-.5s0-.27,0-.39c0-1.27.16-2.49.22-3.77s.05-2.39.17-3.55c.16-2.06.44-4.06.72-6.06.11-.55.16-1.16.27-1.72.34-1.94.73-3.83,1.23-5.71.16-.84.33-1.56.55-2.34.45-1.55.89-3.05,1.33-4.55s1.06-3,1.61-4.55c.28-.61.5-1.28.78-1.94a92.91,92.91,0,0,1,62.12-54.85L1028.49,66.08a100.17,100.17,0,0,1,18.82-3.44,94.46,94.46,0,0,1,14.21-1.89c1.39,0,2.72-.11,4.11-.11a88.59,88.59,0,0,1,88.55,88.61c0,.55-.06,1.16-.06,1.77A102.6,102.6,0,0,1,1154.68,162.74Z"/><path class="cls-1" d="M943.32,498.86c-2.07,0-4.08.05-6.09.15-2.12-.1-4.29-.15-6.46-.15a139.56,139.56,0,0,0-35.94,4.71l-121.22,32.5L118.06,711.86A86,86,0,0,0,89.43,722c-.38.16-.69.37-1,.53a88.53,88.53,0,0,0-44,76.59v335.42a3.68,3.68,0,0,0,6.93,1.76,400,400,0,0,1,128.84-142,1.75,1.75,0,0,1,.32-.21A321.92,321.92,0,0,1,257.12,954a.22.22,0,0,1,.11,0q12.61-4.61,25.72-8.1l46.43-12.44,626.16-167.8,13-3.5a121.56,121.56,0,0,0,18.58-5,132.87,132.87,0,0,0-43.77-258.32Z"/></svg>'
528 + '<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
529 + <path d="M90 0C95.5228 1.28852e-06 100 4.47715 100 10V90C100 95.5228 95.5228 100 90 100H10C4.47715 100 0 95.5228 0 90V10C1.28855e-06 4.47715 4.47715 0 10 0H90ZM70.2314 44.8672L70.2266 44.876H69.4941C68.7844 44.876 68.0791 44.9715 67.3965 45.1523L60.3203 47.0508L22.0703 57.3096C21.4826 57.4 20.9177 57.604 20.4023 57.9023H20.3428C18.7515 58.8292 17.7751 60.5292 17.7705 62.3691V81.9424C17.7662 82.0596 17.8564 82.1632 17.9736 82.168C18.0595 82.168 18.1409 82.1224 18.1816 82.041C19.9811 78.7134 22.5589 75.8698 25.7012 73.7539C27.0801 72.7774 28.5854 71.9902 30.1768 71.416C30.6694 71.2352 31.167 71.0821 31.6777 70.9375L34.3682 70.209L70.9092 60.4209L71.6641 60.2129C72.0348 60.1496 72.3973 60.0494 72.75 59.9229C76.7916 58.503 78.9165 54.0818 77.4971 50.04C76.4074 46.9384 73.4817 44.8626 70.1992 44.8535L70.2314 44.8672ZM77.1172 19.3086C76.8415 19.3267 76.5612 19.3583 76.29 19.417C75.9194 19.4532 75.5485 19.5217 75.1914 19.6211L21.79 33.9219C20.1217 34.365 18.7609 35.5766 18.1279 37.1816C18.1189 37.2178 18.1001 37.2588 18.082 37.2949C18.046 37.3851 18.0144 37.4798 17.9873 37.5654C17.9602 37.6513 17.915 37.7422 17.915 37.8281C17.9015 37.8733 17.8928 37.9187 17.8838 37.9639C17.8567 38.0765 17.8118 38.2653 17.8115 38.2979V38.3975C17.7889 38.5105 17.7796 38.6285 17.7705 38.7461V45.6494C17.7705 45.8348 17.7844 46.0164 17.8115 46.1973C17.8343 48.3176 19.5613 50.0217 21.6816 50.0127C21.8895 50.0127 22.0978 49.9951 22.3057 49.959C22.6085 49.9454 22.9113 49.8954 23.2051 49.8096L68.7705 37.5928C69.9958 37.2627 71.2669 37.1404 72.5283 37.2354C76.9635 37.5068 80.8557 40.2878 82.5557 44.3975V25.2637C82.5557 25.0286 82.5425 24.8066 82.5244 24.5986V24.4717C82.5242 21.619 80.2141 19.3087 77.3613 19.3086H77.1172Z" fill="#9CA1A8"/>
530 + </svg>'
365 531 );
366 532 }
367 533 }