Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/ngns-io/eia-fuel-surcharge/archive/refs/heads/main.zipUpdates itself. It ships its own updater (Update URI header), so new versions appear under Dashboard → Updates.
EIA Fuel Surcharge Display
A WordPress plugin that retrieves diesel fuel prices from the U.S. Energy Information Administration (EIA) API and calculates fuel surcharge rates for display on your website through flexible shortcodes.
Development Setup
Prerequisites
- WordPress 5.2 or higher
- PHP 7.2 or higher
- Composer (for dependency management)
- API key from EIA Open Data
Installation for Development
1. Clone this repository to your local machine:
2. Navigate to the plugin directory:
3. Install dependencies:
4. Copy the plugin to your WordPress plugins directory or create a symlink for development.
Building the Plugin
The repository includes a build script to create a zip file suitable for installing in WordPress.
1. Make the build script executable:
2. Run the build script:
You can specify a version number as an argument:
3. The plugin zip file will be created in the dist directory and can be installed via the WordPress admin interface.
Usage
After installing and activating the plugin:
1. Go to the "Fuel Surcharge" menu in the WordPress admin.
2. Enter your EIA API key on the Settings page.
3. Configure the calculation formula and