PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.7.12
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.7.12
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
← All changes | classes/Visualizer/Module/Frontend.php +8 -49 3.10.123.7.12 View file →
@@ -63,9 +63,8 @@
63 63
64 64 $this->_addAction( 'wp_print_footer_scripts', 'printFooterScripts' );
65 65 $this->_addAction( 'wp_enqueue_scripts', 'enqueueScripts' );
66 66 $this->_addAction( 'load-index.php', 'enqueueScripts' );
67 - $this->_addAction( 'load-visualizer_page_visualizer-setup-wizard', 'enqueueScripts' );
68 67 $this->_addAction( 'visualizer_enqueue_scripts', 'enqueueScripts' );
69 68 $this->_addFilter( 'visualizer_get_language', 'getLanguage' );
70 69 $this->_addShortcode( 'visualizer', 'renderChart' );
71 70
@@ -305,25 +304,8 @@
305 304 ),
306 305 $atts
307 306 );
308 307
309 - $atts['id'] = (int) $atts['id'];
310 - $atts['class'] = esc_attr( $atts['class'] );
311 - $atts['lazy'] = esc_attr( $atts['lazy'] );
312 - $atts['use_image'] = esc_attr( $atts['use_image'] );
313 -
314 - global $sitepress;
315 - if ( Visualizer_Module::is_pro() && ( function_exists( 'icl_get_languages' ) && $sitepress instanceof \SitePress ) ) {
316 - global $sitepress;
317 - $locale = icl_get_current_language();
318 - $locale = strtolower( str_replace( '_', '-', $locale ) );
319 - $trid = $sitepress->get_element_trid( $atts['id'], 'post_' . Visualizer_Plugin::CPT_VISUALIZER );
320 - $translations = $sitepress->get_element_translations( $trid );
321 - if ( isset( $translations[ $locale ] ) && is_object( $translations[ $locale ] ) ) {
322 - $atts['id'] = $translations[ $locale ]->element_id;
323 - }
324 - }
325 -
326 308 $chart_data = $this->getChartData( Visualizer_Plugin::CF_CHART_CACHE, $atts['id'] );
327 309 // if empty chart does not exists, then return empty string.
328 310 if ( ! $chart_data ) {
329 311 return '';
@@ -336,12 +318,8 @@
336 318 if ( ! apply_filters( 'visualizer_pro_show_chart', true, $atts['id'] ) ) {
337 319 return '';
338 320 }
339 321
340 - if ( ! is_admin() && ! empty( $chart_data['is_woocommerce_report'] ) ) {
341 - return '';
342 - }
343 -
344 322 // in case revisions exist.
345 323 // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition.Found
346 324 if ( true === ( $revisions = $this->undoRevisions( $chart->ID, true ) ) ) {
347 325 $chart = get_post( $chart->ID );
@@ -368,9 +346,8 @@
368 346 $chart = apply_filters( 'visualizer_schedule_refresh_chart', $chart, $chart->ID, false );
369 347
370 348 // Get and update settings.
371 349 $settings = $chart_data['settings'];
372 - $settings = ! empty( $settings ) ? $settings : array();
373 350 if ( empty( $settings['height'] ) ) {
374 351 $settings['height'] = '400';
375 352 }
376 353
@@ -417,21 +394,8 @@
417 394 if ( isset( $settings['chart-img'] ) ) {
418 395 unset( $settings['chart-img'] );
419 396 }
420 397
421 - $enable_controls = false;
422 - if ( isset( $settings['controls'] ) && ! empty( $settings['controls']['controlType'] ) ) {
423 - $column_index = $settings['controls']['filterColumnIndex'];
424 - $column_label = $settings['controls']['filterColumnLabel'];
425 - if ( 'false' !== $column_index || 'false' !== $column_label ) {
426 - $enable_controls = true;
427 - }
428 - }
429 -
430 - if ( ! $enable_controls ) {
431 - unset( $settings['controls'] );
432 - }
433 -
434 398 // add chart to the array
435 399 $this->_charts[ $id ] = array(
436 400 'type' => $type,
437 401 'series' => $series,
@@ -513,13 +477,10 @@
513 477 $prefix = 'C' . 'h' . 'a' . 'rt';
514 478 if ( $type === 'tabular' ) {
515 479 $prefix = 'T' . 'a' . 'bl' . 'e';
516 480 }
517 - if ( Visualizer_Module::is_pro() && $enable_controls ) {
518 - $actions_div .= '<div id="control_wrapper_' . $id . '"></div>';
519 - }
520 481 // return placeholder div
521 - return '<div class="' . $container_class . '" id="chart_wrapper_' . $id . '">' . $actions_div . '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '></div>' . $this->addSchema( $chart->ID ) . '</div>';
482 + return '<div class="' . $container_class . '">' . $actions_div . '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '></div>' . $this->addSchema( $chart->ID ) . ( ! Visualizer_Module::is_pro() ? ( '<' . 'di' . 'v st' . 'yl' . 'e="' . 'op' . 'a' . 'ci' . 't' . 'y:' . '0' . '.7' . ';t' . 'ex' . 't-a' . 'li' . 'gn:' . 'ri' . 'gh' . 't;b' . 'o' . 'tto' . 'm: 1' . '0px; z-i' . 'nd' . 'ex:1' . '00' . '0; ' . 'le' . 'ft' . ':2' . '0px' . '; fo' . 'nt-si' . 'ze: 1' . '4px">' . $prefix . ' b' . 'y' . ' <a ' . 'h' . 're' . 'f="ht' . 'tp' . 's:/' . '/t' . 'he' . 'me' . 'i' . 'sl' . 'e' . '.c' . 'om' . '/p' . 'lu' . 'gi' . 'ns' . '/v' . 'i' . 'su' . 'al' . 'iz' . 'er' . '-c' . 'ha' . 'rts' . '-a' . 'nd' . '-gr' . 'ap' . 'hs' . '/" t' . 'arg' . 'et="' . '_bl' . 'an' . 'k" re' . 'l=' . '"no' . 'fol' . 'l' . 'ow"' . '>V' . 'is' . 'u' . 'a' . 'l' . 'i' . 'z' . 'e' . 'r' . '</' . 'a' . '>' . '<' . '/' . 'd' . 'i' . 'v' . '>' ) : '' ) . '</div>';
522 483 }
523 484
524 485 /**
525 486 * Converts the array of attributes to a string of HTML attributes.
@@ -661,11 +622,10 @@
661 622
662 623 // Get chart by ID.
663 624 $chart = get_post( $chart_id );
664 625 if ( $chart && Visualizer_Plugin::CPT_VISUALIZER === $chart->post_type ) {
665 - $settings = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SETTINGS, true );
666 - $series = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SERIES, true );
667 - $is_woocommerce_report = get_post_meta( $chart->ID, Visualizer_Plugin::CF_IS_WOOCOMMERCE_SOURCE, true );
626 + $settings = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SETTINGS, true );
627 + $series = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SERIES, true );
668 628
669 629 if ( isset( $settings['series'] ) && ! ( count( $settings['series'] ) - count( $series ) > 1 ) ) {
670 630 $diff_total_series = abs( count( $settings['series'] ) - count( $series ) );
671 631 if ( $diff_total_series ) {
@@ -674,14 +634,13 @@
674 634 }
675 635 }
676 636 }
677 637 $chart_data = array(
678 - 'chart' => $chart,
679 - 'type' => get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true ),
680 - 'settings' => $settings,
681 - 'series' => $series,
682 - 'chart_image' => get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_IMAGE, true ),
683 - 'is_woocommerce_report' => $is_woocommerce_report,
638 + 'chart' => $chart,
639 + 'type' => get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true ),
640 + 'settings' => $settings,
641 + 'series' => $series,
642 + 'chart_image' => get_post_meta( $chart->ID, Visualizer_Plugin::CF_CHART_IMAGE, true ),
684 643 );
685 644
686 645 // Put the results in a transient. Expire after 12 hours.
687 646 set_transient( $cache_key, $chart_data, apply_filters( Visualizer_Plugin::FILTER_HANDLE_CACHE_EXPIRATION_TIME, 12 * HOUR_IN_SECONDS ) );