-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Problem Description
The refresh button (circular arrows icon) in the Access Log box header triggers an AJAX data reload, but the countdown timer is not reset afterward. This makes the refresh appear completely non-functional — the user sees a flash animation but no visible confirmation that data was refreshed. Combined with unchanged data (when no new pageviews occurred), the button feels "fake."
Impact
Users lose trust in the manual refresh feature and must wait for the full auto-refresh cycle (up to 60 seconds) even after clicking refresh. This creates a poor UX experience on the Access Log page (slimview1).
Steps to Reproduce
- Navigate to Slimstat → Access Log (slimview1)
- Wait for the countdown timer to reach ~30 seconds remaining
- Click the refresh button (circular arrows icon) in the Access Log box header
- Observe the content flash (fadeOut/fadeIn animation plays)
- Check the countdown timer
Expected Behavior
- Data reloads via AJAX ✓ (this part works)
- Countdown timer resets to indicate a fresh refresh cycle just completed ✗ (broken)
Actual Behavior
- The fadeOut/fadeIn animation plays, confirming the AJAX call succeeds
- The countdown timer continues unchanged from where it was — no reset
- If no new pageviews occurred since last load, data looks identical
- Combined effect: the refresh appears completely non-functional
- The auto-refresh at the next minute boundary (
:00) works correctly
Root Cause Analysis
-
Dead code at
admin/assets/js/admin.js:1449: After a successful AJAX refresh ofslim_p7_02, the code setsSlimStatAdmin._refresh_timer = SlimStatAdminParams.refresh_interval— but this property is never read anywhere in the codebase. It's a vestige of old logic that was never connected to the new clock-synced countdown. -
Clock-locked countdown at
admin/assets/js/admin.js:1464-1479: Theslimstat_sync_and_countdown()function always calculatesremaining = (60 - currentSeconds) % 60, which is purely wall-clock based. There is no mechanism to account for a manual refresh having just occurred. -
Minor:
clearTimeoutonsetIntervalhandle at line 1396: UsesclearTimeout()to clear a handle created withsetInterval()(lines 1550/1567). Works in browsers due to shared ID pool, but should useclearInterval()for correctness.
Suggested Fix
After a manual refresh completes successfully, either:
- Briefly show "0:00" or "Just refreshed" in the timer, then resume the clock-synced countdown
- Or dispatch
slimstat:minute_pulseto force a full refresh cycle reset - Remove the dead
_refresh_timerproperty assignment
Code References
| File | Lines | Description |
|---|---|---|
admin/assets/js/admin.js |
437-460 | Click handler for .refresh buttons — triggers refresh_report() |
admin/assets/js/admin.js |
1387-1458 | refresh_report() — AJAX logic that fetches fresh data (works correctly) |
admin/assets/js/admin.js |
1449 | Dead code: _refresh_timer set but never read anywhere |
admin/assets/js/admin.js |
1461-1570 | access_log_count_down() — clock-synced timer, ignores manual refresh |
admin/assets/js/admin.js |
1396 | clearTimeout() used on a setInterval() handle |
admin/view/wp-slimstat-reports.php |
992 | Header refresh button rendering with noslimstat refresh classes |
admin/view/wp-slimstat-reports.php |
1057-1058 | Countdown timer <i class="refresh-timer"> rendering in pagination |
Environment
| Field | Value |
|---|---|
| Tech Stack | WordPress / PHP |
| WP Slimstat | 5.4.1 |
| OS | Darwin 25.1.0 arm64 |
| Branch | development |
Additional Context
The auto-refresh (triggered by slimstat:minute_pulse at every minute boundary) works correctly and uses the same refresh_report() function. The issue is purely a UX feedback gap — the manual refresh does reload data, but provides no visual confirmation to the user.
Reported via: qa-issue-report skill (jaan.to plugin)