| @@ -1420,12 +1420,8 @@ | ||
| 1420 | 1420 | */ |
| 1421 | 1421 | public function getQueryData() { |
| 1422 | 1422 | check_ajax_referer( Visualizer_Plugin::ACTION_FETCH_DB_DATA . Visualizer_Plugin::VERSION, 'security' ); |
| 1423 | 1423 | |
| 1424 | - if ( ! current_user_can( 'administrator' ) ) { | |
| 1425 | - wp_send_json_error( array( 'msg' => __( 'Action not allowed for this user.', 'visualizer' ) ) ); | |
| 1426 | - } | |
| 1427 | - | |
| 1428 | 1424 | $params = wp_parse_args( $_POST['params'] ); |
| 1429 | 1425 | $chart_id = filter_var( $params['chart_id'], FILTER_VALIDATE_INT ); |
| 1430 | 1426 | |
| 1431 | 1427 | $source = new Visualizer_Source_Query( stripslashes( $params['query'] ), $chart_id, $params ); |
| @@ -1590,12 +1586,8 @@ | ||
| 1590 | 1586 | // Save the image in the uploads directory. |
| 1591 | 1587 | require_once ABSPATH . '/wp-admin/includes/file.php'; |
| 1592 | 1588 | \WP_Filesystem(); |
| 1593 | 1589 | global $wp_filesystem; |
| 1594 | - if ( ! is_a( $wp_filesystem, 'WP_Filesystem_Base' ) ) { | |
| 1595 | - $creds = request_filesystem_credentials( site_url() ); | |
| 1596 | - wp_filesystem( $creds ); | |
| 1597 | - } | |
| 1598 | 1590 | $upload_file = $wp_filesystem->put_contents( $upload_path . $hashed_filename, $decoded ); |
| 1599 | 1591 | |
| 1600 | 1592 | // Insert new chart image. |
| 1601 | 1593 | $attachment = array( |