| @@ -151,10 +151,9 @@ | ||
| 151 | 151 | $results = array(); |
| 152 | 152 | $headers = array(); |
| 153 | 153 | |
| 154 | 154 | // short circuit results for remote dbs. |
| 155 | - $remote_results = apply_filters( 'visualizer_db_query_execute', false, $this->_query, $as_html, $results_as_numeric_array, $raw_results, $this->_chart_id, $this->_params ); | |
| 156 | - if ( false !== $remote_results ) { | |
| 155 | + if ( false !== ( $remote_results = apply_filters( 'visualizer_db_query_execute', false, $this->_query, $as_html, $results_as_numeric_array, $raw_results, $this->_chart_id, $this->_params ) ) ) { | |
| 157 | 156 | $error = $remote_results['error']; |
| 158 | 157 | if ( empty( $error ) ) { |
| 159 | 158 | $results = $remote_results['results']; |
| 160 | 159 | $headers = $remote_results['headers']; |
| @@ -180,9 +179,9 @@ | ||
| 180 | 179 | } |
| 181 | 180 | |
| 182 | 181 | if ( $wpdb->last_error ) { |
| 183 | 182 | $this->_error = $wpdb->last_error; |
| 184 | - return array(); | |
| 183 | + return []; | |
| 185 | 184 | } |
| 186 | 185 | |
| 187 | 186 | if ( $rows ) { |
| 188 | 187 | $results = array(); |
| @@ -198,9 +197,9 @@ | ||
| 198 | 197 | $headers[] = array( 'type' => $this->get_col_type( $col_num++ ), 'label' => $k ); |
| 199 | 198 | } |
| 200 | 199 | } |
| 201 | 200 | $results[] = $result; |
| 202 | - ++$row_num; | |
| 201 | + $row_num++; | |
| 203 | 202 | } |
| 204 | 203 | } |
| 205 | 204 | |
| 206 | 205 | $this->_error = $wpdb->last_error; |