Skip to content

Commit 1fb3d45

Browse files
committed
more efficient tmp-dir
1 parent 9aa2f26 commit 1fb3d45

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

admin/class-bread-admin.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,6 @@ function is_root_server_missing()
230230
$url = admin_url('options-general.php?page=class-bread-admin.php');
231231
echo "<p><a href='$url'>Settings</a></p>";
232232
echo '</div>';
233-
} else if (!$this->bread->temp_dir()) {
234-
echo '<div id="message" class="error"><p>' . $this->bread->temp_dir() . ' temporary directory is not writable.</p>';
235-
$url = admin_url('options-general.php?page=class-bread-admin.php');
236-
echo "<p><a href='$url'>Settings</a></p>";
237-
echo '</div>';
238233
}
239234
}
240235
}

includes/class-bread.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ public function bmlt(): Bread_Bmlt
9393
}
9494
public function temp_dir(): string
9595
{
96+
if (empty($this->tmp_dir)) {
97+
$this->tmp_dir = Bread::setup_temp_dir();
98+
}
9699
return $this->tmp_dir;
97100
}
98101
public function getOption($name): mixed
@@ -337,7 +340,6 @@ public function __construct()
337340
$this->version = '2.8.0';
338341
}
339342
$this->plugin_name = 'bread';
340-
$this->tmp_dir = $this->setup_temp_dir();
341343
$this->protocol = (strpos(strtolower(home_url()), "https") !== false ? "https" : "http") . "://";
342344
$this->bread_bmlt = new Bread_Bmlt($this);
343345

0 commit comments

Comments
 (0)