PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.85
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.85
5.5.85 5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 All 161 releases
← All changes | WPDataAccess/Dashboard/WPDA_Widget_Google_Chart.php +14 -16 5.5.37 → 5.5.85 View file →
@@ -1,7 +1,7 @@
1 1 <?php
2 2
3 -// phpcs:ignore Standard.Category.SniffName.ErrorCode
3 +// phpcs:disable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing -- verified on page
4 4 namespace WPDataAccess\Dashboard;
5 5
6 6 use WPDataAccess\Connection\WPDADB;
7 7 use WPDataAccess\WPDA;
@@ -124,12 +124,12 @@
124 124 *
125 125 * @return void
126 126 */
127 127 public function edit_chart() {
128 + // phpcs:disable WordPress.Security.EscapeOutput
128 129 echo $this->html();
129 - // phpcs:ignore WordPress.Security.EscapeOutput
130 130 echo $this->js( 300 );
131 - // phpcs:ignore WordPress.Security.EscapeOutput
131 + // phpcs:enable WordPress.Security.EscapeOutput
132 132 }
133 133
134 134 /**
135 135 * Chart javascript code
@@ -313,19 +313,13 @@
313 313 * @return void
314 314 */
315 315 public static function widget() {
316 316 $panel_name = ( isset( $_REQUEST['wpda_panel_name'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_panel_name'] ) ) : '' );
317 - // phpcs:ignore WordPress.Security.NonceVerification
318 317 $panel_dbs = ( isset( $_REQUEST['wpda_panel_dbs'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_panel_dbs'] ) ) : '' );
319 - // phpcs:ignore WordPress.Security.NonceVerification
320 318 $panel_query = ( isset( $_REQUEST['wpda_panel_query'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_panel_query'] ) ) : '' );
321 - // phpcs:ignore WordPress.Security.NonceVerification
322 319 $panel_column = ( isset( $_REQUEST['wpda_panel_column'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_panel_column'] ) ) : '1' );
323 - // phpcs:ignore WordPress.Security.NonceVerification
324 320 $column_position = ( isset( $_REQUEST['wpda_column_position'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_column_position'] ) ) : 'prepend' );
325 - // phpcs:ignore WordPress.Security.NonceVerification
326 321 $widget_sequence_nr = ( isset( $_REQUEST['wpda_widget_sequence_nr'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['wpda_widget_sequence_nr'] ) ) : '1' );
327 - // phpcs:ignore WordPress.Security.NonceVerification
328 322 $wdg = new WPDA_Widget_Google_Chart(array(
329 323 'outputtype' => array('Table'),
330 324 'name' => $panel_name,
331 325 'dbs' => $panel_dbs,
@@ -334,10 +328,11 @@
334 328 'position' => $column_position,
335 329 'widget_id' => $widget_sequence_nr,
336 330 ));
337 331 WPDA::sent_header( 'text/html; charset=UTF-8' );
332 + // phpcs:disable WordPress.Security.EscapeOutput
338 333 echo $wdg->container();
339 - // phpcs:ignore WordPress.Security.EscapeOutput
334 + // phpcs:enable WordPress.Security.EscapeOutput
340 335 wp_die();
341 336 }
342 337
343 338 /**
@@ -353,11 +348,11 @@
353 348 if ( !$is_header_send ) {
354 349 WPDA::sent_header( 'application/json' );
355 350 }
356 351 if ( !isset( $_REQUEST['wpda_action'] ) ) {
357 - // phpcs:ignore WordPress.Security.NonceVerification
352 + // phpcs:disable WordPress.Security.EscapeOutput
358 353 echo static::msg( 'ERROR', 'Invalid arguments' );
359 - // phpcs:ignore WordPress.Security.EscapeOutput
354 + // phpcs:enable WordPress.Security.EscapeOutput
360 355 wp_die();
361 356 }
362 357 if ( null === $dbs || null === $query ) {
363 358 $widgets = get_user_meta( WPDA::get_current_user_id(), WPDA_Dashboard::USER_DASHBOARD );
@@ -369,15 +364,15 @@
369 364 $widget_found = true;
370 365 }
371 366 }
372 367 if ( !$widget_found ) {
368 + // phpcs:disable WordPress.Security.EscapeOutput
373 369 echo static::msg( 'ERROR', 'Invalid arguments' );
374 - // phpcs:ignore WordPress.Security.EscapeOutput
370 + // phpcs:enable WordPress.Security.EscapeOutput
375 371 wp_die();
376 372 }
377 373 }
378 374 switch ( $_REQUEST['wpda_action'] ) {
379 - // phpcs:ignore WordPress.Security.NonceVerification
380 375 case 'get_data':
381 376 echo wp_json_encode( static::get_data( $dbs, $query ) );
382 377 wp_die();
383 378 break;
@@ -385,10 +380,11 @@
385 380 // TODO ???
386 381 wp_die();
387 382 break;
388 383 default:
384 + // phpcs:disable WordPress.Security.EscapeOutput
389 385 echo static::msg( 'ERROR', 'Invalid arguments' );
390 - // phpcs:ignore WordPress.Security.EscapeOutput
386 + // phpcs:enable WordPress.Security.EscapeOutput
391 387 wp_die();
392 388 }
393 389 }
394 390
@@ -399,9 +395,9 @@
399 395 * @return string
400 396 */
401 397 public static function google_charts_type( $data_type ) {
402 398 $type = explode( '(', (string) $data_type );
403 - //phpcs:ignore - 8.1 proof
399 + // phpcs:ignore -- 8.1 proof
404 400 switch ( $type[0] ) {
405 401 case 'tinyint':
406 402 case 'smallint':
407 403 case 'mediumint':
@@ -427,4 +423,6 @@
427 423 }
428 424 }
429 425
430 426 }
427 +
428 +// phpcs:enable WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing