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/Report/ReportService.php +8 -6 6.2.14 → 6.2.15 View file →
@@ -206,16 +206,18 @@
206 206 $startDate = Arr::get($data, 'start_date');
207 207 $endDate = Arr::get($data, 'end_date');
208 208 $formId = Acl::normalizeFormId(Arr::get($data, 'form_id'));
209 209
210 - // Set default date range if not provided
210 + // Default to the last 30 days, measured on the SITE's clock. created_at is
211 + // written by current_time('mysql') and compared here as a raw string, while
212 + // PHP's default timezone is UTC under WordPress — so a bare new \DateTime()
213 + // would close the window at the end of the UTC day and drop everything
214 + // submitted since local midnight on any site east of UTC.
211 215 if (!$startDate || !$endDate) {
212 - $now = new \DateTime();
213 - $endDate = $now->format('Y-m-d 23:59:59');
216 + $today = current_time('Y-m-d');
214 217
215 - $thirtyDaysAgo = new \DateTime();
216 - $thirtyDaysAgo->modify('-30 days');
217 - $startDate = $thirtyDaysAgo->format('Y-m-d 00:00:00');
218 + $endDate = $today . ' 23:59:59';
219 + $startDate = (new \DateTime($today))->modify('-30 days')->format('Y-m-d 00:00:00');
218 220 }
219 221
220 222 return [
221 223 'start_date' => $startDate,