=== ApproxIt - Service Estimate Builder ===
Contributors: tmoubray
Tags: estimator, quotes, lead generation, contractor, service business
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Build a fast, branded service estimator your customers can use on your site — and a clean lead dashboard your team works from.

== Description ==

**ApproxIt Lite** is a service-estimator builder for small businesses. Customers pick services and add-ons (or a package), see a real-time running total, and submit their contact info. You manage every lead from a custom dashboard in WordPress admin — no spreadsheets, no third-party SaaS, no monthly fee.

It's built for tradespeople and service providers: HVAC techs, pool servicers, window cleaners, lawn-care crews, painters, cleaners, contractors, and anyone who quotes work by the visit, hour, or project.

= What you can do with Lite =

* **Estimator builder** — drag-and-drop services and add-ons, set fixed or per-unit pricing, choose billing periods (one-time, per-visit, weekly, monthly, quarterly, yearly).
* **Project questions** — multipliers and per-unit / flat-fee surcharges that adjust the estimate based on context (e.g. "How steep is the roof?", "How many filter grids?").
* **Industry templates** — six pre-filled estimators included free: **HVAC, Window Cleaning, Pool Service, Lawn Care & Landscaping, House Cleaning, and Painting**. Load one and customize the services, prices, and add-ons to match your business.
* **Customer-facing form** — clean two-step flow with a live running total. Embed via the **ApproxIt Estimator** Gutenberg block or the `[approxit id="123"]` shortcode.
* **Lead dashboard** — every submission becomes a custom-post-type lead with hot/warm/cold score, status pipeline (new → contacted → quoted → won/lost), notes, and an estimate breakdown.
* **Lead scoring** — deterministic algorithm based on estimate value, contact completeness, and scope. No AI, no external calls.
* **Customer receipt + owner alert emails** — sent via WordPress's `wp_mail()` on submission. Configurable on/off per type. Business phone shown in the customer receipt so they can reach you directly.
* **CSV / JSON export** — one-click export of leads for accounting, CRM import, or backup.
* **Anti-spam guards** — honeypot field, timing-token bot check, IP rate-limit, duplicate-email throttle.
* **Customizable copy** — per-estimator form title and subtitle.

= Designed to grow with you =

When your business needs satellite-map area drawing, AI photo analysis, SMS lead alerts, or signed transactional email delivery, [ApproxIt Pro](https://approxitpro.com) adds them as a companion plugin. **Lite is fully functional on its own** — Pro is optional.

Pro features (sold separately):

* Google Maps polygon area drawing — customers trace driveways, lawns, or roof footprints; square footage auto-fills the per-unit quantity.
* AI photo analysis and address-based property research (powered by Google Gemini, bring-your-own API key).
* Owner SMS alerts and follow-up nudge texts via Twilio.
* SendGrid integration for signed, deliverable transactional email (no SMTP plugin needed).
* Abandoned-estimator detection and follow-up.
* Seven additional industry templates: Roofing, Power Washing, Tree Service, Plumbing, Concrete & Paving, Garage Door, Solar.

== Installation ==

1. Install via **Plugins → Add New** in your WordPress admin and search for "ApproxIt", or upload the `approxit` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu.
3. Open **Estimators → Add New Estimator**. Pick an industry template to start with a full catalog you can customize, or build from scratch.
4. Save (or publish) your estimator. Each estimator has its own shortcode (e.g. `[approxit id="42"]`) shown in the sidebar.
5. To put the estimator on a page, open any page or post, click **(+)** to add a block, search for **"ApproxIt Estimator"**, and pick the estimator you just built. Or paste the shortcode wherever you'd like.
6. Configure your **From Name / From Email / Owner Alert Email / Business Phone** under **Estimators → Settings**.

== Frequently Asked Questions ==

= Does ApproxIt Lite send any data to third-party servers? =

**No.** Lite is fully self-contained. The customer-facing form posts to your own WordPress site via standard WordPress AJAX (`admin-ajax.php`). Lead notifications are sent via `wp_mail()` from your own server. Lite makes zero outbound calls to external services.

If you later install [ApproxIt Pro](https://approxitpro.com), Pro features (Google Maps drawing, AI analysis, SMS, SendGrid email) use third-party APIs that you connect with your own API keys — those services are disclosed in the Pro plugin's own settings.

= Where are leads stored? =

Each submitted lead becomes a private custom post type (`ax_lead`) in your WordPress database. They're never sent off-site. Deleting the plugin via the WordPress admin removes all leads, estimators, options, and meta.

= How do I add the estimator to a page? =

You have two equally good options:

* **Block (recommended):** Edit any page or post, click the **(+)** button, search for **"ApproxIt Estimator"**, and select which estimator to display. Place it anywhere in your layout — it behaves like any other block.
* **Shortcode:** Paste `[approxit id="42"]` (with your own estimator's ID) into any page, post, sidebar widget, or theme template that runs shortcodes.

= Why aren't my estimate emails arriving? =

Email deliverability depends entirely on how your hosting provider relays mail. On most shared hosts and on WP Engine, the default PHP `mail()` transport is unauthenticated and lands in spam (or gets silently dropped) for Gmail, Outlook, and Yahoo recipients.

We strongly recommend installing a free transactional SMTP plugin alongside ApproxIt and connecting it to a service that signs outgoing mail with SPF and DKIM:

* [WP Mail SMTP](https://wordpress.org/plugins/wp-mail-smtp/) — broadest provider support.
* [FluentSMTP](https://wordpress.org/plugins/fluent-smtp/) — fully free, supports SES/SendGrid/Mailgun/SMTP2GO.
* [Post SMTP](https://wordpress.org/plugins/post-smtp/) — OAuth support for Gmail and Outlook accounts.

Whichever you pick, your **From Email** under **Estimators → Settings** must live on a domain you've authenticated with your SMTP provider (e.g. `estimates@yourbusiness.com`, not a Gmail address). Mismatched domains are the #1 reason customer receipts get quarantined.

= How does Lite scoring decide hot / warm / cold? =

Pure rules — no AI:

* **Value (0–30 pts):** highest single-period total on the estimate.
* **Contact completeness:** +20 if phone provided, +15 if address provided.
* **Scope:** +10 for 2+ services selected, +5 if any add-ons selected.
* **Tier:** Hot ≥ 70, Warm ≥ 40, Cold < 40.

You can override any lead's score manually from the leads dashboard.

= Can I customize the form copy? =

Yes. Each estimator has editable Form Title and Form Subtitle fields (shown above the service list on the public form). Leave them blank to use the defaults ("What do you need?" / "Select all the services you're interested in.").

= Does it work with my theme? =

Yes. The public form uses scoped CSS variables (`--ax-accent`, etc.) so it inherits your theme's brand color when configured, and falls back to its own clean defaults otherwise. The form is fully responsive — single-column on mobile, two-column on desktop.

= Can I have more than one estimator on the same site? =

Yes — build as many as you need. Each has its own services, packages, project questions, accent color, and shortcode/block ID. Useful if you have distinct service lines (e.g. one for residential, one for commercial) or run multiple brands under one site.

= Can I export my leads? =

Yes — **Estimators → Leads** has CSV and JSON export buttons. CSV opens cleanly in spreadsheets and most CRMs; JSON preserves the full estimate breakdown for richer imports.

= What happens if I uninstall the plugin? =

Deleting the plugin from the WordPress admin (not just deactivating it) runs the bundled `uninstall.php`, which removes:

* All estimator and lead custom posts and their meta.
* All `ax_*` plugin options (notification recipients, email toggles, business phone, internal flags).
* All `ax_*` transients and user-meta entries.

Deactivating without deleting leaves all your data intact for when you reactivate.

== Screenshots ==

1. The customer-facing estimator — service rows with live running total and a two-step submission flow.
2. The estimator builder — drag-and-drop services with per-service add-ons.
3. The industry template picker — six pre-filled catalogs to start quickly, plus seven more in Pro.
4. The leads dashboard — sortable, filterable table of submissions with score badges and status pipeline.
5. Lead detail — expanded card showing estimate breakdown, customer notes, and contact actions.
6. Settings — From identity, owner alert recipient, business phone, and email automation toggles.

== Changelog ==

= 1.0.0 =
* Initial public release.
* Customer-facing service estimator with live running total.
* Estimator builder — services, add-ons, packages, billing periods.
* Six free industry templates: HVAC, Window Cleaning, Pool Service, Lawn Care, House Cleaning, Painting.
* Project questions: multipliers and flat-fee surcharges.
* Lead dashboard with hot/warm/cold scoring and status pipeline.
* CSV and JSON lead export.
* Customer receipt + owner alert emails via `wp_mail()`, with optional business phone in the receipt.
* Anti-spam: honeypot, timing token, IP rate-limit, duplicate-email throttle.
* Gutenberg block + `[approxit]` shortcode.
* Companion ApproxIt Pro plugin hook surface for add-on features.

== Upgrade Notice ==

= 1.0.0 =
First public release on WordPress.org.
