=== TimeGuard - Freelancer Time Log Pro ===
Contributors: fredawd
Tags: time tracking, time tracker, freelancers, calendar, invoicing
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lightweight time tracker and planner for freelancers: log hours from the admin bar, plan your week in a calendar, export to Excel or CSV.

== Description ==

TimeGuard (formerly Freelancer Time Log Pro) is a lightweight time tracker and planner for freelancers who want to log work fast and keep their week in view, without leaving wp-admin.

**New in 1.2: Planning.** A built-in calendar for notes, appointments, deadlines and time off, right next to your hours.

= Track your time =

* Start / pause / resume timer in the WordPress admin bar
* Draggable floating timer that survives page loads
* Add entries by hand when you forgot to start the timer
* Edit any logged entry afterwards: project, date, duration, tag, billable flag or description
* Client + project assignment, ticket number, tag and description
* Hourly rate per project, billable toggle per entry, automatic earnings

= Plan your week =

* Month calendar: click a day to add a note or appointment, drag across days to block a period such as a holiday
* Optional start and end times; multi-day items run as one bar across the calendar
* Floating, movable agenda panel with everything coming up in the next 30 days
* Your own item types and colours (Settings > Calendar), with a filter per type
* Personal per user: everyone sees and edits only their own planning

= Review and export =

* Status cards for this week / this month / all time: total, billable share, earnings and entries at a glance
* A compact status bar on every screen, so you always know where your week stands
* Project overview with total time, billable share and earnings
* Export to Excel (.xlsx) or CSV: everything, per project or per client
* Delete single entries, a project's logged time, or everything

Suggestions or feature requests? Reach out via https://www.alentejowebdesign.nl/

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via the WordPress plugin screen.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to **TimeGuard > Projects** and set up your clients, projects and hourly rates.
4. Use the Start/Stop button in the admin bar, or **New Entry** on the Entries screen.
5. Open **TimeGuard > Planning** to plan your week. Adjust the calendar types and colours under **Settings > Calendar**.

== Frequently Asked Questions ==

= Where are my time entries and planning stored? =
In your own WordPress database, per user: time entries in `wp_frtlp_time_entries`, calendar items in `wp_frtlp_planning`.

= Does uninstalling delete my time entries? =
No. Uninstalling removes the plugin settings but deliberately leaves the entries and planning tables intact, so billing history and your calendar are never lost by accident.

= Can I export my time entries? =
Yes: all entries, per project, or per client, as Excel (.xlsx) or CSV, including rate and amount columns and a totals row.

= Can other users see my calendar? =
No. Planning is personal: every user sees and edits only their own items, administrators included. The calendar types and colours are shared site-wide and managed by administrators.

= What happens to items when I remove a calendar type? =
They are kept and move to the first type in the list. Renaming or recolouring a type never changes its items.

= I upgraded from 1.0.x. Do I lose anything? =
No. The database, option names and text domain are unchanged. Existing entries get the hourly rate you configure for their project.

== Screenshots ==

1. Entries overview with status cards, rates and earnings
2. Projects overview with billable share per project
3. Admin bar timer and floating timer widget
4. Save-entry modal
5. Planning: month calendar with periods, appointments and the floating agenda panel
6. Settings > Calendar: your own types and colours

== Changelog ==

= 1.2.1 =
* New: the agenda panel on Planning is now a floating window. Drag it anywhere by its bar, collapse it, or hide it with the "Agenda" button; its position is remembered. Double-click the bar to put it back in the corner. The calendar now uses the full width.
* New: Settings has section pills (General and Calendar). Under Calendar you can add, rename, recolour and remove planning types, with a colour picker and quick colours. Items of a removed type move to the first type in the list.
* Improved: text on multi-day bars switches to dark on light colours, so every type colour stays readable.

= 1.2.0 =
* New: Planning. A calendar tab for notes, appointments, deadlines, work blocks and time off. Click a day to add an item, or drag across several days to plan a period such as a holiday. Times are optional. Periods run as one bar across the days they cover.
* New: an "Upcoming" panel next to the calendar lists the next 30 days. Click a day number to see that day's agenda.
* New: filter the calendar by type with the coloured chips; the choice is remembered per browser.
* Planning items are personal: every user sees and edits only their own.

= 1.1.7 =
* New: the Entries screen shows four status cards in the Guard family layout (as in HelpGuard and WarpGuard). Each card has a status pill: timer running or paused, billable ratio, billable entries that still have no rate, and how recently you last logged time.
* New: a one-line status strip on the Projects, Export and Settings tabs repeats those four statuses for this week plus the timer state, and links back to Entries.
* Improved: buttons follow the Guard colour rules: blue for the main action, white for neutral side actions, red for irreversible deletes.

= 1.1.6 =
* New: edit a logged entry. The row menu on the Entries screen now has an "Edit entry" action that opens the entry form prefilled with its project, date, duration, ticket, tag, billable flag and description, so you can correct a mistake without deleting and re-adding it. Earnings, billable share and project totals recalculate from the saved values. Editing follows the same ownership rules as deleting: you can only edit your own entries.

= 1.1.5 =
* New: exports now end with a totals row for time and amount. In Excel these are live SUM formulas, so the totals update if you add or remove rows.

= 1.1.4 =
* Fixed: a project's totals on the Projects screen only counted entries logged after the 1.1.0 update. Older entries used a different label separator ("Client &mdash; Project" instead of "Client - Project"), which split one project into two and hid part of its time and earnings. Totals now cover every entry again, and existing labels are normalised automatically on update.

= 1.1.3 =
* Maintenance release: version bump, no functional changes.

= 1.1.2 =
* New: the save-entry dialog now defaults to the project you used last.
* Fixed: the row action menu on the Entries table is no longer clipped by the card; it opens as an overlay and flips upward near the bottom.
* Changed: the billable-time bar on Projects is now a single green, so a full bar no longer looks like a red warning.
* Added: a settings emblem on the Settings screen header.

= 1.1.1 =
* New: Export is now its own tab where you pick the project or client and the format, and export directly to a formatted Excel (.xlsx) file — hours, rate and amount stay real numbers, so no more CSV column juggling. CSV is still available.
* New: Settings is now its own tab with only the currency and default-rate card; projects stay on the Projects tab.
* Changed: the Guard mascot sits in the sidebar with the "Guard says" note as a separate card below it, matching the daneGuard / HelpGuard layout.
* Fixed: admin notices from other plugins no longer appear inside the Entries card.

= 1.1.0 =
* New: TimeGuard interface for the Entries and Projects screens, with a Guard-style navy sidebar (Tracking and System groups) and metric cards matching the daneGuard / HelpGuard family.
* New: hourly rate per project, billable flag per entry, automatic earnings.
* New: add time entries manually, without using the timer.
* New: tags on entries, week/month/all-time filtering and pagination.
* New: rebuild the project list from your logged entries if it was ever emptied, and apply project rates to entries that do not have one yet.
* Fixed: "Add project" and "Remove row" on the Projects screen did nothing, because the handler was never initialised and the client list was never loaded on that screen.
* Fixed: a failed database write during Save no longer discards the tracked time.
* Fixed: the tracked duration is now calculated server-side only and can no longer be overridden by the browser.
* Fixed: the full site user list is no longer exposed on the Entries screen.
* Fixed: projects whose names differ only in punctuation or casing no longer collapse into one another.
* Fixed: CSS and JavaScript are versioned by plugin version again, so updates are no longer served from browser cache.
* Fixed: invalid project rows now produce a warning instead of disappearing silently.
* Fixed: the database upgrade now runs for whoever opens wp-admin first, instead of only for administrators, so non-admin users can never hit the new screens before the new columns exist.
* Fixed: the plugin survives being executed more than once in the same request, which happens on stacks using OPcache preload or a loader that uses require() instead of require_once(). The class is declared conditionally and the plugin boots exactly once.
* Removed: unused stop-save AJAX endpoint and dead cache helpers.

= 1.0.3 =
* Updated script loading and prefixed plugin identifiers for WordPress.org review compliance.

= 1.0.2 =
* Updated text domain and internationalization loading for WordPress.org compliance.

= 1.0.0 =
* Initial public release.

== Upgrade Notice ==

= 1.2.1 =
Floating, movable agenda panel and your own calendar types with colours (Settings > Calendar). No database changes.

= 1.2.0 =
Adds a Planning calendar. Creates one new database table (wp_frtlp_planning) automatically on update; existing time entries are not touched.

= 1.1.7 =
New status cards and pills on Entries, a status strip on the other tabs and Guard-style buttons. No database changes.

= 1.1.6 =
Adds an "Edit entry" action so you can correct a logged entry instead of deleting and re-adding it. No database changes.

= 1.1.5 =
Adds a totals row (time and amount) to CSV and Excel exports.

= 1.1.4 =
Fixes project totals that were split by an old label separator after the 1.1.0 migration. Runs a one-time label cleanup on update.

= 1.1.3 =
Maintenance release.

= 1.1.2 =
Save dialog remembers your last project, and the Entries row menu is no longer clipped.

= 1.1.1 =
Separate Settings tab, mascot and quote layout, and admin notices moved out of the Entries card.

= 1.1.0 =
Interface overhaul plus rates and earnings. Fixes the broken "Add project" button and prevents time loss on failed saves. Your existing entries and settings are kept.

= 1.0.3 =
WordPress.org review compliance update.
