Official BCV exchange rates for USD, EUR, CNY, TRY and RUB with WordPress shortcode, REST API, caching and live-tested parsing.
- Official BCV rates for USD, EUR, CNY, TRY and RUB.
- Strict HTTP, completeness, numeric and positive-value validation before caching.
- Fresh cache for 4 hours plus a 7-day last-known-good fallback when BCV is temporarily unavailable.
[tasa_bcv]shortcode with optional currency and decimal parameters.- Public read-only REST endpoint at
/wp-json/tasas-bcv/v1/rates. - No Composer or third-party PHP dependencies.
USD, EUR, CNY, TRY, RUB, mapped to the current BCV HTML IDs dolar, euro, yuan, lira and rublo.
Copy the plugin directory into wp-content/plugins/tasas-bcv-automaticas/ or build the installable ZIP with:
./build-release.shThen activate Tasas BCV in WordPress.
Display all five rates with [tasa_bcv]. Display one currency with:
[tasa_bcv moneda="TRY"]
[tasa_bcv moneda="RUB"]
[tasa_bcv moneda="USD" decimales="4"]
Decimal precision is clamped between 0 and 6.
GET /wp-json/tasas-bcv/v1/rates
Example response:
{
"base": "VES",
"rates": {
"USD": 36.1234,
"EUR": 39.5012,
"CNY": 4.995,
"TRY": 16.1446144,
"RUB": 9.10428493
},
"date": "16/08/2026",
"fetched_at": 1786914000,
"source": "BCV",
"stale": false
}The endpoint returns HTTP 200 with "stale": true when refresh fails but last-known-good data exists, and HTTP 503 when no valid data exists.
php -l tasas-bcv-automaticas.php
php -l tests/smoke.php
php -l tests/live.php
php tests/smoke.php
php tests/live.phpThe smoke test runs without WordPress. The live test downloads the current BCV page and fails unless all five currencies are present and valid.
The BCV request currently uses the temporary sslverify => false workaround because a certificate-chain problem was observed with certain OpenSSL clients. TLS is not disabled globally and this setting does not affect any other URL. Remove the workaround when BCV fixes its certificate chain; it is not an ideal permanent solution.
This project is a fork of octaviotron/wordpress-tasa-bcv. This fork adds a hardened parser, live tests, stale fallback, a read-only REST API, and support for USD, EUR, CNY, TRY and RUB.
- WordPress 5.0+
- PHP 7.4+
- PHP DOM extension (
ext-dom) in production
GPL-2.0-or-later. See LICENSE.