Lounastaja

Plugin Banner

Lounastaja

by lounastaja

Download
Description

Lounastaja adds a lunch menu to a WordPress post or page using the [lounastaja-widget] shortcode. WordPress retrieves an HTML fragment, so the initial page response includes the menu text. The Lounastaja widget script provides the interactive widget in the visitor’s browser.

An active Lounastaja account with access to website widgets is required. Lounastaja is a paid external service. The WordPress plugin is free; service subscriptions are managed separately by Lounastaja.

Obtain the widget ID and API key from your Lounastaja widget’s embed code. For help obtaining these values, contact Lounastaja through lounastaja.fi.

The shortcode supports an explicit language. Without it, the plugin uses Polylang or WPML when available; otherwise, the service and browser widget determine the language.

Successful HTML responses are cached for up to one hour. An hourly WP-Cron task clears fragments and requests page-cache purges for remembered single posts and pages through supported cache plugins. WP-Cron timing depends on the site’s configuration and traffic. Hosting and CDN caches may cause additional delays; the plugin does not guarantee a one-hour maximum across every cache layer.

External services

This plugin connects to Lounastaja at https://lounastaja.app to retrieve and display the selected restaurant’s lunch menu.

Connections take place when a page containing a configured shortcode is rendered and its HTML fragment is not cached, and when the visitor’s browser loads the widget. The browser may make further requests according to widget settings, including automatic refresh and interactive features.

  • WordPress requests /api/v1/widget/{api_key}/{widget_id}/html, sending the configured API key, widget ID and language when provided. The service also receives the WordPress server’s IP address and normal HTTP request metadata.
  • The browser loads /widget/base.min.js, widget templates and menu data from Lounastaja. Browser requests expose the visitor’s IP address and normal HTTP request metadata to the service. The widget uses the configured API key and widget ID to request its data.
  • The plugin’s PHP code does not send WordPress user accounts, passwords or post content. Optional features supplied by the service, such as feedback or newsletter forms, may make additional connections when used and must be considered when configuring the widget.

External widget requests begin after a shortcode with an API key and widget ID is added to a page. Activating the plugin alone does not fetch a menu or load the widget script.

The defaultWeek widget template loads the Roboto font through Google Fonts when that template is displayed. The visitor’s browser connects to fonts.googleapis.com and fonts.gstatic.com to retrieve the stylesheet and font files, exposing the visitor’s IP address and normal HTTP request metadata to Google.

  1. Upload the lounastaja plugin folder to /wp-content/plugins/, or install its ZIP through Plugins > Add New > Upload Plugin.
  2. Activate Lounastaja through the Plugins screen.
  3. Obtain your widget ID and API key from your Lounastaja widget’s embed code.
  4. Add the shortcode to a post or page, replacing the example values with your widget’s values.

    [lounastaja-widget widget_id=”WIDGET_ID” api_key=”API_KEY”]

To select a language:

[lounastaja-widget widget_id="WIDGET_ID" api_key="API_KEY" lang="en"]

widget_id and `api_key` are required. A shortcode missing either returns no content. Use a language supported by your widget. Regional codes such as `en_US` and `en-US` are normalized to `en`.
Do I need a Lounastaja subscription?

Yes. You need an active account with access to website widgets, a widget ID and an API key. This plugin does not create an account or subscription.

Is the menu included in the page HTML?

Yes, when WordPress retrieves a valid HTML fragment. If the request fails, the container remains available for the browser widget. Server-side requests are retried after a one-minute failure cache expires. A full-page cache can retain an earlier response.

How often does the menu update?

The HTML cache lasts up to one hour. The hourly purge uses WP-Cron; browser refresh behavior is controlled by the widget. Page, hosting and CDN caches may cause additional delays.

Which languages are supported?

Use lang to select a language available in your widget. When omitted, Polylang or WPML can supply the page language.

Where can I get help?

Contact Lounastaja through lounastaja.fi. Do not share private account credentials.

1.0.4

  • Sanitize the lunch-list fragment with the HTML WordPress allows in post content before storing or printing it.

1.0.3

  • Accept only responses whose content type is text/html.

1.0.2

  • Pass the selected shortcode language to the browser widget.
  • Require HTML responses to contain the Lounastaja fragment marker.
  • Add service documentation and GPL license metadata for WordPress.org distribution.
Back to top