PluginProbe
QuickWebP – WebP & AVIF Image Optimizer, Compression & SEO for WordPress / 4.1.2
QuickWebP – WebP & AVIF Image Optimizer, Compression & SEO for WordPress v4.1.2
4.1.2 4.1.1 4.1.0 4.0.1 4.0.0 3.3.1 3.3.0 trunk 1.0.0 2.0.0 2.1.0 3.0.0 3.1.0 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8
← All changes | admin/rewrite-rules/class-rewrite-rules-abstract.php +12 -5 3.3.04.1.2 View file →
@@ -1,6 +1,6 @@
1 1 <?php
2 -abstract class Rewrite_Rules_Abstract {
2 +abstract class Quickwebp_Rewrite_Rules_Abstract {
3 3
4 4 /**
5 5 * Name of the tag used as block delemiter.
6 6 */
@@ -118,10 +118,12 @@
118 118 $file_exists = file_exists( $file_path );
119 119 if ( ! $file_exists ) {
120 120 $dir_name = dirname( $file_path );
121 121 if ( ! file_exists( $dir_name ) ){
122 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_mkdir
122 123 mkdir( $dir_name, 0755, true );
123 124 }
125 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_touch
124 126 touch( $file_path );
125 127 }
126 128 $writable = wp_is_writable( $file_path );
127 129
@@ -134,9 +136,10 @@
134 136 if ( false === $contents ) {
135 137 return new \WP_Error(
136 138 'not_read',
137 139 sprintf(
138 - __( 'The %s file could not be read.', QUICKWEBP_TEXT_DOMAIN ),
140 + // translators: %s is a placeholder for the file path.
141 + __( 'The %s file could not be read.', 'quickwebp' ),
139 142 '<code>' . esc_html( $file_path ) . '</code>'
140 143 )
141 144 );
142 145 }
@@ -158,9 +161,10 @@
158 161
159 162 return new \WP_Error(
160 163 'edition_failed',
161 164 sprintf(
162 - __( 'Could not write into the %s file.', QUICKWEBP_TEXT_DOMAIN ),
165 + // translators: %s is a placeholder for the file path.
166 + __( 'Could not write into the %s file.', 'quickwebp' ),
163 167 '<code>' . esc_html( $file_path ) . '</code>'
164 168 )
165 169 );
166 170 }
@@ -169,8 +173,9 @@
169 173 * Write contents to the file.
170 174 */
171 175 protected function put_contents( $file, $contents, $mode = false ) {
172 176
177 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen
173 178 $fp = @fopen( $file, 'wb' );
174 179
175 180 if ( ! $fp ) {
176 181 return false;
@@ -179,12 +184,14 @@
179 184 mbstring_binary_safe_encoding();
180 185
181 186 $data_length = strlen( $contents );
182 187
188 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fwrite
183 189 $bytes_written = fwrite( $fp, $contents );
184 190
185 191 reset_mbstring_encoding();
186 192
193 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
187 194 fclose( $fp );
188 195
189 196 if ( $data_length !== $bytes_written ) {
190 197 return false;
@@ -190,10 +197,10 @@
190 197 return false;
191 198 }
192 199
193 200 $chmod_file = fileperms( ABSPATH . 'index.php' ) & 0777 | 0644;
201 + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_chmod
194 202 chmod( $file, $chmod_file );
195 203
196 204 return true;
197 205 }
198 -
199 -}
206 +}