ACF Timer & Punch Clock

I have been on the look out for a sensible time-keeping plugin for about a year.

The closest I have found is Dynamic Time by Rhett Ermis. While Dynamic Time has a great time card system, it lacked a simple punch clock. Something that I could use to start tracking time and stop, as well as assigning the time to a task ( via post ID ) and include some notes. I was looking for a user experience close to time trackers provided by FreshBooks or TimeCamp.

Since Dynamic Time was halfway there, I decided to tackle the punch clock myself. I started by creating an Advanced Custom Field which would allow me to create a counter. You can download the ACF Timer field from my GitHub repo.

Next, I worked with Rhett to add some filter’s and hooks so that I could extend the original Dynamic Time plugin without changing any of its original functionality. Specifically, I needed to edit the js file which generated the time card page and the $wpdb queries.

A Simple Punch Clock widget for Dynamic Time
A Simple Punch Clock widget for Dynamic Time

The plugin I developed is dependent on ACF Pro, the ACF Timer field, and Dynamic Time. However, when all four plugins are working together, the user has a very handy WP widget with the ability to record time entries without having to go the time sheet view. Also, it works across multisite, recording which site and post id you are working on when you create the time entry.

Below, you will find a very simplified version of the time punch widget. This one is not dependent on Dynamic Time and simple saves new entries to the database table ‘portfolio_timer’. Feel free to test it out! You can start and stop your time tracking, add a note, and even save the time entry. Once the save is completed via AJAX, the page will reload and your new time entry will show in the table below.


Review The 10 Most Recent Time Entries

Entry ID User Date Start Time End Time # of Hours Note
28 RimohtCS 10-23-2018 03:56:17 03:56:18 0 Test
27 Be Our Guest 10-23-2018 03:55:17 03:56:39 0.02
26 RimohtCS 10-23-2018 03:56:17 03:56:18 0 Test
25 RimohtCS 01-01-1970 0
24 RimohtCS 10-23-2018 03:50:18 03:50:20 0 Testing the timer.
23 Be Our Guest 10-22-2018 12:50:27 12:50:29 0
21 Be Our Guest 10-22-2018 12:48:12 12:48:15 0 Test
20 Be Our Guest 10-22-2018 12:41:50 12:41:59 0 Test
19 Be Our Guest 10-22-2018 12:37:27 12:37:28 0 Test
18 Be Our Guest 10-22-2018 12:37:08 12:37:11 0 Tst