=== Hayyat Apps Solar Lead Calculator ===
Contributors: hayyatapps
Author: hayyatapps
Author URI: https://hayyatapps.com
Plugin URI: https://hayyatapps.com/plugins/hayyat-apps-solar-lead-calculator
Tags: solar, calculator, lead generation, estimate, savings
Requires at least: 5.6
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Capture solar leads on autopilot with an instant, Google-Solar-powered system size & savings estimator built for solar installers.

== Description ==

**Turn website visitors into qualified solar leads.** Hayyat Apps Solar Lead Calculator adds a beautiful, multi-step solar estimator to any page. Visitors enter their address and energy usage; the tool analyzes their roof with Google's Solar API and instantly shows a personalized recommendation — recommended system size, peak sun hours, annual production, roof suitability and a 30-year savings projection — capturing their name, email and phone as an **encrypted lead** along the way.

Built for solar companies, installers and lead-gen agencies who want more booked consultations without paying per lead.

Add it anywhere with one shortcode:

`[hayyat-solar-calc]`

= Two result formats — you choose =

Not every solar business wants to show pricing up front. This plugin ships with **two results templates**, switchable in one click:

1. **Feasibility only** — shows the recommended system size, peak sun hours, annual production and roof suitability, with **no pricing** — perfect if you'd rather have prospects contact you for a quote.
2. **Size + savings** — everything above **plus** the full financial story: estimated cost, federal tax credit, cash vs. financing, ROI/payback and an interactive 30-year "cost of energy over time" chart.

= Why installers love it =

* **More leads, less friction** — a guided, mobile-friendly wizard that feels effortless and converts.
* **Real roof data** — Google Solar API sun-hour analysis, with a safe fallback when satellite data isn't available.
* **Address autocomplete** — fast Google Places search, proxied so your keys never appear in your page source.
* **Encrypted leads** — every lead's email & phone are stored AES-256 encrypted at rest.
* **Your leads, your data** — browse leads in the dashboard, see every input and estimate, and export to CSV.
* **Fully brandable** — customize colors, fonts, layout, every label, error messages and even the image on each step.
* **Show only what you want** — hide or require any input (address, usage, rate, shading, battery, contact fields).
* **Tune the numbers** — edit cost per watt, tax credit, finance rate/term, utility rates and escalation to match your market.
* **Theme-safe CSS** — fully scoped so it never clashes with Astra, Divi, Elementor or any theme.
* **CRM ready** — request a done-for-you CRM integration right from the dashboard.

= Privacy & security first =

The plugin holds **no Google API keys** in its code. All Google Solar/Places work is proxied server-to-server, so keys are never exposed in the browser. Add **your own** Google Solar & Places keys on the API Settings page (stored encrypted) to run entirely on your own account with no daily limit — the built-in Setup Guide walks you through it, or email support@hayyatapps.com and we'll set it up for you.

= Free vs. Pro =

The Free plan includes the full calculator, encrypted lead capture (first 5 leads fully visible), currency selection and the result-template choice. Pro unlocks colors/fonts/layout, custom step images, editable labels & error messages, show/hide & required controls for every input, editable savings assumptions, full lead visibility, CSV export, and removes the "Powered by" link. 

== Installation ==

1. Upload the `hayyat-apps-solar-lead-calculator` folder to `/wp-content/plugins/`, or install through the WordPress Plugins screen.
2. Activate the plugin through the **Plugins** screen.
3. (Recommended) Go to **Solar Calculator → API Settings** and add your Google Solar & Places API keys. See the built-in **Setup Guide**, or email support@hayyatapps.com for help.
4. Open **Solar Calculator → Settings** to pick your result format, colors, labels, inputs and assumptions.
5. Add the `[hayyat-solar-calc]` shortcode to any page or post.
6. Watch your leads roll in under **Solar Calculator → Leads**.

== Frequently Asked Questions ==

= Do I need my own Google API keys? =

You can try the calculator immediately using our shared keys, limited to 10 address and 10 solar lookups per day. For unlimited use, add your own free Google Solar & Places keys on the API Settings page — the built-in Setup Guide walks you through it.

= Can I hide the pricing/savings? =

Yes. Set the result template to **Feasibility only** and visitors see the recommended system size, sun hours, production and suitability — but no pricing — so they contact you for a quote.

= Are my visitors' details safe? =

Yes. Email and phone are AES-256 encrypted at rest and only decrypted for the admin Leads screen. Your API keys are used server-side only and never exposed in your page source.

= Can I choose which questions the calculator asks? =

Yes. On the **Inputs** tab you can show/hide and require each field — address, energy usage, electricity rate, shading, battery and the contact fields.

= How accurate are the estimates? =

They use Google's Solar API where available and a configurable sizing/savings model otherwise. They're designed to set expectations and generate leads, not replace a professional assessment. Every financial assumption is adjustable (Pro).

= Does it work with caching plugins? =

Yes. All Google/calculation work runs via WordPress AJAX, so it works on cached pages.

== Screenshots ==

1. Step 1 — property type and address, with instant Google address autocomplete.
2. Step 2 — energy usage, your electricity rate and roof shading.
3. Step 3 — contact capture with a live "your roof fits ~X kW" teaser.
4. Two result formats — (1) recommended system size only, or (2) system size + full savings.
5. The "size + savings" results in detail — cost, tax credit, ROI, cash vs. financing and the 30-year chart.
6. Admin dashboard — plugin main page.
7. Admin — Leads dashboard with every input, estimate and CSV export.
8. Admin — General settings tab (result format, title, location & data).
9. Admin — Colors settings tab.
10. Admin — Savings settings tab (cost per watt, tax credit, finance rate and more).

== Changelog ==

= 1.0.0 =
* Initial release.
* Multi-step solar feasibility & savings calculator.
* Two result formats: feasibility only, or size + full savings.
* Google Solar API roof analysis (proxied) with sun-hours fallback.
* Google Places address autocomplete (proxied — no keys in the browser).
* Encrypted lead capture with first-5 free masking, result & admin emails, CSV export.
* Show/hide & required controls for every input; editable labels, error messages & step images.
* Editable savings assumptions; color, font & layout customization.
* 7-day Pro trial; 
* CRM Integration request and More Customizations pages.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
