From Hours to Invoices: Automating Freelancer Management with a Custom WordPress Plugin

Overview / The Challenge

The client required a secure, reliable and easy-to-use system that would:

  • Remind freelancers monthly to submit hours and upload evidence.
  • Allow multiple email addresses (To & CC) for both freelancers and clients, with company admin always CC’d.
  • Send approval requests to clients that link to a simple approval form (optional 1–5 rating).
  • On approval, automatically create an invoice in Xero (no payments processing) including banking details and send it to the client.
  • Provide dashboards for freelancers (past hours per client), and an admin area to manage clients, freelancers and per-client hourly rates. Admin must also be able to submit on behalf of freelancers.
  • Integrate with Gravity Forms for submissions and Newsletter for emails; be installable on the client’s existing WordPress site after sandbox verification.

Why CnEL India was chosen / Why we are the best team for this project

  • Deep WordPress & Plugin Expertise: Proven experience building robust, maintainable custom plugins that follow WordPress coding standards and respect backward compatibility.
  • Forms & Email Integration Experience: Practical knowledge integrating Gravity Forms and common newsletter/email plugins to deliver reliable mail flows (to/cc and admin CC patterns).
  • Xero Integration Know-How: Hands-on experience with Xero APIs for invoice creation, mapping custom metadata (client/freelancer details and banking info) to invoices, and handling webhooks for status updates.
  • Secure Data Design & UX: Thoughtful database schema design for auditability (evidence attachments, approval audit trail), and a simple, friendly UX for freelancers and client approvers (no client login required initially).
  • Sandbox-first Delivery & QA: We recommend and execute a sandbox staging environment to validate the whole flow (emails, approvals, Xero invoices) before deploying to production to avoid disruption.
  • Admin-first Manageability: Admin tools for bulk import/manage clients, freelancers and rates, and the ability to submit on behalf of freelancers to support operations.
  • Clear Handover & Support: Documentation, training for client admins, and optional maintenance/support packages to keep the system running smoothly.

Solution Summary

CnEL India delivered a custom WordPress plugin that implements the full workflow:

  1. Monthly scheduler triggers emails (via Newsletter plugin) to freelancers prompting them to complete a Gravity Form with hours + evidence uploads.
  2. Submissions are stored in plugin tables (hours, evidence, status). Admin and freelancer receive confirmation emails (To & CC support).
  3. Client approval emails are generated and include a unique, secure link to an approval form (no client login required). Client clicks Approve/Reject and optionally provides a 1–5 rating.
  4. On approval, the plugin calls the Xero API to create a draft/invoice populated with client & freelancer details, hourly breakdown, and banking details; the invoice is then emailed to the client from Xero (or sent by the plugin if required).
  5. Freelancers have a dashboard to view submitted hours and status per client. Admin UI allows managing freelancers, clients and hourly rates, and submitting forms on behalf of freelancers.

Key Features Delivered (mapped to requirements)

  • Scheduled Reminders: Cron-based monthly reminders with retry logic for failed deliveries.
  • Gravity Forms Integration: Forms prebuilt for hours submission; file uploads saved to WP media (and referenced in plugin tables).
  • Newsletter Plugin for Emails: Template-driven emails that support multiple To & CC addresses; admin always CC’d.
  • Client Approval Flow: Secure single-click approval link in email → client confirmation form → optional 1–5 rating captured.
  • Xero Invoice Generation: Accurate mapping of hours → line items, client/freelancer metadata, banking details added to invoice notes.
  • Multiple Email Addresses: Support for multiple To and CC for both client and freelancer records.
  • Freelancer Dashboard: Historical hours per client, status (submitted/approved/rejected), and access to uploaded evidence.
  • Admin Tools: Add/import clients, freelancers, set hourly rates per client, and submit entries on freelancer’s behalf.
  • Sandbox Deployment: End-to-end verification in staging environment before final installation on live site.

Database Schema (high-level)

Core custom tables created by the plugin (examples of important fields):

Table Purpose Key Columns (sample)
cnel_freelancers Store freelancer accounts and contact emails id, user_id (WP user), name, emails (json), phone, default_billing_details, created_at
cnel_clients Store client details and contact emails id, name, contact_emails (json), billing_address, bank_details, created_at
cnel_rates Hourly rates by freelancer × client id, freelancer_id, client_id, hourly_rate, currency, effective_from, effective_to
cnel_hours Submitted hours & attached evidence id, freelancer_id, client_id, period_start, period_end, total_hours, attachments (json/media ids), status, admin_submitted_by, created_at, approved_at, rating
cnel_audit Approval audit trail and email logs id, hours_id, event_type, actor, ip_address, notes, created_at

Technical Approach (concise)

  • Plugin Architecture: WP plugin with service classes for Scheduler, Forms integration, Email service adapter (Newsletter), Xero adapter, and Admin UI pages.
  • Security: Signed/expiring approval tokens for client links, nonce validation on forms, sanitisation/escapes on all inputs, capability checks for admin actions.
  • Attachment Handling: Use Gravity Forms file upload → stored in media library; plugin stores references and produces links for admin/freelancer/client review.
  • Xero: OAuth 2.0 integration, idempotent invoice creation (to avoid duplicates), and error-handling with retry & admin alerting.
  • Emails: Template variables for To and CC; admin always auto-CC’d; ability to preview & test emails in sandbox.

UX Highlights

  • Minimal friction for freelancer submissions — one Gravity Form per period, easy upload of proof.
  • Client approval requires just a secure click and a brief confirmation (rating optional) — no account or login required initially.
  • Freelancer dashboard is summarized per client with status badges (Submitted / Approved / Rejected) and quick-download links to evidence.

Admin & Operability

  • CSV import for bulk clients/freelancers and a simple UI to set per-client hourly rates.
  • Admin can impersonate or submit on behalf of freelancers for exceptions or back-filled data.
  • Logging & reporting — exportable CSV of approved hours and invoices for accounting reconciliation.

Testing, Deployment & Handover

  1. Implement and test full flow in a sandbox environment: email delivery, approval link security, Xero invoice creation and PDF/emailing.
  2. Client acceptance testing (UAT) with sample periods and live Xero/Email tests in sandbox.
  3. Install plugin on production WordPress site after UAT sign-off and perform smoke tests.
  4. Provide documentation & a short admin training session and include a 30-day warranty period for bug fixes post-launch.

Business Benefits Delivered

  • Time Savings: Automates manual follow-ups and invoice creation.
  • Reduced Errors: Structured submissions, attachments, and audit trail reduce disputes.
  • Faster Cash Flow: Prompt invoicing and consistent banking details reduce friction for client payments.
  • Operational Control: Admin tools for managing rates, clients and exceptions centralize operations.

Favourable Client Review

“CnEL India delivered exactly what we needed — a secure, reliable plugin that removed months of manual chasing and made invoicing painless. Their team understood our operations, built a clean workflow with Gravity Forms and Xero integration, and guided us through testing and deployment. The freelancer dashboard and admin tools are simple and powerful. Highly recommended.”

— Head of Operations, Client

Final Notes

This solution is designed to be modular and maintainable: adapters for the Newsletter, Gravity Forms and Xero integrations allow future replacement or enhancement without rewriting the core logic. CnEL India recommends starting with a sandbox deployment to verify the end-to-end flow and then proceeding to production installation following client acceptance testing.

Contact: CnEL India — for inquiries about implementing similar workflows and custom WordPress plugin development.

From Hours to Invoices: Automating Freelancer Management with a Custom WordPress Plugin
, , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top

Solverwp- WordPress Theme and Plugin