Skip to content

Commit 160c59e

Browse files
release: fixes
- Fixed Geo chart [PRO] flickering issue - Added disable legend option for ChartJS chart - Enhanced security
2 parents f148afb + e93da29 commit 160c59e

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

classes/Visualizer/Module/Chart.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,9 @@ public function renderChartPages() {
532532
set_current_screen( 'visualizer_render_chart' );
533533
// check chart, if chart not exists, will create new one and redirects to the same page with proper chart id
534534
$chart_id = isset( $_GET['chart'] ) ? filter_var( $_GET['chart'], FILTER_VALIDATE_INT ) : '';
535+
if ( ! empty( $_POST ) ) {
536+
$_POST = map_deep( $_POST, 'wp_strip_all_tags' );
537+
}
535538
if ( ! $chart_id || ! ( $chart = get_post( $chart_id ) ) || $chart->post_type !== Visualizer_Plugin::CPT_VISUALIZER ) {
536539
if ( empty( $_GET['lang'] ) || empty( $_GET['parent_chart_id'] ) ) {
537540
$this->deleteOldCharts();

classes/Visualizer/Render/Sidebar/ChartJS.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function __construct( $data = array() ) {
3535
'right' => esc_html__( 'Right of the chart', 'visualizer' ),
3636
'top' => esc_html__( 'Above the chart', 'visualizer' ),
3737
'bottom' => esc_html__( 'Below the chart', 'visualizer' ),
38+
'bottom' => esc_html__( 'Below the chart', 'visualizer' ),
39+
'none' => esc_html__( 'Omit the legend', 'visualizer' ),
3840
);
3941

4042
}

cypress.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"pass": "wordpress",
66
"urls": {
77
"library": "/wp-admin/admin.php?page=visualizer",
8-
"samples": "https://s3.amazonaws.com/downloads.themeisle.com/samples-visualizer/"
8+
"samples": "https://s3.amazonaws.com/verti-utils/samples-visualizer/"
99
},
1010
"chart_types": {
1111
"free": 4,

js/preview.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
clearTimeout(timeout);
6262
timeout = setTimeout(function() {
6363
var settings = $('#settings-form').serializeObject();
64-
64+
settings = JSON.stringify( settings ).replace( /<\/?[^>]+(>|$)/g, '' );
65+
settings = JSON.parse( settings );
6566
delete settings['width'];
6667
delete settings['height'];
6768

js/render-chartjs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@
197197
}
198198
}
199199

200+
settings.plugins = {
201+
legend: settings.legend,
202+
};
203+
200204
handleAxes(settings, chart);
201205

202206
override(settings, chart);

js/render-google.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var chartWrapperError = [];
4040
function renderSpecificChart(id, chart) {
4141
var render, container, series, data, table, settings, i, j, row, date, axis, property, format, formatter;
4242

43-
if ( $('#' + id).hasClass('visualizer-chart-loaded') ) {
43+
if ( $('#' + id).hasClass('visualizer-chart-loaded') || $('#' + id).children( ':not(.loader)' ).length > 0 ) {
4444
return;
4545
}
4646

0 commit comments

Comments
 (0)