PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | framework/base/class-component.php +3 -2 5.5.1 → 6.3.0 View file →
@@ -11,8 +11,9 @@
11 11 use ReflectionClass;
12 12 use ReflectionMethod;
13 13 use ReflectionProperty;
14 14 use Calotes\Component\Behavior;
15 +use WP_Filesystem_Base;
15 16
16 17 /**
17 18 * Base class for all components.
18 19 */
@@ -268,9 +269,9 @@
268 269 */
269 270 protected function log( $message, $category = '' ): void {
270 271 global $wp_filesystem;
271 272 // Initialize the WP filesystem, no more using 'file-put-contents' function.
272 - if ( empty( $wp_filesystem ) ) {
273 + if ( ! $wp_filesystem instanceof WP_Filesystem_Base ) {
273 274 require_once ABSPATH . '/wp-admin/includes/file.php';
274 275 WP_Filesystem();
275 276 }
276 277 if ( ! is_string( $message ) || is_array( $message ) || is_object( $message ) ) {
@@ -286,9 +287,9 @@
286 287 */
287 288 $message = '[' . wp_date( 'c' ) . '] ' . $message . PHP_EOL;
288 289
289 290 if ( $this->has_method( 'get_log_path' ) ) {
290 - if ( ! empty( $category ) && 0 === preg_match( '/\.log$/', $category ) ) {
291 + if ( '' !== $category && 0 === preg_match( '/\.log$/', $category ) ) {
291 292 $category .= '.log';
292 293 }
293 294
294 295 $file_path = $this->get_log_path( $category );