=== 96Astro API: Kundli, Panchang, Horoscope and Matching ===
Contributors: 96astro
Tags: astrology, kundli, panchang, horoscope, jyotish
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Daily panchang, sign horoscopes, kundli and kundli matching for your visitors, calculated by the 96Astro API.

== Description ==

Add Vedic astrology to any WordPress site with four blocks (or shortcodes):

* **Panchang**: today's tithi, nakshatra, yoga, karana, sunrise and sunset, Rahu Kaal and the auspicious periods, for your city.
* **Horoscope**: daily, weekly, monthly or yearly horoscope for any sign, with ratings, lucky number and colour.
* **Kundli**: visitors enter their birth details and see their North, South or East Indian birth chart, Navamsa and planet positions.
* **Kundli matching**: Ashtakoot (36 guna) matching and Manglik check for two people.
* **Western birth chart** (`[astro96_western]`): the natal wheel with the Sun, Moon and rising sign.
* **Numerology** (`[astro96_numerology]`): radical, destiny, name and Kua numbers with friendly numbers and signs.

= Sell personalised reports with WooCommerce =

Turn any product into a personalised **PDF report** or **narrated MP3**: kundli, career, marriage, wealth, health, children,
annual forecast, five-year journey, past-life themes, child personality, Big Three portrait and more.

* Choose the report, PDF or MP3, language, and for MP3 the voice (18), style (12), length, podcast format and music.
* Buyers enter birth details on the product page; they are checked before the item goes in the cart.
* When the order is paid the report is made automatically. A repeated payment hook never makes or charges a second report.
* The finished file is kept in a protected folder and the buyer is emailed a personal download link, also shown in their
  order. A failed report is retried up to three times; then the order gets a note and you get an email. A failed email is
  retried for an hour without making the report again; the order note says whether the buyer was emailed.
* Your brand name, colour, footer and website print on the PDF (Settings → 96Astro API).

Every calculation is done by the [96Astro API](https://96astroapi.com) with the Swiss Ephemeris.

= Your key stays on your server =

Visitors' browsers talk only to your site. Your site calls the API with your key, so the key is never in a page.

= Your credits are protected =

* The same panchang, horoscope or birth details are calculated once and then served from cache.
* Each visitor can submit the kundli and matching forms a limited number of times an hour (you choose how many).

= External service =

This plugin sends the details needed for each calculation (dates, times, places and coordinates, and the place names typed into the forms) to the 96Astro API at api.96astroapi.com. It needs an API key, which you get at [96astroapi.com](https://96astroapi.com/signup). Terms: https://96astroapi.com/legal/terms. Privacy policy: https://96astroapi.com/legal/privacy.

== Installation ==

1. Install and activate the plugin.
2. Create a free account at [96astroapi.com](https://96astroapi.com/signup) and copy an API key (a sandbox key `sk_test_…` is free for testing; switch to a live key `sk_live_…` when you go live).
3. Go to **Settings → 96Astro API**, paste the key and set your default city.
4. Add a **96Astro** block to a page, or a shortcode:
   * `[astro96_panchang]`
   * `[astro96_horoscope sign="leo" period="weekly"]`
   * `[astro96_kundli style="south"]`
   * `[astro96_match]`

== Frequently Asked Questions ==

= What does it cost? =

The plugin is free. Calculations use your 96Astro API credits: see https://96astroapi.com/pricing. A cached answer costs nothing.

= Can I remove the "Calculated by 96Astro API" line? =

Yes: `add_filter( 'astro96_show_credit', '__return_false' );`

= My site is behind Cloudflare or a proxy and every visitor shares one limit =

Give the plugin the visitor's real address with the `astro96_client_ip` filter, for example from the `CF-Connecting-IP` header.

= Are the report files protected on Nginx? =

The files are kept under `wp-content/uploads/astro96-reports/` with random names, and are only served through the signed
order link. On Apache the folder's `.htaccess` denies direct access. Nginx ignores `.htaccess`, so add this to your server
block: `location ^~ /wp-content/uploads/astro96-reports/ { deny all; }`.

== Changelog ==

= 1.2.1 =
* Maintenance release: same features as 1.2.0, packaged as 1.2.1.

= 1.2.0 =
* Each request names your site to the API (WordPress version and the site's address, in the X-Astro-App header), so your 96Astro dashboard shows which websites use your key. Your key is still sent only in the Authorization header.
* Requires an API key from 96astroapi.com as before; no settings change.

= 1.1.1 =
* WooCommerce: a failed buyer email is retried (never by making the report again), and the order says whether it was sent.

= 1.1.0 =
* Western birth chart and numerology shortcodes.
* WooCommerce: sell personalised PDF and MP3 reports, with birth details at checkout, automatic fulfilment, retries, a
  protected download link and PDF branding.

= 1.0.0 =
* First release: panchang, horoscope, kundli and matching blocks and shortcodes.
