=== AstroNode Panchang ===
Contributors: astronode
Tags: panchang, hindu calendar, rahu kaal, astrology, muhurta
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Stable tag: 1.0.0

Show today's panchang and Rahu Kaal for any city with a shortcode, powered by the AstroNode API.

== Description ==

AstroNode Panchang adds a small, theme-friendly card with today's Hindu calendar for a place you choose:

* Vara (weekday) and its lord
* Tithi, with paksha and the local time it ends
* Nakshatra, yoga and karana
* Sunrise and sunset
* Times to avoid: Rahu Kaal, Yamaganda and Gulika Kaal

Times are shown in the place's own time zone, using your site's time format.

Use the shortcode in any post, page or Shortcode widget:

`[astronode_panchang lat="19.07" lng="72.88" tz="Asia/Kolkata" label="Mumbai"]`

Or call it from a theme template:

`<?php echo astronode_panchang_html( array( 'lat' => 28.61, 'lng' => 77.21, 'tz' => 'Asia/Kolkata', 'label' => 'Delhi' ) ); ?>`

= External service =

This plugin relies on the AstroNode API (https://www.astronode.dev), a third-party service. When a page with the panchang is viewed and no cached copy exists, your server sends the date, the UTC offset and the latitude and longitude of the configured place to `https://api.astronode.dev/v1/panchang` and `https://api.astronode.dev/v1/muhurta/inauspicious`, authenticated with your API key. No visitor data is sent. Results are cached until local midnight at that place, so each place costs two API calls a day.

You need an AstroNode API key on a plan that includes the muhurta endpoints. See https://www.astronode.dev for plans and terms.

== Installation ==

1. Upload the `astronode-panchang` folder to `/wp-content/plugins/`, or install the zip from Plugins > Add New > Upload Plugin.
2. Activate the plugin.
3. Go to Settings > AstroNode, paste your API key and save. Use "Test connection" to check it.
4. Add the `[astronode_panchang]` shortcode where you want the card.

To point the plugin at a different API host (for example a staging server), add this to `wp-config.php`:

`define( 'ASTRONODE_API_URL', 'https://staging-api.example.com' );`

== Frequently Asked Questions ==

= What do the shortcode attributes mean? =

`lat` and `lng` are the place's latitude and longitude in decimal degrees. `tz` is an IANA time zone name such as `Asia/Kolkata` or `America/New_York` (a fixed offset like `+05:30` also works). `label` is the place name shown on the card. Without attributes the card shows Mumbai.

= Visitors see "Today's panchang is not available right now." =

The API call failed. Administrators see the API's actual error message (for example an invalid key or a plan that does not include an endpoint) in the same spot, with a link to the settings page.

= How do I refresh the data? =

Settings > AstroNode > "Clear cached panchang". Saving a new API key also clears the cache.

= Is the API key exposed? =

No. It is stored as a non-autoloaded option, never printed back into the settings form, and only sent from your server to the AstroNode API.

== Changelog ==

= 1.0.0 =
* First release: shortcode, template function, settings page, daily cache.
