Skip to content

Commit c1e0e67

Browse files
authored
Merge pull request #11 from circuscode/review-issue-filelocations
Review issue filelocations
2 parents 6f67f3e + 6bf76ea commit c1e0e67

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

tootpress_healthy.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,22 @@ function tootpress_healthy_check() {
9595
$output.='<br/>';
9696

9797
// Check: Are TootPress Folders in WordPress Uploads existing and writable?
98-
if ( ! file_exists( tootpress_get_apidata_directory() ) ) {
99-
$output.='<span class="tootpress-healtycheck-error">&nbsp;Error:&nbsp;</span> Directory /wp-content/uploads/tootpress-mastodonapidata not found.';
100-
} elseif (is_writable(tootpress_get_apidata_directory())) {
101-
$output.='Directory /wp-content/uploads/tootpress-mastodonapidata exists and is writable.';
98+
$apidata_dir_path=tootpress_get_apidata_directory();
99+
if ( ! file_exists( $apidata_dir_path ) ) {
100+
$output.='<span class="tootpress-healtycheck-error">&nbsp;Error:&nbsp;</span> Directory '.esc_html($apidata_dir_path).' not found.';
101+
} elseif (is_writable($apidata_dir_path)) {
102+
$output.='Directory '.esc_html($apidata_dir_path).' exists and is writable.';
102103
} else {
103-
$output.='<span class="tootpress-healtycheck-error">&nbsp;Error:&nbsp;</span> Directory /wp-content/uploads/tootpress-mastodonapidata is not writable.';
104+
$output.='<span class="tootpress-healtycheck-error">&nbsp;Error:&nbsp;</span> Directory '.esc_html($apidata_dir_path).' is not writable.';
104105
}
105106
$output.='<br/>';
106-
if ( ! file_exists( tootpress_get_path_image_directory() ) ) {
107-
$output.='<span class="tootpress-healtycheck-error">&nbsp;Error:&nbsp;</span> Directory /wp-content/uploads/tootpress-images not found.';
108-
} elseif (is_writable(tootpress_get_path_image_directory())) {
109-
$output.='Directory /wp-content/uploads/ tootpress-images exists and is writable.';
107+
$image_dir_path=tootpress_get_path_image_directory();
108+
if ( ! file_exists( $image_dir_path ) ) {
109+
$output.='<span class="tootpress-healtycheck-error">&nbsp;Error:&nbsp;</span> Directory '.esc_html($image_dir_path).' not found.';
110+
} elseif (is_writable($image_dir_path)) {
111+
$output.='Directory '.esc_html($image_dir_path).' exists and is writable.';
110112
} else {
111-
$output.='<span class="tootpress-healtycheck-error">&nbsp;Error:&nbsp;</span> Directory /wp-content/uploads/tootpress-images is not writable.';
113+
$output.='<span class="tootpress-healtycheck-error">&nbsp;Error:&nbsp;</span> Directory '.esc_html($image_dir_path).' is not writable.';
112114
}
113115
$output.='<br/>';
114116

0 commit comments

Comments
 (0)