Gasolineras de España

By Hullcode Systems S.L.

★ 5.0/5 (2 ratings)10+ active installationsVersion 2.0.0

Prices of the gas stations of Spain on your site: near a place, the cheapest of a town, your own gas stations or the average price.

Description

Gasolineras de España shows the prices of the gas stations of Spain on your website: no API key, no sign-up, updated every hour from the official data of the Spanish Ministry (more than 11,000 gas stations).

Add the «Gas stations in Spain» block in the block editor, the widget in classic themes, or a shortcode made in Settings › Gas stations in Spain, and choose what to show:

  • Gas stations near a place: a street, a postcode or a gas station, by distance or by price within the radius you choose.
  • The cheapest in a town, a province or a region (Getafe, the province of Valencia, Galicia…).
  • Chosen gas stations: up to 10, for instance the gas station of your business.
  • The average price today in a town, a province or a region, with its last 30 days.

Features

  • Petrol 95 and 98, diesel, diesel + and LPG.
  • The change since yesterday, the difference with the average price of the area and the gas stations open 24 hours.
  • Distance and a link to directions in Google Maps.
  • The mejorgasolinera.com logo, with a link to more gas stations of the place. You can hide it in the settings.
  • The time of the prices, which you can also hide.
  • A card that takes the colours and the font of your theme (or your own colours) and adapts to the room it has: a sidebar or a content column.
  • Fast: the card is made on your server with the data already in the page. No JavaScript on your public pages.
  • The data is kept in your WordPress cache until the next hourly price update. If the service does not answer, the last data is shown, with its time.
  • A shortcode generator with a live preview.
  • In English and Spanish.
  • The classic design of the previous versions is still there: widgets and shortcodes made before 2.0 look exactly the same.

Gasolineras de España is a service of mejorgasolinera.com.

External services

This plugin gets the gas stations and their prices from the mejorgasolinera.com service.

  • What is sent and when: when a page with the block, the widget or the shortcode is shown and the data kept in your WordPress cache is out of date, your server sends to https://mejorgasolinera.com/api/gas/gasstations what the card needs (the location you set: coordinates, a town, province or region, or the ids of the gas stations you chose; the number of gas stations and the order), your site’s domain name and the plugin version. When you search a place or a gas station in the settings, your server sends that text to https://mejorgasolinera.com/api/gas/coordinates. Requests are made by your server: your visitors’ browsers and IP addresses are never sent to mejorgasolinera.com.
  • Brand icons are included in the plugin and served from your site.
  • Terms and privacy: Legal notice, Privacy policy.

Installation

  1. In Plugins › Add New, search «Gasolineras de España», install it and activate it.
  2. Then, any of these:
    • Block editor: add the «Gas stations in Spain» block and choose its options in the side panel.
    • Classic themes: Appearance › Widgets, add «Gasolineras de España» to a sidebar.
    • Anywhere else: Settings › Gas stations in Spain, choose the options, copy the shortcode and paste it in a page, a post or a «Shortcode» block.

FAQ

How often are the prices updated?

Every hour, from the open data of the Spanish Ministry for the Ecological Transition. The card shows the time of the prices.

Does it slow down my site?

No. The card is made on your server and kept in your WordPress cache until the next update; your public pages load no JavaScript from this plugin.

Is there a limit?

The service accepts up to 30 new requests a minute from each site (120 from each server), and the plugin itself makes no more than 8 a minute from the public pages (and 8 more while you edit), so a normal site never reaches it: each location is asked once until the next price update, not once per visit. If the limit is reached, the last data is shown. Using the service outside the plugin, automated requests or skipping the limits can get a site limited or blocked.

The card says that the prices are not available

Visitors see a neutral line; if you are logged in as an editor you see the reason and what to do. The most common one is a hosting that does not allow requests to other sites.

My widgets made before 2.0

They look exactly the same (classic design). To use the new card, open the widget and choose «Card» in «Design».

Screenshots

Changelog

2.0.0

  • New card design for new widgets, the block and shortcodes with design=”card”. Widgets and shortcodes made before look exactly the same.
  • New «Gas stations in Spain» block, with search of places and gas stations and a live preview.
  • New Settings › Gas stations in Spain page with a shortcode generator and a live preview.
  • New modes: the cheapest of a town, a province or a region; chosen gas stations; the average price with its last 30 days.
  • Order by price now looks for the cheapest within the whole radius.
  • New order by the average price of petrol 95 and diesel, the one by default in the card.
  • The card is never wider than it needs for the fuels it shows.
  • LPG, the change since yesterday, the difference with the average price and the gas stations open 24 hours.
  • The «More gas stations» link of the card is now the mejorgasolinera.com logo (nofollow), which can be turned off.
  • The data is kept until the next hourly price update instead of 30 minutes, and the last data is shown for up to 2 days if the service fails.
  • Fixed: on some servers with PHP 7 and a Spanish locale the widget never showed prices.
  • Fixed: gas stations whose prices had not changed for 10 days were left out.
  • Fixed: the time of the prices of the card is shown in the time of your site.
  • The new phrases are translated into Spanish even if the language pack of your site is older.

1.2.0

  • The widget is rendered on the server: no JavaScript on your pages and no empty boxes while loading.
  • Data is requested by your server and cached in WordPress for 30 minutes. If the service is down, the last data is shown.
  • Your visitors’ IP addresses are no longer sent to mejorgasolinera.com.
  • Brand icons for 80 more brands.
  • Fixed: GA+ showed the diesel price.
  • Shortcode attributes are validated.