| @@ -50,15 +50,8 @@ | ||
| 50 | 50 | */ |
| 51 | 51 | protected $file_type = ''; |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | - * Store selected IDs for selective export | |
| 55 | - * | |
| 56 | - * @var array | |
| 57 | - */ | |
| 58 | - protected $selected_ids = []; | |
| 59 | - | |
| 60 | - /** | |
| 61 | 54 | * Prepare data that will be exported |
| 62 | 55 | * |
| 63 | 56 | * @return void |
| 64 | 57 | */ |
| @@ -118,14 +111,14 @@ | ||
| 118 | 111 | */ |
| 119 | 112 | protected function export_columns() { |
| 120 | 113 | $colunms = $this->get_columns(); |
| 121 | 114 | ob_clean(); |
| 122 | - $output = fopen( 'php://output', 'w' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen -- php://output is a stream wrapper, not a filesystem operation | |
| 115 | + $output = fopen( 'php://output', 'w' ); | |
| 123 | 116 | ob_start(); |
| 124 | 117 | |
| 125 | 118 | fputcsv( $output, $colunms ); |
| 126 | 119 | |
| 127 | - fclose( $output ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose -- Closing php://output stream | |
| 120 | + fclose( $output ); | |
| 128 | 121 | |
| 129 | 122 | return ob_get_clean(); |
| 130 | 123 | } |
| 131 | 124 | |
| @@ -136,15 +129,13 @@ | ||
| 136 | 129 | */ |
| 137 | 130 | protected function export_rows() { |
| 138 | 131 | $data = $this->get_data(); |
| 139 | 132 | ob_clean(); |
| 140 | - $buffer = fopen( 'php://output', 'w' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen -- php://output is a stream wrapper, not a filesystem operation | |
| 133 | + $buffer = fopen( 'php://output', 'w' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen | |
| 141 | 134 | ob_start(); |
| 142 | 135 | |
| 143 | 136 | array_walk( $data, array( $this, 'export_row' ), $buffer ); |
| 144 | 137 | |
| 145 | - fclose( $buffer ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose -- Closing php://output stream | |
| 146 | - | |
| 147 | 138 | return ob_get_clean(); |
| 148 | 139 | } |
| 149 | 140 | |
| 150 | 141 | /** |
| @@ -207,9 +198,9 @@ | ||
| 207 | 198 | $this->prepare_data(); |
| 208 | 199 | $this->send_headers(); |
| 209 | 200 | $data = $this->get_data(); |
| 210 | 201 | |
| 211 | - echo wp_json_encode( $data, JSON_PRETTY_PRINT ); | |
| 202 | + echo json_encode( $data, JSON_PRETTY_PRINT ); | |
| 212 | 203 | die(); |
| 213 | 204 | } |
| 214 | 205 | |
| 215 | 206 | /** |