Title: OilPriceAPI Fuel Widgets
Author: Karl Waldman
Published: <strong>5 ກໍລະກົດ 2026</strong>
Last modified: 19 ກໍລະກົດ 2026

---

ຄົ້ນຫາປລັກອິນ

![](https://ps.w.org/oilpriceapi-widgets/assets/banner-772x250.png?rev=3613705)

![](https://ps.w.org/oilpriceapi-widgets/assets/icon-256x256.png?rev=3597074)

# OilPriceAPI Fuel Widgets

 ໂດຍ [Karl Waldman](https://profiles.wordpress.org/kwaldman/)

[ດາວໂຫຼດ](https://downloads.wordpress.org/plugin/oilpriceapi-widgets.1.1.1.zip)

 * [ລາຍລອຽດ](https://lo.wordpress.org/plugins/oilpriceapi-widgets/#description)
 * [ການຣີວິວ](https://lo.wordpress.org/plugins/oilpriceapi-widgets/#reviews)
 *  [ການຕິດຕັ້ງ](https://lo.wordpress.org/plugins/oilpriceapi-widgets/#installation)
 * [ການພັດທະນາ](https://lo.wordpress.org/plugins/oilpriceapi-widgets/#developers)

 [ການຊ່ວຍເຫຼືອ](https://wordpress.org/support/plugin/oilpriceapi-widgets/)

## ຄຳອະທິບາຍ

OilPriceAPI Fuel Widgets adds source-dated U.S. retail-fuel data to WordPress as
shortcodes or a Gutenberg block.

#### Fuel Price Ticker

National U.S. diesel and regular gasoline averages. Each result shows its EIA observation
week, weekly cadence, unit, and source.

#### U.S. Diesel Price

The national U.S. diesel retail average, quoted in USD per gallon and labeled with
its observation week.

#### Fuel Surcharge Calculator

Calculates the percentage by which the weekly national diesel average exceeds a 
base price configured by the site owner. It does not describe the result as an industry
standard or a contractual surcharge.

#### Features

 * Source date, weekly cadence, currency, unit, and EIA attribution in every successful
   widget
 * Dark and light themes
 * Shortcodes and Gutenberg block
 * Server-side requests with no remote executable code
 * One-hour validated cache
 * Last successful result for up to 48 hours after an error, visibly labeled as 
   a cached copy
 * Fail-closed handling for unavailable, rate-limited, timed-out, empty, or malformed
   responses
 * No API key required for the public EIA series

### External service

This plugin uses OilPriceAPI to retrieve the EIA retail-fuel series displayed by
the widgets.

The WordPress server sends a GET request to `https://www.oilpriceapi.com/api/widgets/
fuel-prices` at most once per hour while a page containing a widget is requested.
OilPriceAPI receives the site server’s IP address and standard HTTP request metadata.
The plugin does not send the visitor’s IP address, WordPress user data, page content,
or an API credential.

The underlying retail-fuel observations come from the [U.S. Energy Information Administration](https://www.eia.gov/petroleum/gasdiesel/)
and are public domain at the source. OilPriceAPI delivers and validates the response;
it does not grant rights in underlying data.

 * [OilPriceAPI privacy policy](https://www.oilpriceapi.com/privacy)
 * [OilPriceAPI terms](https://www.oilpriceapi.com/terms)
 * [OilPriceAPI service status](https://status.oilpriceapi.com/)

## ບລັອກ

ປລັກອິນນີ້ມີ 1 ບລັອກ.

 *   OilPriceAPI Widget Embed source-dated weekly U.S. fuel prices or a fuel surcharge
   calculator.

## ການຕິດຕັ້ງ

 1. Upload the `oilpriceapi-widgets` folder to `/wp-content/plugins/`.
 2. Activate **OilPriceAPI Fuel Widgets** through the Plugins screen.
 3. Add an OilPriceAPI block or one of the shortcodes below to a page.

#### Quick Start

 * `[oilpriceapi_ticker]` – weekly national diesel and gasoline prices
 * `[oilpriceapi_diesel]` – weekly national diesel price
 * `[oilpriceapi_fuel_surcharge base_price="2.50"]` – percentage above the configured
   base

Configure default theme, fuels, and base price under **Settings > OilPriceAPI**.

## ຄຳຖາມທີ່ພົບເລື້ອຍ

### Do I need an API key?

No. These widgets use a public OilPriceAPI route restricted to two EIA public-domain
retail-fuel series.

### How current is the data?

EIA publishes these retail-fuel series weekly. Every successful widget shows the
source observation as `Week of` followed by a date and says `Updated weekly`.

### What happens if the service is unavailable?

The plugin can show its last successful response for up to 48 hours. That state 
is visibly labeled `Cached copy; service temporarily unavailable`. After 48 hours,
the price is removed and the widget links to the service status page.

### What does the plugin cache?

Only the validated fuel-price payload, its EIA source date, and the time it was 
retrieved. The fresh cache lasts one hour. The last-success cache lasts no more 
than 48 hours.

### Can I display crude oil or natural gas prices?

Not with this public widget. OilPriceAPI does not hold downstream display or redistribution
rights for the crude and natural-gas inputs previously shown by the ticker. Review
the [data-use guidance](https://www.oilpriceapi.com/docs/redistribution) before 
publishing API data to third parties.

### What happened to the carbon calculator and regional diesel display?

Version 1.1 retired the carbon calculator’s uncleared crude-price input and removed
unsupported regional diesel output. An existing carbon shortcode shows a retirement
notice instead of silently displaying a fabricated or uncleared value.

### Where can developers get programmatic access?

See the [API documentation](https://docs.oilpriceapi.com/) and the official [PHP SDK](https://packagist.org/packages/oilpriceapi/oilpriceapi).

## ການຣີວິວ

ບໍ່ມີການຣີວິວສຳລັບປລັກອິນນີ້.

## ຜູ້ຮ່ວມພັດທະນາ ແລະ ຜູ້ພັດທະນາ

“OilPriceAPI Fuel Widgets” ແມ່ນຊອຟແວໂອເພັນຊອດ (Open Source). ບຸກຄົນຕໍ່ໄປນີ້ໄດ້ມີ
ສ່ວນຮ່ວມໃນການພັດທະນາປລັກອິນນີ້.

ຜູ້ຮ່ວມພັດທະນາ

 *   [ Karl Waldman ](https://profiles.wordpress.org/kwaldman/)
 *   [ oilpriceapi ](https://profiles.wordpress.org/oilpriceapi/)

[ແປ “OilPriceAPI Fuel Widgets” ເປັນພາສາຂອງເຈົ້າ.](https://translate.wordpress.org/projects/wp-plugins/oilpriceapi-widgets)

### ສົນໃຈຮ່ວມພັດທະນາບໍ່?

[ເບິ່ງລະຫັດ](https://plugins.trac.wordpress.org/browser/oilpriceapi-widgets/), ກວດເບິ່ງ
[ຄັງເກັບ SVN](https://plugins.svn.wordpress.org/oilpriceapi-widgets/), ຫຼື ຕິດຕາມ
[ບັນທຶກການພັດທະນາ](https://plugins.trac.wordpress.org/log/oilpriceapi-widgets/) 
ຜ່ານ [RSS](https://plugins.trac.wordpress.org/log/oilpriceapi-widgets/?limit=100&mode=stop_on_copy&format=rss).

## ບັນທຶກການປ່ຽນແປງ

#### 1.1.1

 * Matched the package folder and text domain to the approved WordPress.org directory
   slug `oilpriceapi-widgets`

#### 1.1.0

 * Replaced crude and natural-gas public display with allowlisted EIA diesel and
   gasoline series
 * Added visible source date, weekly cadence, unit, and EIA attribution
 * Moved rendering server-side and removed remote executable widget scripts
 * Added strict response validation and fail-closed recovery states
 * Added one-hour fresh caching and an explicitly labeled 48-hour last-success fallback
 * Retired the carbon widget’s uncleared crude-price dependency
 * Removed unsupported regional diesel output and unsupported marketing claims
 * Added deterministic failure-path tests and CI

#### 1.0.1

 * Confirmed WordPress compatibility and expanded directory documentation

#### 1.0.0

 * Initial plugin release

## ຂໍ້ມູນກຳກັບ (Meta)

 *  ເວີຊັນ **1.1.1**
 *  ອັບເດດຫຼ້າສຸດເມື່ອ **2 ມື້ ທີ່ຜ່ານມາ** ທີ່ຜ່ານມາ
 *  ການຕິດຕັ້ງທີ່ໃຊ້ງານຢູ່ **ໜ້ອຍກວ່າ 10**
 *  ເວີຊັນ WordPress ** 6.0 ຫຼື ສູງກວ່າ **
 *  ທົດສອບເຖິງເວີຊັນ **7.0.2**
 *  ເວີຊັນ PHP ** 7.4 ຫຼື ສູງກວ່າ **
 *  ພາສາ
 * [English (US)](https://wordpress.org/plugins/oilpriceapi-widgets/)
 * ແທັກ
 * [fuel surcharge](https://lo.wordpress.org/plugins/tags/fuel-surcharge/)[widget](https://lo.wordpress.org/plugins/tags/widget/)
 *  [ມຸມມອງຂັ້ນສູງ](https://lo.wordpress.org/plugins/oilpriceapi-widgets/advanced/)

## ການໃຫ້ຄະແນນ

ຍັງບໍ່ມີການສົ່ງຄຳວິຈານເທື່ອ.

[Your review](https://wordpress.org/support/plugin/oilpriceapi-widgets/reviews/#new-post)

[ເບິ່ງ ຄຳຄິດເຫັນ ທັງໝົດ](https://wordpress.org/support/plugin/oilpriceapi-widgets/reviews/)

## ຜູ້ຮ່ວມພັດທະນາ

 *   [ Karl Waldman ](https://profiles.wordpress.org/kwaldman/)
 *   [ oilpriceapi ](https://profiles.wordpress.org/oilpriceapi/)

## ການຊ່ວຍເຫຼືອ

ມີຄຳຖາມ ຫຼື ຕ້ອງການຄວາມຊ່ວຍເຫຼືອບໍ່?

 [ເບິ່ງຟໍຣັມການຊ່ວຍເຫຼືອ](https://wordpress.org/support/plugin/oilpriceapi-widgets/)