| @@ 49-68 (lines=20) @@ | ||
| 46 | * Returns true if the site has file write access false otherwise. |
|
| 47 | * @return string ( '1' | '0' ) |
|
| 48 | **/ |
|
| 49 | public static function file_system_write_access() { |
|
| 50 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
|
| 51 | require_once( ABSPATH . 'wp-admin/includes/file.php' ); |
|
| 52 | } |
|
| 53 | ||
| 54 | require_once( ABSPATH . 'wp-admin/includes/template.php' ); |
|
| 55 | ||
| 56 | $filesystem_method = get_filesystem_method(); |
|
| 57 | if ( $filesystem_method === 'direct' ) { |
|
| 58 | return 1; |
|
| 59 | } |
|
| 60 | ||
| 61 | ob_start(); |
|
| 62 | $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); |
|
| 63 | ob_end_clean(); |
|
| 64 | if ( $filesystem_credentials_are_stored ) { |
|
| 65 | return 1; |
|
| 66 | } |
|
| 67 | ||
| 68 | return 0; |
|
| 69 | } |
|
| 70 | ||
| 71 | public static function wp_version() { |
|
| @@ 1152-1171 (lines=20) @@ | ||
| 1149 | * Returns true if the site has file write access false otherwise. |
|
| 1150 | * @return string ( '1' | '0' ) |
|
| 1151 | **/ |
|
| 1152 | public static function file_system_write_access() { |
|
| 1153 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
|
| 1154 | require_once( ABSPATH . 'wp-admin/includes/file.php' ); |
|
| 1155 | } |
|
| 1156 | ||
| 1157 | require_once( ABSPATH . 'wp-admin/includes/template.php' ); |
|
| 1158 | ||
| 1159 | $filesystem_method = get_filesystem_method(); |
|
| 1160 | if ( $filesystem_method === 'direct' ) { |
|
| 1161 | return 1; |
|
| 1162 | } |
|
| 1163 | ||
| 1164 | ob_start(); |
|
| 1165 | $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); |
|
| 1166 | ob_end_clean(); |
|
| 1167 | if ( $filesystem_credentials_are_stored ) { |
|
| 1168 | return 1; |
|
| 1169 | } |
|
| 1170 | return 0; |
|
| 1171 | } |
|
| 1172 | ||
| 1173 | /** |
|
| 1174 | * Finds out if a site is using a version control system. |
|