Skip to content

Release v5.4.3#230

Merged
parhumm merged 5 commits intomasterfrom
development
Mar 16, 2026
Merged

Release v5.4.3#230
parhumm merged 5 commits intomasterfrom
development

Conversation

@parhumm
Copy link
Copy Markdown
Contributor

@parhumm parhumm commented Mar 16, 2026

Release v5.4.3

Fixed

  • Fixed fatal error on servers without the PHP calendar extension (PR #229)
  • Added defensive fallback for corrupted start_of_week option in calendar-related reports

Improved

  • Moved day names array to a class constant in DataBuckets for better maintainability

Summary by CodeRabbit

Release 5.4.3

  • Bug Fixes
    • Fixed fatal error occurring on servers without the PHP calendar extension
    • Added defensive handling for corrupted start_of_week option in calendar-related reports

parham tehrani and others added 5 commits March 16, 2026 12:13
Replace jddayofweek() with a pure PHP array-based day name lookup
to avoid dependency on the optional PHP calendar extension. This
fixes dashboard crashes on Synology NAS, Alpine containers, and
minimal PHP builds.

Fixes #228
Add ?? 'Monday' null coalescing fallback to $dayNames[$startOfWeek]
to prevent Undefined array key warning (PHP 8.0+) and
DateMalformedStringException (PHP 8.3+) when start_of_week option
is corrupted to a value outside 0-6 range.

Refs #228
Move inline $dayNames array to private const DAY_NAMES to avoid
re-allocation on every initSeqWeek() call.

Refs #228
…lendar-extension

Fix fatal error on servers without PHP calendar extension
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4cb650d2-ec0c-42ec-820f-26982784d5c1

📥 Commits

Reviewing files that changed from the base of the PR and between c511cdf and 49fee43.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • languages/wp-slimstat.pot
  • readme.txt
  • src/Helpers/DataBuckets.php
  • wp-slimstat.php

📝 Walkthrough

Walkthrough

Version 5.4.3 release fixes a fatal error on servers without the PHP calendar extension by replacing jddayofweek()-based day lookup with an internal constant. Adds defensive fallback for corrupted start_of_week option. Updates all version metadata and changelog files accordingly.

Changes

Cohort / File(s) Summary
Version & Changelog
CHANGELOG.md, readme.txt, wp-slimstat.php
Bumps version from 5.4.2 to 5.4.3 and adds changelog entries documenting fixes for calendar extension fatal error and corrupted start_of_week option.
Translation Metadata
languages/wp-slimstat.pot
Updates POT file metadata (Project-Id-Version and POT-Creation-Date) to reflect 5.4.3 release.
DataBuckets Logic
src/Helpers/DataBuckets.php
Adds DAY_NAMES class constant, casts start_of_week to int, and replaces jddayofweek() call with constant lookup and fallback to Monday for defensive error handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 A rabbit hops through calendars bright,
Where day names now dance in the light,
No extension required, no PHP to fear—
With constants and fallbacks, the path is clear!
Five-point-four-three brings peace and cheer. 🌙

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Release v5.4.3' is a generic version bump label that does not convey the actual technical changes or improvements made in this release (PHP calendar extension fix, defensive fallback handling, and code maintainability improvements). Consider using a more descriptive title that highlights the primary technical change, such as 'Fix fatal error from missing PHP calendar extension in DataBuckets' or 'Remove optional PHP calendar extension dependency from DataBuckets', while still noting this is a release.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch development
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can disable sequence diagrams in the walkthrough.

Disable the reviews.sequence_diagrams setting to disable sequence diagrams in the walkthrough.

@parhumm
Copy link
Copy Markdown
Contributor Author

parhumm commented Mar 16, 2026

Manual QA — ext-calendar simulation

Tested the fix against environments without ext-calendar to verify issue #228 is resolved.

Environments

Environment ext-calendar PHP
Docker php:8.2-alpine Not loaded (genuine) 8.2.30
Local PHP 8.5 (disable_functions=jddayofweek) Simulated absent 8.5.0

Results: 9/9 passed

Test Result
start_of_week=0 (Sunday) PASS — 5 weekly buckets
start_of_week=1 (Monday) PASS — 5 weekly buckets
start_of_week=2 (Tuesday) PASS — 5 weekly buckets
start_of_week=3 (Wednesday) PASS — 5 weekly buckets
start_of_week=4 (Thursday) PASS — 5 weekly buckets
start_of_week=5 (Friday) PASS — 5 weekly buckets
start_of_week=6 (Saturday) PASS — 5 weekly buckets
start_of_week=99 (invalid/corrupted) PASS — graceful fallback to Monday
Source scan for jddayofweek() PASS — no references remain

Method

Isolated DataBuckets::initSeqWeek() with minimal WP stubs (get_option, wpdb), instantiated with WEEK granularity over a 28-day range, and verified bucket generation for all 7 start_of_week values plus an invalid edge case.

Fix confirmed — ext-calendar dependency fully eliminated.

@parhumm
Copy link
Copy Markdown
Contributor Author

parhumm commented Mar 16, 2026

E2E Test Results: Tracking Request Methods

Date: 2026-03-16 | Plugin: wp-slimstat v5.4.3 + wp-slimstat-pro v1.2.1 | Env: Local by Flywheel

✅ All 8 tests passed (2.0m)

Transport Method Tests Status
REST API (rest) 2 ✅ PASS
Admin-AJAX (ajax) 2 ✅ PASS
Ad-Blocker Bypass (adblock_bypass) 2 ✅ PASS
Fallback Chain (REST→AJAX) 1 ✅ PASS
Cross-Method Consistency 1 ✅ PASS

What was verified

  1. REST API — Endpoint returns 200 (not 500), response contains valid tracking ID with checksum, pageview recorded in DB
  2. Admin-AJAX — Tracking request goes through admin-ajax.php with action=slimtrack, pageview recorded in DB
  3. Ad-Blocker Bypass — Tracker uses /request/{hash}/ endpoint pattern, falls back gracefully if rewrite rules unavailable, pageview recorded in DB
  4. Fallback — When REST endpoint is blocked, tracker automatically falls back to AJAX and still records the pageview
  5. Consistency — All methods populate the same core DB columns (id, resource, dt, content_type, visit_id)

🤖 Generated with Claude Code | Spec: tests/e2e/tracking-request-methods.spec.ts

@parhumm parhumm merged commit 4e80bdb into master Mar 16, 2026
1 check passed
This was referenced Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant