=== Suwarna Gold Rates ===
Contributors: suwarna
Tags: gold rate, gold price, silver rate, widget, shortcode
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show the daily gold and silver rates from Suwarna.com on your website. They update themselves every day.

== Description ==

Suwarna Gold Rates puts a small, tidy rates card on your website:

* 24K and 22K gold per 10 grams, and silver per kg if you want it
* Your city, or the national India rates
* The date the rates are for, shown on the card
* Light, dark, or automatic styling that follows the visitor's device

The plugin arrives set to Mumbai. Change the city anytime under Settings, Suwarna Gold Rates.

Add the card with the widget (Appearance, Widgets) or paste the shortcode `[suwarna_gold_rates]` into any page or post. A shortcode can name its own city, for example `[suwarna_gold_rates city="pune"]`.

The rates come from Suwarna.com and refresh on their own. If the connection ever fails, the card keeps showing the last rates it received rather than breaking. The small line at the bottom of the card credits Suwarna.com and links to the full rate page for the city.

== Installation ==

1. In your WordPress dashboard, go to Plugins, Add New, Upload Plugin.
2. Choose the suwarna-gold-rates.zip file and click Install Now.
3. Click Activate.
4. Go to Settings, Suwarna Gold Rates to pick your city.
5. Add the widget, or paste `[suwarna_gold_rates]` into a page or post.

== Frequently Asked Questions ==

= Do I need to update the rates myself? =

No. The card fetches the day's rates from Suwarna.com on its own.

= When do the rates change during the day? =

IBJA publishes new rates at about 12:30 PM and 6:30 PM IST. The card refreshes itself just after each of those times, so it picks up the new rates within a few minutes. The date printed on the card is always the date of the rates it is showing. If your site uses a page cache plugin, the cached page may hold the previous card a little longer; clearing the page cache once after updating this plugin brings it current immediately.

= Which cities are covered? =

Mumbai, Delhi, Chennai, Kolkata, Bengaluru, Hyderabad, Ahmedabad, Pune and Jaipur, plus the national India rates.

= Can I show a different city in one place? =

Yes. Use the shortcode with a city name, for example `[suwarna_gold_rates city="delhi"]`.

== Changelog ==

= 1.1.3 =
* Fix: the card's short-lived cache of the rates is now checked against the calendar, the same way its backup copy already was. If the cached rates belong to an earlier day, the card asks Suwarna for today's rates before showing them, so rates saved just before a new fixing can no longer stay on the card until the cache runs out. If that fresh attempt cannot get through, the cached rates are still shown, with their date, rather than a broken card.

= 1.1.2 =
* Update: installing or updating the plugin now also clears its stored backup copy of the rates. That backup is now used only after a fresh attempt to reach Suwarna, so an older day's rates cannot quietly survive an update.

= 1.1.1 =
* Update: when this plugin is installed or updated, it now asks supported page-cache plugins (WP Super Cache, W3 Total Cache, WP Rocket and LiteSpeed Cache) to clear their saved pages too. This helps the new rates card appear straight away instead of an older saved page continuing to show. If you use a different page cache, clearing it once after updating may still be needed.

= 1.1.0 =
* Fix: cached rates could linger for hours across an IBJA fixing. The cache now expires just after the 12:30 PM and 6:30 PM IST fixings and is re-checked at least every 30 minutes, so the card rolls to the new rates within minutes.
* Updating the plugin now clears rates cached by the older version, so the fix takes effect on the first page load after the update.

= 1.0.0 =
* First release.
