=== Vyntic Metal Sync - Live Metal Rates for WooCommerce ===
Contributors: vynatics
Tags: woocommerce, gold, silver, metal prices, dynamic pricing
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sync live gold, silver, platinum and palladium rates with WooCommerce pricing based on weight, purity, making charges and markup.

== Description ==

Vyntic Metal Sync is a WooCommerce precious-metal pricing plugin for stores that sell Gold, Silver, Platinum and Palladium products.

It retrieves current metal rates through the managed Metal Sync Live Server and can automatically calculate eligible WooCommerce product and variation prices using material weight, purity, making charges and markup.

If the live-rate service is unavailable, administrators can use manual fallback metal rates so product pricing can continue without depending on a successful live request.

= WooCommerce precious-metal pricing =

Vyntic Metal Sync helps automate metal-based product pricing for WooCommerce stores that need prices to follow changing precious-metal market rates.

Key features include:

* Live Gold, Silver, Platinum and Palladium rate retrieval.
* WooCommerce product and variation metal-pricing controls.
* Automatic product pricing based on metal rate, weight and purity.
* Fixed making-charge and fixed markup support.
* Manual fallback metal rates.
* Configurable automatic rate-refresh schedules.
* Built-in and custom currency management.
* Gram, kilogram, troy-ounce and tola weight units.
* Optional material-details display on eligible WooCommerce products.
* Live cart and checkout price protection.
* Front-end price refresh controls.
* Admin activity, rate-status and settings controls.
* Administrator-controlled uninstall cleanup.

= Supported precious metals =

The plugin supports pricing for:

* Gold
* Silver
* Platinum
* Palladium

= Metal pricing inputs =

Eligible WooCommerce products and variations can be configured using:

* Material or precious-metal type.
* Product weight.
* Purity.
* Fixed making charge.
* Fixed markup.
* Selected pricing currency.
* Selected weight unit.

These values are combined with the active metal rate to calculate the product price.

= Live rates and manual fallback pricing =

Administrators can refresh live metal rates manually or allow the plugin to refresh rates on a configured schedule.

If the Metal Sync Live Server cannot be reached, manual fallback rates can be stored and applied from the Metal Rates screen.

= Currency and unit support =

Vyntic Metal Sync includes built-in currency support and allows administrators to manage custom currency codes.

Supported metal weight units include:

* Gram
* Kilogram
* Troy ounce
* Tola

= WooCommerce cart and checkout protection =

The plugin includes live cart and checkout price protection so eligible metal-priced products can use current pricing controls during the purchasing process.

= No license key required =

All functionality included in this WordPress.org package is available without a license key, activation code, trial period, quota or payment gate.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the `vyntic-metal-sync` directory to `/wp-content/plugins/`, or install the plugin ZIP from Plugins > Add New > Upload Plugin.
3. Activate Vyntic Metal Sync.
4. Open Metal Sync > Metal Rates.
5. Select the pricing currency, weight unit and automatic refresh schedule.
6. Refresh live rates or enter manual fallback rates.
7. Open an eligible WooCommerce product or variation and configure its metal-pricing fields.
8. Save or update the product.

== Usage ==

= Configure metal rates =

Go to Metal Sync > Metal Rates to select the active currency and weight unit, retrieve current metal rates, configure automatic refreshes, or enter manual fallback values.

= Configure a WooCommerce product =

Edit a WooCommerce product or variation and use the Metal Sync pricing controls to configure the metal type, weight, purity, making charge and markup.

Save the product after completing the required pricing fields.

= Manage automatic refreshes =

Use the Metal Sync settings to choose the available automatic rate-refresh schedule for your store.

== External services ==

= Metal Sync Live Server =

Vyntic Metal Sync connects to the Metal Sync Live Server hosted at `https://vynatics.corsysltd.com/server` to retrieve current and historical precious-metal rate data.

This external processing is required for live-rate and historical-rate features. Manual fallback pricing remains available if the service cannot be reached.

The plugin does not connect directly to XAUS.com. The managed Metal Sync Live Server obtains precious-metal market data from XAUS.com and returns rate data to the plugin.

For rate requests, the plugin sends:

* The site's canonical home URL.
* An MD5 hash derived from that canonical home URL.
* The plugin slug and plugin version.
* The installed WordPress version.
* A client-mode identifier (`core`).
* The requested pricing currency and weight unit.
* The requested service name.
* For historical requests, the requested date range and range identifier.

A request is sent when:

* An administrator manually refreshes metal rates.
* A configured scheduled refresh runs.
* A currency change requires a fresh rate set.
* An administrator requests historical chart data.

The plugin does not send WooCommerce customer or order data to the Metal Sync Live Server for metal-rate requests.

Service terms: https://vynatics.corsysltd.com/wp-metal-sync/terms.html

Privacy policy: https://vynatics.corsysltd.com/wp-metal-sync/privacy.html

== Development and source code ==

The JavaScript and CSS files under `assets/js/` and `assets/css/` are shipped in human-readable form and are used directly at runtime.

No transpilation, bundling, obfuscation or minification step is required for this WordPress.org package.

Matching development mirrors are included under `src/js/` and `src/css/`. They are byte-for-byte equivalent to the runtime files.

No remote executable code is downloaded or executed by this plugin. The Metal Sync Live Server returns rate data only.

== Frequently Asked Questions ==

= Does Vyntic Metal Sync require WooCommerce? =

Yes. Vyntic Metal Sync is designed for WooCommerce product pricing and requires WooCommerce to be installed and active.

= Which metals are supported? =

The plugin supports Gold, Silver, Platinum and Palladium.

= Can I automatically update WooCommerce gold and silver prices? =

The plugin can retrieve current precious-metal rates on a configured schedule and use the active rates with each eligible product's pricing settings.

= How are metal-based WooCommerce prices calculated? =

Eligible products and variations use the configured metal rate together with product weight, purity, fixed making charge and fixed markup settings.

= Which weight units are supported? =

The plugin supports gram, kilogram, troy ounce and tola.

= Can I use my own currency code? =

Yes. The plugin includes built-in currency management and custom currency-code support.

= What happens if the live metal-rate server is unavailable? =

You can store and apply manual fallback metal rates from the Metal Rates screen.

= Does the plugin require a license key? =

No. This WordPress.org package does not use a license key or activation code to enable local functionality.

= Does the plugin send WooCommerce customer or order data to the Metal Sync Live Server? =

No. Metal-rate requests send only the site and request metadata documented in the External services section. WooCommerce customer and order data is not sent to the Metal Sync Live Server for these requests.

= Does the plugin download or execute remote code? =

No. The Metal Sync Live Server returns rate data only. No remote executable code is downloaded or executed by the plugin.

== Changelog ==

= 1.0.0 =
* Migrated live and historical precious-metal market data to XAUS.com through the Metal Sync central server.
* Updated the WordPress.org readme for clearer WooCommerce precious-metal pricing documentation and directory discoverability.
* Sanitized and validated nested admin/AJAX input before it reaches product, pricing, category, settings and currency handlers.
* Reworked dynamic SQL to use `$wpdb->prepare()` with `%i` identifier placeholders for plugin and WordPress tables.
* Removed database-query suppressions that masked genuine prepared-SQL findings.
* Hardened WooCommerce product and variation request handling and preserved safe HTML only where explicitly intended.
* Updated uninstall cleanup queries to use prepared table identifiers.
* Re-tested directory metadata against WordPress 7.1.
* Completed a full-package WordPress.org review remediation pass.
* Prepared the directory build for WordPress.org review compliance.
* Removed local feature locking and license-based feature checks.
* Made custom currency management and automatic rate-refresh schedules directly available.
* Added nonce and capability protections across privileged request handlers.
* Improved output escaping and direct-file-access protection.
* Moved admin presentation to WordPress enqueue APIs and removed remote font loading.
* Added complete Metal Sync Live Server disclosure.
* Added human-readable JavaScript source files.
* Updated the plugin name, text domain and WordPress compatibility metadata.
