| @@ -52,9 +52,9 @@ | ||
| 52 | 52 | * @return array |
| 53 | 53 | */ |
| 54 | 54 | public function getCoreChecksMessage() |
| 55 | 55 | { |
| 56 | - $messages = []; | |
| 56 | + $messages = array(); | |
| 57 | 57 | |
| 58 | 58 | //TODO: Return VCV_REQUIRED_PHP_VERSION after few releases |
| 59 | 59 | if (!self::checkVersion(7.4, PHP_VERSION)) { |
| 60 | 60 | $messages[] = sprintf('PHP version %s or greater is required', 7.4); |
| @@ -72,8 +72,11 @@ | ||
| 72 | 72 | } |
| 73 | 73 | if (!function_exists('zlib_decode')) { |
| 74 | 74 | $messages[] = 'The zip extension must be loaded zlib_decode() is not defined'; |
| 75 | 75 | } |
| 76 | + if (!$this->checkFileSystemStatus()) { | |
| 77 | + $messages[] = 'Wordpress file system should be enabled, try to define FS_METHOD constant in wp-config.php or check your server filesystem configurations'; | |
| 78 | + } | |
| 76 | 79 | |
| 77 | 80 | return $messages; |
| 78 | 81 | } |
| 79 | 82 | |
| @@ -104,6 +107,27 @@ | ||
| 104 | 107 | return false; |
| 105 | 108 | } |
| 106 | 109 | |
| 107 | 110 | return true; |
| 111 | + } | |
| 112 | + | |
| 113 | + /** | |
| 114 | + * Get filesystem status. | |
| 115 | + * | |
| 116 | + * @return false | |
| 117 | + */ | |
| 118 | + public function checkFileSystemStatus() | |
| 119 | + { | |
| 120 | + // @codingStandardsIgnoreLine | |
| 121 | + global $wp_filesystem; | |
| 122 | + | |
| 123 | + $status = true; | |
| 124 | + // @codingStandardsIgnoreLine | |
| 125 | + if (!$wp_filesystem || !is_object($wp_filesystem)) { | |
| 126 | + require_once(ABSPATH . '/wp-admin/includes/file.php'); | |
| 127 | + $status = WP_Filesystem(false, false, true); | |
| 128 | + } | |
| 129 | + | |
| 130 | + // @codingStandardsIgnoreLine | |
| 131 | + return $status ? $wp_filesystem : false; | |
| 108 | 132 | } |
| 109 | 133 | } |