Content class: Punch Out

Primary responsibility

Punch-in / punch-out button for time tracking. Backed by mam_punchin_handler (includes/helper-classes/); supports geofencing and per-role shift configuration.


Settings

Setting Type Environment Purpose
geofence_required yes-no global If on, punch is rejected when the user is outside the configured location
geofence_lat text global Center latitude
geofence_lon text global Center longitude
geofence_radius_meters number global Allowed radius
roles_allowed multi-select global Which roles can punch in
style_* various per-button

Hooks involved

Hook Type Role
tsl_do_check_in Action Fires on punch-in
tsl_do_points_check_in Action Fires on a points-aware punch-in
tsl_delete_record Action Fires on punch removal

⚠️ These hooks still use the legacy tsl_* prefix despite the Phase 3 sweep — they’re frozen contracts that customer-side plugins subscribe to.


Reads / Writes

  • Option: tsl_mam_punchin_in_and_out_handler — punch session state
  • Options: tsl_mam_activity_* — per-activity tracking

Gotchas

  • Geofence checks happen server-side, not client-side. The mobile client sends its current lat/lon; the server compares against the geofence and accepts/rejects.
  • No clock-skew tolerance. A device with a wildly wrong clock may produce timestamps that don’t match the server’s expected window.
  • *Frozen `tsl_hooks.** Customer-side time-tracking plugins still subscribe totsl_do_check_in`; renaming would break their integrations.

  • Content classes overview

Metadata

Field Value
Article type Screen Reference
Plugin slug mam-main
Applies to plugin version 2.1.11+
Category App Settings Reference
Audience WordPress admin / PHP developer
Class name local_app_punch_out_button (frozen)
Source file includes/content-classes/punch-out-content-class.php
Last verified 2026-05-02
Contents

    Need Support?

    Can’t find the answer you’re looking for? Don’t worry we’re here to help!