From 16a53c5adde30138f18a9f02ed9e21f1340cfac4 Mon Sep 17 00:00:00 2001 From: Miroslav Mitev Date: Fri, 10 Jan 2025 17:18:14 +0200 Subject: [PATCH] Ignore phpcs WP_Filesystem errors --- includes/admin/class-sensei-status.php | 6 +++--- includes/class-sensei-analysis.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/admin/class-sensei-status.php b/includes/admin/class-sensei-status.php index 52e0330ff9..883d571abf 100644 --- a/includes/admin/class-sensei-status.php +++ b/includes/admin/class-sensei-status.php @@ -236,9 +236,9 @@ private function get_template_version( $file ) { } // Read the first 8kb of the file. - $fp = fopen( $file, 'r' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fopen -- Read only open. - $file_data = fread( $fp, 8192 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fread - fclose( $fp ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose + $fp = fopen( $file, 'r' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen -- Read only open. + $file_data = fread( $fp, 8192 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fread + fclose( $fp ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose // Make sure we catch CR-only line endings. $file_data = str_replace( "\r", "\n", $file_data ); diff --git a/includes/class-sensei-analysis.php b/includes/class-sensei-analysis.php index 0b69fd228a..fdb22b3ceb 100755 --- a/includes/class-sensei-analysis.php +++ b/includes/class-sensei-analysis.php @@ -1022,7 +1022,7 @@ public function report_write_download( $report_data = array() ) { foreach ( $report_data as $row ) { fputcsv( $fp, $row ); } - fclose( $fp ); + fclose( $fp ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose } /**