Restaurant Location Order Redirect releasesself-updates
WordPress plugin: multi-location geo-based Order Now redirect for restaurant websites
by Digi-Pro · github.com/chatgpta67-blip/restaurant-location-redirect · website
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/chatgpta67-blip/restaurant-location-redirect/releases/download/v1.0.9/restaurant-location-redirect.zipShips its own WordPress updater (built-in updater), so new versions show up under Dashboard → Updates.
Readme
=== Restaurant Location Order Redirect === Contributors: digipro Tags: restaurant, geolocation, redirect, multi-location, elementor Requires at least: 5.8 Tested up to: 6.6 Requires PHP: 7.4 Stable tag: 1.0.9 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html
Detects a visitor's likely restaurant location and dynamically points "Order Now" buttons to the correct location-specific ordering URL, with a manual selector fallback.
== Description ==
For a restaurant brand with multiple locations, each with its own external ordering URL, this plugin:
- Lets an administrator manage locations (name, city, state, country, order URL, active status) from Settings → Location Order Redirect.
- Detects a visitor's approximate location via server-side IP geolocation (provider configurable; API keys never reach the browser).
- Matches the detected location against configured locations using a city → state → country → proximity hierarchy, with a configurable confidence threshold.
- Dynamically updates every "Order Now" button (matched via a configurable CSS selector) to the correct location's order URL — no per-button editing required, and it works with Elementor.
- Falls back to a "Select Your Location" popup whenever detection is missing, ambiguous, or fails, so the visitor is never stuck.
- Remembers the visitor's manual choice (cookie/localStorage, configurable duration) and always treats a manual choice as authoritative over IP detection.
- Works safely behind full-page caching and CDNs: no visitor-specific HTML is ever rendered server-side.
- Includes optional, privacy-conscious, disabled-by-default analytics with an internal dashboard and an opt-in GA4 integration hook.
See docs/README.md in the plugin folder for full installation, configuration, Elementor, geolocation-provider, analytics, testing, security, and privacy documentation.
== Installation ==
- Upload the
restaurant-location-redirectfolder to/wp-content/plugins/, or upload the ZIP via Plugins → Add New → Upload Plugin. - Activate the plugin through the Plugins menu.
- Go to Settings → Location Order Redirect → Locations and add your restaurant locations.
- Go to the General tab and set the CSS selector that matches your Order Now buttons.
- (Optional) Go to the Geolocation tab to choose a provider and, if required, add an API key.
== Frequently Asked Questions ==
= Does this work with Elementor? =
Yes. Add the configured CSS class (default order-now or order-now-button) to any Elementor button's Advanced → CSS Classes field. The plugin updates the href of matching elements after the page loads.
= Will this break my page cache? =
No. All HTML is static and identical for every visitor. Location detection and button updates happen entirely in the browser via JavaScript and a REST endpoint that is sent with no-cache headers.
= What happens if geolocation fails or is inconclusive? =
The visitor sees the "Select Your Location" popup and can choose manually. The rest of the site is unaffected.
== Changelog ==
= 1.0.9 =
- Added: creating, editing, deleting, or activating/deactivating a location now automatically purges LiteSpeed Cache (if installed), so a newly-added or edited location shows up immediately instead of waiting for the next natural cache expiry. The active-locations list is rendered directly into page HTML for cache-safety (identical for every visitor, so it's safe behind full-page caching), which also means a page cached before a change stays stale until purged -- this closes that gap for LiteSpeed specifically. Harmless no-op on any other host/caching setup.
= 1.0.8 =
- Changed: [rlr_order_button] now renders two separate, independently-clickable elements instead of one combined string -- a small outlined "state" pill (click it to change location, showing e.g. "AZ") sitting next to a filled Order Now button. The pair sits in a flex-wrap container so it wraps onto a second line in a tight header instead of overflowing it.
= 1.0.7 =
- Added a
[rlr_order_button text="Order Now"]shortcode: a plugin-rendered, plugin-styled Order Now button, as an alternative to matching an existing theme/Elementor button via the CSS selector setting. Because the plugin owns the markup and CSS, the state-code badge always has room to display (no more clipping from an unknown theme's fixed-width/overflow button styles, which was cutting the badge off on mobile). Before a location is known, clicking the button opens the location popup instead of navigating; once a location is known (auto-detected or picked), it shows the badge and clicking it goes straight to that location's order URL.
= 1.0.6 =
- Fixed: a critical bug in 1.0.5's Order Now button state-code badge could freeze the page for every visitor. The badge was rewritten on every reapplication (including reapplications triggered by the plugin's own "watch for new buttons" observer), and each rewrite counted as page activity that triggered the same observer again, looping indefinitely and pegging the browser tab. Reapplying an unchanged badge is now a true no-op. Sites running 1.0.5 should update immediately.
= 1.0.5 =
- Added: matched Order Now buttons now show a short state-code badge next to the label (e.g. "Order Now (AZ)"), derived automatically from the location's State field. Recognizes standard US state/territory names and already-2-letter codes; a state value that isn't recognized (e.g. a non-US region) simply shows no badge.
= 1.0.4 =
- Fixed: the admin debug block (detected IP/country/state/city) never appeared from /detect, even with Debug Mode enabled and while logged in as an administrator. The request was missing the X-WP-Nonce header, so WordPress's REST cookie authentication treated it as an anonymous visitor regardless of the active login session. Fixed in both the Debug & Help "Run Detection Test" button and the frontend debug panel.
= 1.0.3 =
- Fixed: the "Run Detection Test" and "Simulate a Detected Location" buttons on the Debug & Help tab silently did nothing. Their inline script ran before wp_localize_script's footer-printed config existed, so it exited before attaching any click handlers. Deferred to DOMContentLoaded. (This bug affected Run Detection Test since 1.0.0.)
= 1.0.2 =
- Added an admin-only "Simulate a Detected Location" tool (Debug & Help tab) that runs the city/state/country/proximity matching logic against typed-in values, with no real geolocation API call — for verifying matches from anywhere without a VPN.
= 1.0.1 =
- Removed unused translation files from the bundled update-checker library to reduce the plugin's file count (some hosts fail to fully extract/move very large numbers of small files during install).
= 1.0.0 =
- Initial release.
Read the full README on GitHub →
Releases
| Tag | Published | Asset | Downloads |
|---|---|---|---|
| v1.0.9 | Sep 1, 2026 | restaurant-location-redirect.zip | 2 |
| v1.0.8 | Sep 1, 2026 | restaurant-location-redirect.zip | 1 |
| v1.0.7 | Sep 1, 2026 | restaurant-location-redirect.zip | 1 |
| v1.0.6 | Sep 1, 2026 | restaurant-location-redirect.zip | 1 |
| v1.0.5 | Sep 1, 2026 | restaurant-location-redirect.zip | 1 |
| v1.0.4 | Aug 26, 2026 | restaurant-location-redirect.zip | 2 |
| v1.0.3 | Aug 26, 2026 | restaurant-location-redirect.zip | 1 |
| v1.0.2 | Aug 26, 2026 | restaurant-location-redirect.zip | 1 |
| v1.0.1 | Aug 26, 2026 | restaurant-location-redirect.zip | 1 |