=== LeadTractor – CRM, Leads & Contacts ===
Contributors: dkr4software
Tags: crm, leads, contacts, sales pipeline, kanban
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A simple CRM inside WordPress. Track leads on a Kanban board, keep a contact book, schedule follow-ups and see your pipeline value.

== Description ==

**LeadTractor** turns your WordPress dashboard into a lightweight CRM. Track every lead from first contact to closed deal, keep all your contacts in one place, and never miss a follow-up. Everything is stored in your own WordPress database — no external SaaS, no monthly fees.

= Track your leads =

* **Kanban board** — drag-and-drop leads across unlimited pipeline stages. Add, rename and reorder stages right from the board.
* **List view** — sortable, filterable table with bulk actions (by status, stage, tag, owner or overdue follow-up).
* **5 lead statuses** — New, In Progress, Done, Lost, Invalid/Spam.
* **Deal value & priority** — give each lead an expected value and a 0–3 star priority. Each stage shows its total open value.
* **Follow-ups** — set a next follow-up date; overdue leads are highlighted on the board, in the list and on the dashboard widget.
* **Notes & attachments** — keep a history of calls and emails on every lead, with file attachments from the Media Library.
* **Tags** — colour-coded tags to organise leads any way you like.
* **Activity log** — every change (status, stage, value, owner…) is recorded with who did it and when.
* **Fast navigation** — jump between leads with next/previous, global search by title, email or phone.

= Save your contacts =

* **Contact book** — name, email, phone, company, job title, website, address, city and country, with avatars.
* **Contact history** — see every lead linked to a contact and the total value you have won with them.
* **One click to a new deal** — create a new lead for an existing contact straight from their profile.
* **CSV import & export** — for both leads and contacts (exports are protected against spreadsheet formula injection).

= Work as a team =

* **Assign leads** to team members, with optional auto-assignment rules per pipeline stage.
* **Email notifications** — get an email when a new lead arrives, and let team members know when a lead is assigned to them.
* **Role-based access** — choose which WordPress roles can use the CRM.
* **Analytics** — lead trends, conversion rate, open pipeline, won revenue, sources, stages and UTM campaigns.
* **Dashboard widget** — totals, open pipeline value and overdue follow-ups at a glance.

= For developers =

Create leads from your theme or plugin with one function call:

`
if ( function_exists( 'leadtractor_create_lead' ) ) {
    leadtractor_create_lead( array(
        'name'    => 'Jane Doe',
        'email'   => 'jane@example.com',
        'title'   => 'Quote request',
        'message' => 'Please call me back.',
        'value'   => 1500,
        'source'  => 'my-form',
        'tags'    => array( 'Website' ),
    ) );
}
`

Or without a hard dependency: `do_action( 'leadtractor/create_lead', $args );`

Actions: `leadtractor/lead_created`, `leadtractor/lead_updated`, `leadtractor/lead_status_changed`, `leadtractor/lead_stage_changed`, `leadtractor/lead_assigned`, `leadtractor/before_delete_lead`, `leadtractor/contact_created`, `leadtractor/contact_updated`, `leadtractor/before_delete_contact`, `leadtractor/daily_maintenance`.

Filters: `leadtractor/pre_create_lead` (return false to reject a lead, e.g. for spam), `leadtractor/notification_email`, `leadtractor/format_money`, `leadtractor/trust_proxy_headers`.

= LeadTractor Pro =

LeadTractor is complete on its own. An optional, separate commercial plugin — [LeadTractor Pro](https://leadtractor.com) — adds automatic lead capture from form plugins (WPForms, Gravity Forms, Contact Form 7, SureForms), WooCommerce order tracking, user-registration sync, a REST API and webhooks. It is not required to use anything described on this page.

== Installation ==

1. Install LeadTractor from **Plugins → Add New**, or upload the `leadtractor` folder to `/wp-content/plugins/`.
2. Activate the plugin.
3. Open **LeadTractor** in the admin menu — four starter stages (New, Qualified, Proposition, Won) are created for you.
4. Optional: visit **LeadTractor → Settings** to set your currency, notifications and which roles can access the CRM.

== Frequently Asked Questions ==

= Where is my data stored? =

In your own WordPress database, in tables prefixed with `leadtractor_`. Nothing is sent to us.

= Does it capture form submissions automatically? =

Not by itself. You can add leads manually, import them from CSV, or create them from code with `leadtractor_create_lead()`. Automatic capture from form plugins and WooCommerce is available in the separate LeadTractor Pro plugin.

= What happens to my data if I delete the plugin? =

By default, nothing — your leads and contacts stay in the database so you can reinstall later. If you want everything removed, enable **Settings → Privacy & Data → Delete All Data on Uninstall** before deleting the plugin.

= Can I use it with LeadTractor Pro? =

Yes. Both use the same data. If LeadTractor Pro is active, this plugin steps aside automatically and you can deactivate it.

= Is there a limit on leads or contacts? =

No. Unlimited leads, contacts, stages, tags and notes.

== External services ==

LeadTractor does not contact any external service by default.

**ipapi.co (optional IP geolocation)** — Only if you turn on **Settings → Privacy & Data → IP Geolocation**, the IP address of a visitor who submits a lead through a capture integration is sent to ipapi.co to look up their country and city. The result is cached for a week. No other data is sent. [Terms of service](https://ipapi.co/terms/) · [Privacy policy](https://ipapi.co/privacy/).

**Avatars** — Contact pictures use WordPress's built-in avatar function (`get_avatar_url()`), so they follow your site's **Settings → Discussion → Avatars** configuration (by default, Gravatar.com).

== Third-party libraries ==

* [Chart.js](https://www.chartjs.org/) 4.4.7 — MIT License — bundled in `assets/vendor/` for the Analytics screen. Source: https://github.com/chartjs/Chart.js

== Screenshots ==

1. Kanban board with deal values, priorities and follow-up dates.
2. Lead detail — deal info, contact, notes, tags and activity.
3. Contact profile with linked leads and won value.
4. Analytics dashboard.
5. Settings.

== Changelog ==

= 1.1.0 =
* New: deal value, priority stars and follow-up dates on every lead, with stage totals on the Kanban board.
* New: overdue follow-up highlighting and filter.
* New: contacts now have job title, website, address, country and a "won value" total.
* New: create a lead directly from a contact profile.
* New: "new lead" and "lead assigned to you" email notifications now actually send.
* New: automatic clean-up of old spam leads (daily).
* New: `leadtractor_create_lead()` developer function and lifecycle hooks.
* New: open pipeline, won revenue and overdue follow-ups in Analytics.
* Improved: CSV import handles quoted/multi-line cells and UTF-8 BOM; exports are protected against formula injection.
* Improved: Chart.js is bundled locally instead of loaded from a CDN.
* Improved: data is kept on uninstall unless you opt in to deleting it.
* Fixed: "Leads per page" setting is now respected in the list view.
* Fixed: lead owner can now be changed from the lead screen.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
Deal values, follow-up dates and richer contacts on every lead.
