=== MRN Gold & Currency Pricing for WooCommerce ===
Contributors: mrnwp
Tags: gold price, exchange rates, dynamic pricing, woocommerce, iran
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Requires Plugins: woocommerce
Stable tag: 1.4.1
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

نمایش قیمت طلا و سکه، نرخ ارز و دلار و تغییر خودکار قیمت محصولات ووکامرس بر اساس نرخ انتخابی، با پنل و تابلوی فارسی.

== Description ==

MRN Gold & Currency Pricing برای نمایش نرخ طلا، سکه، ارز و دلار و قیمت‌گذاری خودکار محصولات در فروشگاه‌های ایرانی ساخته شده است. نرخ‌ها در دیتابیس سایت ذخیره می‌شوند و قیمت محصول با نرخ انتخابی، مقدار یا وزن، ضریب، درصد، مبلغ ثابت و گرد کردن محاسبه می‌شود. رابط مدیریت فارسی و راست‌به‌چپ است.

دریافت نرخ از منابع فعال به‌صورت زمان‌بندی‌شده یا به درخواست مدیر انجام می‌شود. نمایش سایت و محاسبه قیمت از نرخ محلی استفاده می‌کند. نرخ دستی به سرویس خارجی نیاز ندارد و اتصال‌های بیرونی در نصب تازه خاموش هستند. محصولات ساده و متغیر، ثبت مبنای قیمت سبد و سفارش و تابلوهای کارت، جدول و نوار پشتیبانی می‌شوند.

ارائه نرخ لحظه‌ای به منبع، اشتراک، فاصله دریافت و اجرای WP-Cron وابسته است. ثبت API یا مشاهده عمومی یک صفحه، به‌تنهایی مجوز بازنشر داده نیست؛ شرایط منبع را پیش از فعال‌سازی بررسی کنید.

== راهنمای فارسی ==

[صفحه افزونه](https://mrnwp.ir/mrnnerkh) | [MRNWP](https://mrnwp.ir) | [کد و گزارش مشکل](https://github.com/mehran-mrn/wp-price-engine)

= امکانات =

* پنل فارسی راست‌به‌چپ، مدیریت دارایی‌ها و تاریخچه نرخ.
* نرخ دستی، منابع API، JSON سفارشی و استخراج نرخ از منابع HTML منتخب.
* دریافت زمان‌بندی‌شده و دستی توسط مدیر؛ نمایش و محاسبه از دادهٔ محلی.
* قیمت محصولات ساده و متغیر، اجرت درصدی و ثابت، ضریب و گرد کردن.
* تبدیل ریال و تومان و تبدیل ارز با جفت‌نرخ‌های موجود روی سایت.
* قفل قیمت سبد و ذخیرهٔ مبنای نرخ در سفارش.
* نمای کارت، جدول و نوار، شورت‌کد و بلوک Gutenberg.
* حفظ آخرین نرخ معتبر هنگام خطای منبع و تنظیم رفتار نرخ قدیمی.

منابع بیرونی در نصب تازه خاموش هستند. مدیر باید هر منبع مورد نیاز را از بخش «منابع داده» فعال و تنظیم کند. نرخ دستی به سرویس بیرونی نیاز ندارد. محدودیت، هزینه، مجوز نمایش داده و نیاز به کلید API مربوط به سرویس انتخابی است؛ امکانات محلی افزونه قفل لایسنس ندارند.

= سازنده و مجوز =

توسعه‌دهنده: [Mehran Marandi](https://mehranmarandi.ir). کد و تصاویر همراه افزونه تحت GPLv3 or later عرضه می‌شوند. اطلاعات مرجع اتصال‌ها در NOTICE.txt آمده است. کد PHP، JavaScript و CSS قابل خواندن است و مرحلهٔ build لازم ندارد.

== Installation ==

= ارتقا از نسخهٔ پیش از انتشار =

ابتدا نسخهٔ قبلی با پوشهٔ mrn-price-engine یا mrn-nerkh را غیرفعال و سپس نسخهٔ جدید با پوشهٔ mrn-gold-currency-pricing را فعال کنید. جدول‌ها، تنظیمات، نرخ‌ها، تاریخچه و فرمول محصولات حفظ می‌شوند. نسخهٔ قبلی را با گزینهٔ حذف داده uninstall نکنید.

نام شورت‌کدهای قبلی mrn_price_board و mrn_rate را در صفحات به mrnpe_price_board و mrnpe_rate تغییر دهید. نام بلوک ذخیره‌شده از mrn-price-engine/price-board به mrnpe/price-board و مسیر REST از mrn-price-engine/v1 به mrnpe/v1 تغییر کرده است. اتصال‌های PHP باید از namespace برابر MRNPE\Price_Engine و تابع mrnpe_plugin() استفاده کنند.


1. ووکامرس را نصب و فعال کنید.
2. ZIP را از «افزونه‌ها ← افزودن ← بارگذاری افزونه» نصب کنید.
3. MRN Gold & Currency Pricing را فعال و بخش «نرخ MRN» را باز کنید.
4. نرخ دستی تعریف یا یک منبع را پس از بررسی شرایط استفاده فعال کنید.
5. در ویرایش محصول، تب «قیمت‌گذاری پویا» را تنظیم کنید.
6. برای نمایش از بلوک «تابلوی نرخ MRN» یا `[mrnpe_price_board]` استفاده کنید.


== External services ==

Requests occur only during scheduled refreshes or an administrator-triggered refresh, and only for an enabled provider with assigned assets. This timing applies to every service below. External providers are disabled on fresh installations. Front-end rate boards and product calculations use locally stored rates; they do not contact the providers directly.

Every contacted provider receives the web server's IP address, the requested URL and HTTP headers, including the plugin name/version User-Agent. HTML requests also include language and cache-control headers, and may return a source cookie when retrying a same-page redirect. The User-Agent does not contain the store URL. The adapters do not send customer names, email addresses, billing details, cart contents or order payloads. Configured credentials are sent only to the selected service as described below.

An API subscription and permission to display, retain or redistribute its data are separate matters. No rate-service account, subscription or third-party data licence is included. Consult the selected provider's terms, including plan-specific conditions.

See the Frequently Asked Questions below for each connection, its purpose, request data and provider policy links. The complete endpoint inventory is also included in services.txt.

= Data permissions and source limitations =

Enabling a provider authorizes a network connection; it does not grant a data license. Before displaying, storing history or exposing rates through the public REST endpoint, obtain permission covering those uses and comply with the provider's plan, attribution, retention and redistribution rules. Disable the public REST endpoint when the data license does not allow onward distribution.

TGJU's [terms, clause 18](https://www.tgju.org/terms) require written agreement for reuse of its prices and data. Third-party data licenses are not included with MRN Gold & Currency Pricing. A permission covering one website must not be assumed to cover every site installing this plugin. Obtain authorization covering the intended use before enabling TGJU, Milli or MelliGold; merely being able to access a page is insufficient. [MelliGold terms](https://melligold.com/terms).

Milli's [terms, Security and Confidentiality clause 7](https://milli.gold/main/terms/) prohibit scripts for indexing, study or data mining of the service. The public widget and JSON fallback must not be assumed to override that restriction; obtain explicit permission covering the integration.

The [CoinGecko API terms](https://www.coingecko.com/en/api_terms) include attribution and data-storage conditions. The plugin does not automatically place a CoinGecko credit on the public site or implement a CoinGecko-specific retention policy. Configure the required attribution and storage controls, or obtain suitable contractual permission, before using this integration.

[Frankfurter](https://frankfurter.dev/) permits commercial API use, subject to its underlying data providers' terms. API access and permission for every form of redistribution are distinct. The plugin's GPL license covers its code and artwork, not third-party rate data.

[Metals.dev terms](https://metals.dev/policy/terms) permit publishing rates with an active subscription, but prohibit reselling and creating a directly competing API; [privacy policy](https://metals.dev/policy/privacy). The general-purpose public REST feed must be configured consistently with these restrictions.

== Privacy ==

= مجوز منابع داده =

فعال‌کردن اتصال صرفاً اجازهٔ ارسال درخواست از سایت است و مجوز استفاده از داده نیست. بند ۱۸ شرایط TGJU (https://www.tgju.org/terms) استفاده از قیمت‌ها و داده‌ها را به موافقت کتبی مشروط می‌کند. مجوز دادهٔ سرویس‌ها همراه افزونه ارائه نمی‌شود. کاربر اتصال‌های TGJU، میلی و ملی‌گلد باید مجوز متناسب با نمایش، ذخیره و در صورت استفاده، توزیع از REST عمومی را داشته باشد. عمومی‌بودن صفحه یا API به‌تنهایی اجازهٔ بازنشر نیست.

بند ۷ بخش امنیت و محرمانگی شرایط میلی (https://milli.gold/main/terms/) استفاده از اسکریپت برای ایندکس‌گذاری، مطالعه یا داده‌کاوی سامانه را منع می‌کند. دسترسی به ویجت یا خروجی JSON دلیل مستثناشدن این اتصال نیست و مجوز مشخص لازم دارد. شرایط Metals.dev (https://metals.dev/policy/terms) نمایش نرخ روی سایت با اشتراک فعال را مجاز می‌داند اما فروش مجدد و ساخت API رقیب را منع می‌کند؛ REST عمومی را متناسب با همین محدودیت تنظیم کنید.

شرایط CoinGecko (https://www.coingecko.com/en/api_terms) الزام انتساب منبع و ضوابط ذخیره و نگهداری داده دارد. افزونه اعتبار CoinGecko را به‌طور خودکار در سایت نمایش نمی‌دهد و سیاست نگهداری اختصاصی برای این سرویس ندارد؛ پیش از استفاده باید این الزامات یا مجوز قراردادی مناسب تأمین شود. نمایش، تاریخچه و REST عمومی را مطابق مجوز همان منبع تنظیم کنید. GPL افزونه شامل مالکیت دادهٔ سرویس‌ها نمی‌شود.

تعریف دارایی، نرخ‌ها، تاریخچه، گزارش دریافت و تنظیمات سرویس در دیتابیس سایت ذخیره می‌شوند. کلیدها و توکن‌ها در گزینه‌های وردپرس ذخیره می‌شوند؛ از دسترسی مدیریت و نسخه‌های پشتیبان حفاظت کنید. مبنای نرخ در متادیتای محصول/سفارش ثبت می‌شود. حذف اطلاعات هنگام uninstall اختیاری و پیش‌فرض خاموش است.

آمار استفاده یا اطلاعات فروشگاه به MRNWP یا سازنده ارسال نمی‌شود. فایل‌های نمایشی محلی هستند. REST عمومی فقط دادهٔ نرخ را منتشر می‌کند و قابل خاموش‌کردن است؛ کلید API و header اتصال در آن قرار نمی‌گیرند.

== Frequently Asked Questions ==

= آیا نرخ‌ها لحظه‌ای هستند؟ =

دریافت دوره‌ای و وابسته به منبع، فاصلهٔ دریافت و WP-Cron است. قیمت بازار یا دسترسی دائمی سرویس تضمین نمی‌شود. زمان آخرین دریافت و رفتار نرخ قدیمی را تنظیم و بررسی کنید.

= بدون سرویس پولی هم کار می‌کند؟ =

نرخ دستی و منابعی که طبق شرایط خود دسترسی عمومی دارند قابل استفاده‌اند. هزینه و سهمیهٔ API را ارائه‌دهنده تعیین می‌کند.

= افزونه برای کاربران ایرانی است؟ =

رابط و معرفی برای سایت‌های ایرانی طراحی شده‌اند؛ تمرکز روی طلا، سکه، ریال و تومان است. منابع بین‌المللی برای تبدیل و نرخ رمزارز هم وجود دارند.

= آیا مالیات و قوانین فروش طلا را تضمین می‌کند؟ =

خیر. فرمول قیمت یک ابزار محاسبه است. نرخ، واحد، اجرت، تخفیف و مالیات باید متناسب با کسب‌وکار تنظیم و آزمایش شوند.

= CoinGecko =

Cryptocurrency prices. Destination: `api.coingecko.com`.

Data sent during the enabled refresh described above: Configured coin IDs, quote currency, change/timestamp flags and the optional Demo API key in a request header.

[Terms of service](https://www.coingecko.com/en/api_terms) | [Privacy policy/provisions](https://www.coingecko.com/en/privacy).

= Frankfurter =

International reference exchange rates; this is not the Iranian open-market exchange rate. Destination: `api.frankfurter.dev`.

Data sent during the enabled refresh described above: The configured base currency and selected target currency codes; no API key.

[Terms of service](https://frankfurter.dev/license/) | [Privacy policy/provisions](https://frankfurter.dev/#faq).

The FAQ contains the API privacy policy under "What is the privacy policy of the API?".

= Metals.Dev =

Precious-metal prices. Destination: `api.metals.dev`.

Data sent during the enabled refresh described above: The configured API key, quote currency and weight unit in query parameters.

[Terms of service](https://metals.dev/policy/terms) | [Privacy policy/provisions](https://metals.dev/policy/privacy).

= Nobitex =

Public cryptocurrency market prices. Destination: `apiv2.nobitex.ir`.

Data sent during the enabled refresh described above: A request for the public market ticker list; no account credentials or customer information.

[Terms of service](https://nobitex.ir/policies/?tab=terms) | [Privacy policy/provisions](https://nobitex.ir/policies/?tab=privacy).

= Bitpin =

Public cryptocurrency market prices. Destination: `api.bitpin.ir`.

Data sent during the enabled refresh described above: A request for the public market list; no account credentials or customer information.

[Terms of service](https://bitpin.ir/rules/) | [Privacy policy/provisions](https://bitpin.ir/rules/).

The combined document includes section 4, protection of privacy and user rights.

= Exir =

Public cryptocurrency market prices. Destination: `api.exir.io`.

Data sent during the enabled refresh described above: A request for the public ticker list; no account credentials or customer information.

[Terms of service](https://www.exir.io/terms_privacy/) | [Privacy policy/provisions](https://www.exir.io/terms_privacy/).

The combined terms include a personal-information protection section.

= TetherLand =

Public cryptocurrency prices. Destination: `api.tetherland.com`.

Data sent during the enabled refresh described above: A request for the public currency list; no account credentials or customer information.

[Terms of service](https://tetherland.com/terms/) | [Privacy policy/provisions](https://tetherland.com/terms/).

The combined document includes privacy and confidentiality provisions.

= Ramzinex =

Public cryptocurrency market prices. Destination: `publicapi.ramzinex.com`.

Data sent during the enabled refresh described above: A request for the public exchange-price list; no account credentials or customer information.

[Terms of service](https://ramzinex.ir/info/terms/) | [Privacy policy/provisions](https://ramzinex.ir/info/terms/).

The combined document includes protection of personal information.

= ArzPaya =

Public cryptocurrency market prices. Destination: `api.arzpaya.com`.

Data sent during the enabled refresh described above: A request for public exchange information; no account credentials or customer information.

[Terms of service](https://arzpaya.com/rules/) | [Privacy policy/provisions](https://arzpaya.com/rules/).

The combined document includes confidentiality of user information in clause 7.

= Aban Tether =

Cryptocurrency prices from the account API. Destination: `abantether.com`.

Data sent during the enabled refresh described above: The configured API key in the Authorization header and the JSON response-format parameter.

[Terms of service](https://abantether.ir/rules) | [Privacy policy/provisions](https://abantether.ir/rules).

The official site links to this combined document; its identity-verification section covers confidentiality and disclosure to authorities.

= CoinMarketCap =

Cryptocurrency quotes in USD. Destination: `pro-api.coinmarketcap.com`.

Data sent during the enabled refresh described above: Selected cryptocurrency symbols, the skip-invalid flag and the configured API key in the X-CMC_PRO_API_KEY header.

[Terms of service](https://coinmarketcap.com/terms/) | [Privacy policy/provisions](https://coinmarketcap.com/privacy/).

= CryptoCompare =

Cryptocurrency prices. Destination: `min-api.cryptocompare.com`.

Data sent during the enabled refresh described above: Selected cryptocurrency symbols, the quote currency, the static application identifier MRNPriceEngine and an optional API key in a request header.

[Terms of service](https://www.cryptocompare.com/terms-conditions/) | [Privacy policy/provisions](https://www.cryptocompare.com/privacy-policy/).

= ExchangeRate-API =

International currency conversion rates. Destination: `v6.exchangerate-api.com`.

Data sent during the enabled refresh described above: The configured API key and base currency in the request path.

[Terms of service](https://www.exchangerate-api.com/terms) | [Privacy policy/provisions](https://www.exchangerate-api.com/terms).

Terms and Privacy Policy are sections of the same document.

= Fixer / APILayer =

International currency conversion rates. Destination: `api.apilayer.com`.

Data sent during the enabled refresh described above: The configured base and selected currency codes in the query, and the API key in the apikey header.

[Terms of service](https://www.ideracorp.com/Legal/Terms-of-Use) | [Privacy policy/provisions](https://www.ideracorp.com/en/legal/privacypolicy).

APILayer legal resources: https://www.ideracorp.com/legal/APILayer . Additional subscription and data-use terms can apply to the selected plan.

= Commodities-API =

Commodity prices converted from USD quotes. Destination: `commodities-api.com`.

Data sent during the enabled refresh described above: The configured API key, USD base and selected commodity symbols in the query.

[Terms of service](https://commodities-api.com/terms#terms-conditions) | [Privacy policy/provisions](https://commodities-api.com/terms#privacy).

= MetalpriceAPI =

Metal and currency reference rates. Destination: `api.metalpriceapi.com`.

Data sent during the enabled refresh described above: The configured API key, base currency and selected currency/metal codes in the query.

[Terms of service](https://metalpriceapi.com/terms) | [Privacy policy/provisions](https://metalpriceapi.com/privacy).

= Metals-API =

Precious-metal rates. Destination: `metals-api.com`.

Data sent during the enabled refresh described above: The configured API key, base currency and selected metal/currency symbols in the query.

[Terms of service](https://metals-api.com/terms#terms-conditions) | [Privacy policy/provisions](https://metals-api.com/terms#privacy).

= GoldAPI =

Precious-metal prices and gram/karat quotes. Destination: `www.goldapi.io`.

Data sent during the enabled refresh described above: Each selected metal code and USD in the request path, with the configured API key in the x-access-token header. One request is made per selected metal.

[Terms of service](https://www.goldapi.io/blog/terms-of-service) | [Privacy policy/provisions](https://www.goldapi.io/blog/privacy-policy).

= Open Exchange Rates =

International reference exchange rates. Destination: `openexchangerates.org`.

Data sent during the enabled refresh described above: The configured App ID and selected currency symbols in the query.

[Terms of service](https://openexchangerates.org/terms) | [Privacy policy/provisions](https://openexchangerates.org/privacy).

= Milli =

The 18-karat gold rate from the public widget, with a public JSON fallback when the widget cannot be parsed. Destination: `milli.gold`.

Data sent during the enabled refresh described above: Requests for the widget and, if necessary, the public price endpoint; no account credentials or customer information.

[Terms of service](https://milli.gold/main/terms/) | [Privacy policy/provisions](https://milli.gold/main/privacy/).

= MelliGold =

Gold and coin rates parsed from the selected public market pages. Destination: `melligold.com`.

Data sent during the enabled refresh described above: The selected market-page paths; no account credentials or customer information. A source cookie can be returned on a same-page redirect retry.

[Terms of service](https://melligold.com/terms) | [Privacy policy/provisions](https://melligold.com/terms).

The combined document includes an "امنیت و محرمانگی" (Security and Confidentiality) section.

= TGJU =

Gold, currency, coin and other rates parsed from public market pages. Destination: `www.tgju.org`.

Data sent during the enabled refresh described above: Requests for the public pages; no account credentials or customer information. A source cookie can be returned on a same-page redirect retry.

[Terms of service](https://www.tgju.org/terms) | [Privacy policy/provisions](https://www.tgju.org/terms).

The combined document addresses collection of member IP/contact information and restrictions on disclosure in clauses 12-13. It does not provide a separate detailed policy for anonymous page requests.

= Custom JSON and TGJU Local =

These are configurable connections rather than a bundled third-party service. No destination is set on a fresh installation. During an enabled refresh, the plugin sends a GET request to the exact HTTPS URL chosen by the administrator, including its configured query parameters. Custom JSON also sends the configured request headers, which can contain credentials. TGJU Local sends the URL parameters and the standard request headers only. The remote operator receives the server IP and plugin User-Agent. The provider's terms and privacy policy depend on that chosen destination; review both before entering a URL or enabling the connection. These adapters are not a proxy operated by MRNWP.

= Legacy catalog entries =

Bonbast, Hamyar Android, Metals Live, OK-EX.io, Parsijoo, Persian API, Taban Gohar, Tala Clinic Fars and Tala.ir Scraper are compatibility entries without a supported fetch endpoint. They return an unavailable-adapter error and do not transmit data. Their presence in existing settings does not activate a network connection.

== Screenshots ==

1. داشبورد فارسی نرخ‌ها و وضعیت منابع.
2. مدیریت نرخ طلا، ارز و دارایی‌ها.
3. تابلوی نرخ فارسی در سایت.

== Changelog ==

= 1.4.1 =
* حذف ۹ اتصال نرخ و تنظیمات و مقصدهای درخواست آن‌ها.
* تبدیل دارایی‌های منابع حذف‌شده به نرخ دستی با حفظ مقدارهای قبلی.

= 1.4.0 =
* نام و شناسهٔ جدید برای انتشار عمومی.
* پیشوند MRNPE/mrnpe برای namespace، تابع عمومی، شورت‌کدها، بلوک و مسیر REST.
* توضیح مقصد و داده‌های ارسالی هر سرویس و پیوند شرایط و حریم خصوصی آن.
* حفظ جدول‌ها، تنظیمات، نرخ‌ها و فرمول محصولات.

= 1.3.0 =
* معرفی MRN Gold & Currency Pricing، صفحه محصول و اطلاعات سازنده.
* افزودن لوگو و آیکون هماهنگ با منوی وردپرس.
* خاموش‌بودن منابع بیرونی در نصب تازه؛ حفظ تنظیمات قبلی.
* حذف نشانی سایت از User-Agent و محدودسازی پاسخ JSON.
* هماهنگی دامنهٔ ترجمه و بستهٔ انتشار با mrn-gold-currency-pricing.
* تکمیل مستندات منابع، حریم خصوصی و مجوز GPLv3 or later.

= 1.2.0 =
* استخراج نرخ از Milli، MelliGold و TGJU.
* حفظ آخرین نرخ معتبر هنگام خطای تشخیص صفحه.

= 1.1.0 =
* تبدیل نرخ به ارز فروشگاه با جفت‌نرخ‌های ذخیره‌شده.
* توسعهٔ فهرست منابع و تنظیمات اتصال.

= 1.0.0 =
* نخستین نسخه.

== Upgrade Notice ==

= 1.4.1 =
دارایی‌های متصل به منابع حذف‌شده به نرخ دستی تبدیل می‌شوند و مقدار قبلی حفظ می‌شود. نرخ‌ها را بررسی و منبع پشتیبانی‌شده انتخاب یا نرخ دستی را به‌روز کنید.

= 1.3.0 =
نام عمومی MRN Gold & Currency Pricing است. تنظیمات و نرخ‌های قبلی حفظ می‌شوند. منابع بیرونی نصب تازه باید توسط مدیر فعال شوند.
