=== BaKhabar Gold Rates ===
Contributors: awaisrashid
Tags: gold rate, gold price, pakistan, gold rates pakistan, 24k gold
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display live Pakistan gold rates (24K, 22K, 21K per tola) on your WordPress site. Verified against SBP by BaKhabar Pakistan.

== Description ==

Show today's verified gold rates on your WordPress site with a clean, lightweight widget. Rates are fetched from BaKhabar Pakistan's verified data pipeline — cross-checked against APGJSA (Sarafa Association) and the State Bank of Pakistan.

**Features:**
* Live 24K, 22K, 21K gold rates per tola
* Light and dark theme options
* Sidebar widget + shortcode support
* Optional attribution credit link (off by default)
* 15-minute smart caching (no API overload)
* Graceful fallback if API is temporarily unavailable
* Responsive design
* Zero configuration required — just activate and use

**Usage:**

As a shortcode in any post or page:
`[bakhabar_gold]`

With options:
`[bakhabar_gold theme="dark" show_22k="yes" show_21k="no" show_credit="yes"]`

As a widget: Go to Appearance → Widgets → add "BaKhabar Gold Rates" to any sidebar.

== Installation ==

1. Download the plugin zip file
2. Go to WordPress Admin → Plugins → Add New → Upload Plugin
3. Upload the zip file and click "Install Now"
4. Activate the plugin
5. Use the shortcode `[bakhabar_gold]` or add the widget from Appearance → Widgets

== Frequently Asked Questions ==

= Where does the data come from? =
Gold rates are fetched from BaKhabar Pakistan (bakhabarpakistan.com), which verifies rates against APGJSA and the State Bank of Pakistan's M2M exchange rate.

= How often does the data update? =
The plugin caches data for 15 minutes. BaKhabar Pakistan updates rates 4 times daily during Sarafa market hours (10AM, 1PM, 4PM, 7PM PKT).

= Does this slow down my site? =
No. The plugin caches API responses for 15 minutes using WordPress transients. Your database is hit once every 15 minutes, not on every page load.

== External Services ==

This plugin connects to the BaKhabar Pakistan API to fetch live gold rates for Pakistan. BaKhabar Pakistan is owned and operated by the plugin author (Muhammad Awais Rashid, ACMA).

= BaKhabar Pakistan Gold Rates API =
* **Service:** BaKhabar Pakistan ([bakhabarpakistan.com](https://bakhabarpakistan.com))
* **Endpoint:** `https://bakhabarpakistan.com/en/finance/gold-rates/api/`
* **Data sent:** No user data is collected or transmitted. The plugin makes a read-only GET request to retrieve current gold rates (24K, 22K, 21K per tola) and the verification status.
* **When:** Each time the widget or shortcode is displayed, if the locally cached data (15-minute cache) has expired. No data is sent on every page load.
* **Terms of Service:** [https://bakhabarpakistan.com/pages/terms/](https://bakhabarpakistan.com/pages/terms/)
* **Privacy Policy:** [https://bakhabarpakistan.com/pages/privacy-policy/](https://bakhabarpakistan.com/pages/privacy-policy/)

== Changelog ==

= 1.0.0 =
* Initial release
* Live gold rates from BaKhabar Pakistan API
* Widget + shortcode support
* Light/dark themes
* Optional credit link (off by default)
* 15-minute smart caching
* Deactivation cleanup
