PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 4.0.7
Visualizer – Tables & Charts Manager with Built-in AI Generator v4.0.7
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / classes / Visualizer / Module / Wizard.php

Wizard.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 4.0.7, at classes/Visualizer/Module/Wizard.php

697 lines 20.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The class for handle setup wizard stuff.
4 *
5 * @category Visualizer
6 * @package Module
7 *
8 * @since 3.9
9 */
10
11 /**
12 * Setup wizard main class.
13 */
14 class Visualizer_Module_Wizard extends Visualizer_Module {
15
16 /**
17 * Store name class.
18 */
19 const NAME = __CLASS__;
20
21 /**
22 * Option name.
23 */
24 const OPTION_NAME = 'visualizer_wizard_data';
25
26 /**
27 * Wizard data
28 *
29 * @access private
30 * @var $wizard_data array
31 */
32 private $wizard_data = array();
33
34 /**
35 * Constructor.
36 *
37 * @since 3.9
38 *
39 * @access public
40 *
41 * @param Visualizer_Plugin $plugin The instance of the plugin.
42 */
43 public function __construct( Visualizer_Plugin $plugin ) {
44 parent::__construct( $plugin );
45 $this->_addFilter( 'admin_body_class', 'addWizardClasses' );
46 $this->_addAction( 'admin_action_visualizer_dismiss_wizard', 'dismissWizard' );
47 $this->_addAction( 'admin_menu', 'registerAdminMenu' );
48 $this->_addAction( 'wp_ajax_visualizer_wizard_step_process', 'visualizer_wizard_step_process' );
49 $this->wizard_data = get_option( self::OPTION_NAME, array() );
50 }
51
52 /**
53 * Registers admin menu for visualizer library.
54 *
55 * @since 1.0.0
56 *
57 * @access public
58 */
59 public function registerAdminMenu() {
60 if ( ! Visualizer_Module::is_pro() && get_option( 'visualizer_fresh_install', false ) ) {
61 $hook = add_submenu_page(
62 Visualizer_Plugin::NAME,
63 __( 'Setup Wizard', 'visualizer' ),
64 __( 'Setup Wizard', 'visualizer' ),
65 'manage_options',
66 'visualizer-setup-wizard',
67 array(
68 $this,
69 'visualizer_setup_wizard_page',
70 )
71 );
72 add_action( "load-$hook", array( $this, 'visualizer_load_setup_wizard_page' ) );
73 }
74 }
75
76
77 /**
78 * Method to register the setup wizard page.
79 *
80 * @access public
81 */
82 public function visualizer_setup_wizard_page() {
83 include VISUALIZER_ABSPATH . '/templates/setup-wizard.php';
84 }
85
86 /**
87 * Add classes to make the wizard full screen.
88 *
89 * @param string $classes Body classes.
90 * @return string
91 */
92 public static function addWizardClasses( $classes ) {
93 if ( get_option( 'visualizer_fresh_install', false ) ) {
94 $classes .= ' vz-wizard-fullscreen';
95 }
96 return trim( $classes );
97 }
98
99 /**
100 * Load setup wizard page.
101 *
102 * @access public
103 */
104 public function visualizer_load_setup_wizard_page() {
105 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
106 if ( isset( $_GET['page'] ) && 'visualizer-setup-wizard' === $_GET['page'] ) {
107 remove_all_actions( 'admin_notices' );
108 }
109 add_action( 'admin_enqueue_scripts', array( $this, 'visualizer_enqueue_setup_wizard_scripts' ) );
110 add_filter( Visualizer_Plugin::FILTER_GET_CHART_SETTINGS, array( $this, 'visualizer_filter_chart_settings' ) );
111 }
112
113 /**
114 * Enqueue setup wizard required scripts.
115 *
116 * @access public
117 */
118 public function visualizer_enqueue_setup_wizard_scripts() {
119 wp_enqueue_style( 'jquery-slick', VISUALIZER_ABSURL . 'css/lib/slick.min.css', array(), Visualizer_Plugin::VERSION );
120 wp_enqueue_style( 'jquery-smart-wizard', VISUALIZER_ABSURL . 'css/lib/smart_wizard_all.min.css', array(), Visualizer_Plugin::VERSION );
121 wp_enqueue_style( 'visualizer-setup-wizard', VISUALIZER_ABSURL . 'css/style-wizard.css', array(), Visualizer_Plugin::VERSION, 'all' );
122
123 wp_register_script( 'jquery-slick', VISUALIZER_ABSURL . 'js/lib/slick.min.js', array( 'jquery' ), Visualizer_Plugin::VERSION, true );
124 wp_enqueue_script( 'jquery-smart-wizard', VISUALIZER_ABSURL . 'js/lib/jquery.smartWizard.min.js', array( 'jquery', 'jquery-slick', 'clipboard' ), Visualizer_Plugin::VERSION, true );
125 wp_enqueue_script( 'visualizer-setup-wizard', VISUALIZER_ABSURL . 'js/setup-wizard.js', array( 'jquery' ), Visualizer_Plugin::VERSION, true );
126 wp_localize_script(
127 'visualizer-setup-wizard',
128 'visualizerSetupWizardData',
129 array(
130 'adminPage' => add_query_arg( 'page', Visualizer_Plugin::NAME, admin_url( 'admin.php' ) ),
131 'ajax' => array(
132 'url' => admin_url( 'admin-ajax.php' ),
133 'security' => wp_create_nonce( VISUALIZER_ABSPATH ),
134 ),
135 'errorMessages' => array(
136 'requiredEmail' => __( 'This field is required.', 'visualizer' ),
137 'invalidEmail' => __( 'Please enter a valid email address.', 'visualizer' ),
138 ),
139 'nextButtonText' => __( 'Next Step', 'visualizer' ),
140 'backButtonText' => __( 'Back', 'visualizer' ),
141 'draftPageButtonText' => array(
142 'firstButtonText' => __( 'Save And Continue', 'visualizer' ),
143 'secondButtonText' => __( 'Continue', 'visualizer' ),
144 ),
145 )
146 );
147 }
148
149 /**
150 * Dismiss setup wizard.
151 *
152 * @param bool $redirect_to_dashboard Redirect to dashboard.
153 * @return bool|void
154 */
155 public function dismissWizard( $redirect_to_dashboard = true ) {
156 if ( ! current_user_can( 'manage_options' ) ) {
157 wp_die( esc_html__( 'You do not have permission to perform this action.', 'visualizer' ), '', array( 'response' => 403 ) );
158 }
159 if ( false !== $redirect_to_dashboard ) {
160 check_admin_referer( 'visualizer_dismiss_wizard' );
161 }
162 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
163 $status = isset( $_REQUEST['status'] ) ? (int) $_REQUEST['status'] : 0;
164 update_option( 'visualizer_fresh_install', $status );
165 delete_option( 'visualizer_wizard_data' );
166 if ( false !== $redirect_to_dashboard ) {
167 wp_safe_redirect( add_query_arg( 'page', Visualizer_Plugin::NAME, admin_url( 'admin.php' ) ) );
168 exit;
169 }
170 return true;
171 }
172
173 /**
174 * Setup wizard process.
175 */
176 public function visualizer_wizard_step_process() {
177 check_ajax_referer( VISUALIZER_ABSPATH, 'security' );
178 if ( ! current_user_can( 'manage_options' ) ) {
179 wp_send_json( array( 'status' => 0 ), 403 );
180 }
181 $step = ! empty( $_POST['step'] ) ? sanitize_text_field( wp_unslash( $_POST['step'] ) ) : 1;
182 switch ( $step ) {
183 case 'step_2':
184 $this->setup_wizard_import_chart();
185 break;
186 case 'step_4':
187 $this->setup_wizard_install_plugin();
188 break;
189 case 'step_subscribe':
190 $this->setup_wizard_subscribe_process();
191 break;
192 case 'create_draft_page':
193 $this->setup_wizard_create_draft_page();
194 break;
195 default:
196 wp_send_json( array( 'status' => 0 ) );
197 break;
198 }
199 }
200
201 /**
202 * Step: 2 import chart.
203 */
204 private function setup_wizard_import_chart() {
205 // phpcs:ignore WordPress.Security.NonceVerification.Missing
206 $chart_type = ! empty( $_POST['chart_type'] ) ? sanitize_text_field( wp_unslash( $_POST['chart_type'] ) ) : '';
207 $chart_status = Visualizer_Module_Admin::checkChartStatus( $chart_type );
208 if ( ! $chart_status ) {
209 wp_send_json(
210 array(
211 'success' => 0,
212 )
213 );
214 exit;
215 }
216
217 $source = new Visualizer_Source_Csv( VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples' . DIRECTORY_SEPARATOR . $chart_type . '.csv' );
218 $source->fetch();
219 $series = $source->getSeries();
220 $response = array(
221 'success' => 2,
222 'message' => __( 'Something went wrong while importing the chart', 'visualizer' ),
223 );
224
225 $data = $source->getData();
226 $args = array(
227 'post_type' => Visualizer_Plugin::CPT_VISUALIZER,
228 'post_title' => 'Visualization',
229 'post_author' => get_current_user_id(),
230 'post_status' => 'publish',
231 'post_content' => $data,
232 );
233 $chart_id = wp_insert_post( $args );
234
235 if ( $chart_id && ! is_wp_error( $chart_id ) ) {
236 // Clear existing chart cache.
237 $cache_key = Visualizer_Plugin::CF_CHART_CACHE . '_' . $chart_id;
238 delete_transient( $cache_key );
239
240 update_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, $chart_type );
241 update_post_meta( $chart_id, Visualizer_Plugin::CF_DEFAULT_DATA, 1 );
242 update_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() );
243 update_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $series );
244 update_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_LIBRARY, '' );
245
246 $data = Visualizer_Module::decode_content( $data );
247 $setting_series = array();
248 $setting_slices = array();
249 foreach ( $data as $s ) {
250 $setting_series[] = array(
251 'visibleInLegend' => '',
252 'lineWidth' => '',
253 'pointSize' => '',
254 'format' => '',
255 'curveType' => '',
256 'color' => '',
257 'role' => '',
258 );
259 $setting_slices[] = array(
260 'offset' => 0,
261 'color' => '',
262 );
263 }
264 update_post_meta(
265 $chart_id,
266 Visualizer_Plugin::CF_SETTINGS,
267 array(
268 'title' => '',
269 'titlePosition' => '',
270 'titleTextStyle' => array(
271 'color' => '#000',
272 ),
273 'legend' => array(
274 'position' => 'right',
275 'alignment' => 15,
276 'textStyle' => array(
277 'color' => '#000',
278 'text' => 'both',
279 ),
280 ),
281 'tooltip' => array(
282 'trigger' => 'focus',
283 'showColorCode' => 0,
284 'showColorCode' => 0,
285 ),
286 'animation' => array(
287 'startup' => 0,
288 'duration' => '',
289 'easing' => 'linear',
290 ),
291 'width' => '',
292 'height' => '',
293 'keepAspectRatio' => false,
294 'isStacked' => false,
295 'lazy_load_chart' => true,
296 'backgroundColor' => array(
297 'strokeWidth' => '',
298 'stroke' => '',
299 'fill' => '',
300 ),
301 'chartArea' => array(
302 'left' => '',
303 'top' => '',
304 'width' => '',
305 'height' => '',
306 ),
307 'focusTarget' => 'datum',
308 'series' => $setting_series,
309 'slices' => $setting_slices,
310 'vAxis' => array(
311 'title' => '',
312 'textPosition' => '',
313 'direction' => 1,
314 'baselineColor' => '#000',
315 'textStyle' => array(
316 'color' => '#000',
317 ),
318 'format' => '',
319 'gridlines' => array(
320 'count' => '',
321 'color' => '#ccc',
322 ),
323 'minorGridlines' => array(
324 'count' => '',
325 'color' => '',
326 ),
327 'viewWindow' => array(
328 'max' => '',
329 'min' => '',
330 ),
331 ),
332 'hAxis' => array(
333 'title' => '',
334 'textPosition' => '',
335 'direction' => 1,
336 'baselineColor' => '#000',
337 'textStyle' => array(
338 'color' => '#000',
339 ),
340 'format' => '',
341 'gridlines' => array(
342 'count' => '',
343 'color' => '#ccc',
344 ),
345 'minorGridlines' => array(
346 'count' => '',
347 'color' => '',
348 ),
349 'viewWindow' => array(
350 'max' => '',
351 'min' => '',
352 ),
353 ),
354 'customcss' => array(
355 'headerRow' => array(
356 'background-color' => '',
357 'color' => '',
358 'transform' => '',
359 ),
360 'tableRow' => array(
361 'background-color' => '',
362 'color' => '',
363 'transform' => '',
364 ),
365 'oddTableRow' => array(
366 'background-color' => '',
367 'color' => '',
368 'transform' => '',
369 ),
370 'selectedTableRow' => array(
371 'background-color' => '',
372 'color' => '',
373 'transform' => '',
374 ),
375 'hoverTableRow' => array(
376 'background-color' => '',
377 'color' => '',
378 'transform' => '',
379 ),
380 'headerCell' => array(
381 'background-color' => '',
382 'color' => '',
383 'transform' => '',
384 ),
385 'tableCell' => array(
386 'background-color' => '',
387 'color' => '',
388 'transform' => '',
389 ),
390 ),
391 )
392 );
393 $wizard_data = array(
394 'chart_type' => $chart_type,
395 'chart_id' => $chart_id,
396 );
397 $this->update_wizard_data( $wizard_data, false );
398 $response = array(
399 'success' => 1,
400 'chart_id' => $chart_id,
401 );
402 }
403 wp_send_json( $response );
404 exit;
405 }
406
407 /**
408 * Update wizard data.
409 *
410 * @param array $data Wizard data.
411 * @param bool $merge_option Merge wizard data.
412 * @return bool
413 */
414 private function update_wizard_data( $data = array(), $merge_option = true ) {
415 if ( $merge_option ) {
416 $this->wizard_data = get_option( self::OPTION_NAME, array() );
417 $data = array_merge( $this->wizard_data, $data );
418 }
419 return update_option( self::OPTION_NAME, $data );
420 }
421
422 /**
423 * Step: 3 Create draft page.
424 *
425 * @param bool $return_page_id Page ID.
426 */
427 private function setup_wizard_create_draft_page( $return_page_id = false ) {
428 $add_basic_shortcode = ! empty( $_POST['add_basic_shortcode'] ) ? sanitize_text_field( wp_unslash( $_POST['add_basic_shortcode'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
429 $add_basic_shortcode = 'true' === $add_basic_shortcode ? true : false;
430 $basic_shortcode = ! empty( $_POST['basic_shortcode'] ) ? sanitize_text_field( wp_unslash( $_POST['basic_shortcode'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
431
432 if ( ! $add_basic_shortcode ) {
433 wp_send_json(
434 array(
435 'status' => 1,
436 )
437 );
438 }
439 if ( function_exists( 'use_block_editor_for_post_type' ) && use_block_editor_for_post_type( 'page' ) ) {
440 $this->wizard_data = get_option( self::OPTION_NAME, array() );
441 if ( ! empty( $this->wizard_data['chart_id'] ) ) {
442 $block_data = array(
443 'id' => $this->wizard_data['chart_id'],
444 'lazy' => '-1',
445 'route' => 'chartSelect',
446 );
447 $basic_shortcode = '<!-- wp:visualizer/chart ' . wp_json_encode( $block_data ) . ' /-->';
448 }
449 }
450 $post_title = __( 'Visualizer Demo Page', 'visualizer' );
451 $page_id = post_exists( $post_title, '', '', 'page' );
452 $args = array(
453 'post_type' => 'page',
454 'post_title' => $post_title,
455 'post_content' => $add_basic_shortcode ? $basic_shortcode : '',
456 'post_status' => 'draft',
457 );
458 if ( ! $page_id ) {
459 $page_id = wp_insert_post( $args );
460 } else {
461 $args['ID'] = $page_id;
462 $page_id = wp_update_post( $args );
463 }
464
465 if ( $page_id ) {
466 // Delete previous meta data.
467 $meta = get_post_meta( $page_id );
468 foreach ( $meta as $key => $value ) {
469 delete_post_meta( $page_id, $key );
470 }
471 // Update wizard data.
472 $wizard_data['page_id'] = $page_id;
473 $this->update_wizard_data( $wizard_data );
474 }
475 if ( $return_page_id ) {
476 return $page_id;
477 }
478 wp_send_json(
479 array(
480 'status' => $page_id,
481 )
482 );
483 }
484
485 /**
486 * Step: 3 Install plugin.
487 */
488 private function setup_wizard_install_plugin() {
489 // phpcs:ignore WordPress.Security.NonceVerification.Missing
490 $slug = ! empty( $_POST['slug'] ) ? sanitize_text_field( wp_unslash( $_POST['slug'] ) ) : '';
491 if ( empty( $slug ) ) {
492 wp_send_json(
493 array(
494 'status' => 0,
495 'message' => __( 'No plugin specified.', 'visualizer' ),
496 )
497 );
498 }
499
500 if ( ! current_user_can( 'install_plugins' ) ) {
501 wp_send_json(
502 array(
503 'status' => 0,
504 'message' => __( 'Sorry, you are not allowed to install plugins on this site.', 'visualizer' ),
505 )
506 );
507 }
508
509 if ( ! empty( $slug ) ) {
510 $wizard_data = get_option( self::OPTION_NAME, array() );
511 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
512 include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
513 require_once ABSPATH . 'wp-admin/includes/plugin.php';
514
515 $api = plugins_api(
516 'plugin_information',
517 array(
518 'slug' => sanitize_key( wp_unslash( $slug ) ),
519 'fields' => array(
520 'sections' => false,
521 ),
522 )
523 );
524
525 if ( is_wp_error( $api ) ) {
526 wp_send_json(
527 array(
528 'status' => 0,
529 'message' => $api->get_error_message(),
530 )
531 );
532 }
533
534 $skin = new WP_Ajax_Upgrader_Skin();
535 $upgrader = new Plugin_Upgrader( $skin );
536 $result = $upgrader->install( $api->download_link );
537 if ( is_wp_error( $result ) ) {
538 wp_send_json(
539 array(
540 'status' => 0,
541 'message' => $api->get_error_message(),
542 )
543 );
544 } elseif ( is_wp_error( $skin->result ) ) {
545 if ( 'folder_exists' !== $skin->result->get_error_code() ) {
546 wp_send_json(
547 array(
548 'status' => 0,
549 'message' => $skin->result->get_error_message(),
550 )
551 );
552 }
553 } elseif ( $skin->get_errors()->has_errors() ) {
554 if ( 'folder_exists' !== $skin->get_error_code() ) {
555 wp_send_json(
556 array(
557 'status' => 0,
558 'message' => $skin->get_error_message(),
559 )
560 );
561 }
562 } elseif ( is_null( $result ) ) {
563 global $wp_filesystem;
564 $status = array();
565 $status['message'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.', 'visualizer' );
566
567 // Pass through the error from WP_Filesystem if one was raised.
568 if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
569 $status['message'] = esc_html( $wp_filesystem->errors->get_error_message() );
570 }
571
572 wp_send_json( $status );
573 }
574
575 $installed_plugins = get_plugins( '/' . sanitize_key( wp_unslash( $slug ) ) );
576 if ( ! empty( $installed_plugins ) ) {
577 $plugin_files = array_keys( $installed_plugins );
578 $plugin_file = sanitize_key( wp_unslash( $slug ) ) . '/' . $plugin_files[0];
579 activate_plugin( $plugin_file );
580 }
581 $wizard_data_updated = false;
582 if ( 'optimole-wp' === $slug ) {
583 delete_transient( 'optml_fresh_install' );
584 // Update wizard data.
585 $wizard_data['enable_perfomance'] = true;
586 $wizard_data_updated = true;
587 }
588 if ( 'otter-blocks' === $slug ) {
589 // Update wizard data.
590 $wizard_data['enable_otter_blocks'] = true;
591 $wizard_data_updated = true;
592 // Suppress Otter's post-activation redirects so the user stays in Visualizer.
593 update_option( 'themeisle_blocks_settings_redirect', '0' );
594 update_option( 'themeisle_blocks_settings_onboarding', '0' );
595 }
596 if ( 'wp-cloudflare-page-cache' === $slug ) {
597 // Update wizard data.
598 $wizard_data['enable_page_cache'] = true;
599 $wizard_data_updated = true;
600 update_option( 'swcfpc_dashboard_redirect', false );
601 }
602 if ( $wizard_data_updated ) {
603 $this->update_wizard_data( $wizard_data );
604 }
605
606 wp_send_json(
607 array(
608 'status' => 1,
609 )
610 );
611 }
612 }
613
614 /**
615 * Step: 4 skip and subscribe process.
616 */
617 private function setup_wizard_subscribe_process() {
618 $segment = 0;
619 $wizard_data = get_option( self::OPTION_NAME, array() );
620 $chart_type = ! empty( $wizard_data['chart_type'] ) ? $wizard_data['chart_type'] : '';
621 $chart_id = ! empty( $wizard_data['chart_id'] ) ? $wizard_data['chart_id'] : '';
622 $page_id = ! empty( $wizard_data['page_id'] ) ? $wizard_data['page_id'] : '';
623 $response = array(
624 'status' => 0,
625 'redirect_to' => '',
626 'message' => '',
627 );
628
629 $with_subscribe = ! empty( $_POST['with_subscribe'] ) ? (bool) $_POST['with_subscribe'] : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
630 $email = ! empty( $_POST['email'] ) ? filter_input( INPUT_POST, 'email', FILTER_SANITIZE_EMAIL ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
631 $chart_types = array(
632 'pie' => 1,
633 'bar' => 2,
634 'line' => 3,
635 'tabular' => 4,
636 );
637 if ( $chart_type && ! empty( $chart_types[ $chart_type ] ) ) {
638 $segment = $chart_types[ $chart_type ];
639 }
640 if ( ! empty( $page_id ) ) {
641 $response = array(
642 'status' => 1,
643 'redirect_to' => get_edit_post_link( $page_id, 'db' ),
644 'message' => __( 'Redirecting to draft page', 'visualizer' ),
645 );
646 } else {
647 $response = array(
648 'status' => 1,
649 'redirect_to' => add_query_arg( 'page', 'visualizer', admin_url( 'admin.php' ) ),
650 'message' => __( 'Redirecting to visualizer dashboard', 'visualizer' ),
651 );
652 }
653
654 if ( $with_subscribe && is_email( $email ) ) {
655 wp_remote_post(
656 VISUALIZER_SUBSCRIBE_API,
657 array(
658 'timeout' => 5,
659 'blocking' => false,
660 'headers' => array(
661 'Content-Type' => 'application/json',
662 'Cache-Control' => 'no-cache',
663 'Accept' => 'application/json, */*;q=0.1',
664 ),
665 'body' => wp_json_encode(
666 array(
667 'slug' => 'visualizer',
668 'site' => home_url(),
669 'email' => $email,
670 'data' => array(
671 'segment' => $segment,
672 ),
673 )
674 ),
675 )
676 );
677 }
678
679 $this->dismissWizard( false );
680 wp_send_json( $response );
681 }
682
683 /**
684 * Filter chart setting.
685 *
686 * @param array $settings Chart settings.
687 * @return array
688 */
689 public function visualizer_filter_chart_settings( $settings ) {
690 $settings['backgroundColor'] = array(
691 'fill' => '#39c3d21a',
692 'fillOpacity' => '.1',
693 );
694 return $settings;
695 }
696 }
697