| @@ -9,16 +9,16 @@ | ||
| 9 | 9 | public $file_name; |
| 10 | 10 | public $error_message; |
| 11 | 11 | public $uploads; |
| 12 | 12 | private $new_file_path; |
| 13 | - public $chmod_dir = 0755; | |
| 14 | - public $chmod_file = 0644; | |
| 13 | + public $chmod_dir = 0755; | |
| 14 | + public $chmod_file = 0644; | |
| 15 | 15 | private $has_permission = false; |
| 16 | 16 | |
| 17 | 17 | public function __construct( $atts ) { |
| 18 | - $this->folder_name = $atts['folder_name'] ?? ''; | |
| 18 | + $this->folder_name = isset( $atts['folder_name'] ) ? $atts['folder_name'] : ''; | |
| 19 | 19 | $this->file_name = $atts['file_name']; |
| 20 | - $this->error_message = $atts['error_message'] ?? ''; | |
| 20 | + $this->error_message = isset( $atts['error_message'] ) ? $atts['error_message'] : ''; | |
| 21 | 21 | $this->uploads = wp_upload_dir(); |
| 22 | 22 | $this->set_new_file_path( $atts ); |
| 23 | 23 | $this->chmod_dir = defined( 'FS_CHMOD_DIR' ) ? FS_CHMOD_DIR : ( fileperms( ABSPATH ) & 0777 | 0755 ); |
| 24 | 24 | $this->chmod_file = defined( 'FS_CHMOD_FILE' ) ? FS_CHMOD_FILE : ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ); |
| @@ -165,9 +165,9 @@ | ||
| 165 | 165 | $needed_dirs = array(); |
| 166 | 166 | |
| 167 | 167 | $next_dir = ''; |
| 168 | 168 | foreach ( $dir_names as $dir ) { |
| 169 | - $next_dir .= '/' . $dir; | |
| 169 | + $next_dir .= '/' . $dir; | |
| 170 | 170 | $needed_dirs[] = $this->uploads['basedir'] . $next_dir; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | return $needed_dirs; |
| @@ -174,9 +174,9 @@ | ||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | private function get_creds() { |
| 177 | 177 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
| 178 | - include_once ABSPATH . 'wp-admin/includes/file.php'; | |
| 178 | + include_once( ABSPATH . 'wp-admin/includes/file.php' ); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $access_type = get_filesystem_method(); |
| 182 | 182 | if ( $access_type === 'direct' ) { |