PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.15
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.15
6.2.15 6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 All 197 releases
← All changes | app/Services/Scheduler/Scheduler.php +9 -3 6.2.3 → 6.2.15 View file →
@@ -229,17 +229,23 @@
229 229 // delete 60 days old scheduled_actions data
230 230 \FluentForm\App\Models\Scheduler::where('created_at', '<', $deleteTo)
231 231 ->delete();
232 232
233 - // Clean temp uploads older than 2 days
233 + // Clean temp uploads. Default threshold is 2 days. Honors the
234 + // fluentform/temp_file_delete_time filter so multi-step and
235 + // save-and-resume users can extend the window — same filter
236 + // Pro's Uploader::removeOldTempFiles() already respects. Without
237 + // this, the Scheduler cleanup would wipe temp files at 2 days
238 + // regardless of the filter, breaking multi-step uploads.
234 239 if (defined('FLUENTFORM_UPLOAD_DIR')) {
235 240 $tempDir = wp_upload_dir()['basedir'] . FLUENTFORM_UPLOAD_DIR . '/temp/';
236 241 if (is_dir($tempDir)) {
237 242 $files = glob($tempDir . '*');
238 243 if (!empty($files)) {
239 - $twoDaysAgo = time() - 172800;
244 + $maxFileAge = apply_filters('fluentform/temp_file_delete_time', 172800);
245 + $cutoff = time() - $maxFileAge;
240 246 foreach ($files as $file) {
241 - if (is_file($file) && basename($file) !== 'index.php' && filemtime($file) < $twoDaysAgo) {
247 + if (is_file($file) && basename($file) !== 'index.php' && filemtime($file) < $cutoff) {
242 248 wp_delete_file($file);
243 249 }
244 250 }
245 251 }