| @@ -11,8 +11,9 @@ | ||
| 11 | 11 | use SplFileObject; |
| 12 | 12 | use Calotes\Base\Component; |
| 13 | 13 | use Calotes\Helper\Array_Cache; |
| 14 | 14 | use WP_Defender\Model\Setting\Security_Tweaks; |
| 15 | +use WP_Filesystem_Base; | |
| 15 | 16 | |
| 16 | 17 | /** |
| 17 | 18 | * Handles security tweaks operations such as retrieving issues, ignored, and fixed tweaks. |
| 18 | 19 | */ |
| @@ -122,9 +123,9 @@ | ||
| 122 | 123 | */ |
| 123 | 124 | public function advanced_check_file() { |
| 124 | 125 | global $wp_filesystem; |
| 125 | 126 | // Initialize the WP filesystem, no more using 'file-put-contents' function. |
| 126 | - if ( empty( $wp_filesystem ) ) { | |
| 127 | + if ( ! $wp_filesystem instanceof WP_Filesystem_Base ) { | |
| 127 | 128 | require_once ABSPATH . '/wp-admin/includes/file.php'; |
| 128 | 129 | WP_Filesystem(); |
| 129 | 130 | } |
| 130 | 131 | $path_to_wp_config = defender_wp_config_path(); |