PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.3
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.3
4.0.8 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 All 149 releases
← All changes | classes/Visualizer/Module/Frontend.php +18 -2 3.4.23.4.3 View file →
@@ -252,9 +252,9 @@
252 252 $settings = apply_filters( $atts['settings'], $settings, $chart->ID, $type );
253 253 }
254 254
255 255 // handle data filter hooks
256 - $data = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, unserialize( html_entity_decode( $chart->post_content ) ), $chart->ID, $type );
256 + $data = self::get_chart_data( $chart, $type );
257 257 if ( ! empty( $atts['data'] ) ) {
258 258 $data = apply_filters( $atts['data'], $data, $chart->ID, $type );
259 259 }
260 260
@@ -354,8 +354,11 @@
354 354 *
355 355 * @access private
356 356 */
357 357 private function addSchema( $id ) {
358 + // should we show informative errors as HTML comments?
359 + $show_errors = apply_filters( 'visualizer_schema_show_errors', true, $id );
360 +
358 361 $settings = get_post_meta( $id, Visualizer_Plugin::CF_SETTINGS, true );
359 362 $title = '';
360 363 if ( isset( $settings['title'] ) && ! empty( $settings['title'] ) ) {
361 364 $title = $settings['title'];
@@ -364,8 +367,11 @@
364 367 }
365 368 }
366 369 $title = apply_filters( 'visualizer_schema_name', $title, $id );
367 370 if ( empty( $title ) ) {
371 + if ( $show_errors ) {
372 + return "<!-- Not showing structured data for chart $id because title is empty -->";
373 + }
368 374 return '';
369 375 }
370 376
371 377 $desc = '';
@@ -372,10 +378,20 @@
372 378 if ( isset( $settings['description'] ) && ! empty( $settings['description'] ) ) {
373 379 $desc = $settings['description'];
374 380 }
375 381 $desc = apply_filters( 'visualizer_schema_description', $desc, $id );
382 + if ( empty( $desc ) ) {
383 + if ( $show_errors ) {
384 + return "<!-- Not showing structured data for chart $id because description is empty -->";
385 + }
386 + return '';
387 + }
388 +
376 389 // descriptions below 50 chars are not allowed.
377 - if ( empty( $desc ) || strlen( $desc ) < 50 ) {
390 + if ( strlen( $desc ) < 50 ) {
391 + if ( $show_errors ) {
392 + return "<!-- Not showing structured data for chart $id because description is shorter than 50 characters -->";
393 + }
378 394 return '';
379 395 }
380 396
381 397 $schema = apply_filters(