=== Web Directory Free ===
Contributors: mihail-chepovskiy
Donate link: https://www.salephpscripts.com/
Tags: directory, business directory, listings, maps, store locator
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A searchable business directory for WordPress: categories, locations, custom fields and interactive Google, Mapbox or MapLibre maps.

== Description ==

Web Directory Free turns WordPress into a searchable business directory. Sort listings into categories, locations and tags, build your own listing form, drop the directory onto any page with a shortcode, and let visitors search and browse — on a list or an interactive map.

In the free edition you add and edit listings from the WordPress admin, and visitors browse, search and view them on the front end.

**Live demo:** https://directory.salephpscripts.com/

**Key features**

* Categories, locations and tags to organise your listings.
* A listing-form builder — add your own fields (text, select, checkbox, price, opening hours, date, website, email, and more).
* Maps with Google Maps, Mapbox or MapLibre (MapTiler tiles), per-category marker icons and clustering.
* Advanced search: by category, location, custom fields, and address + radius search.
* Google reCAPTCHA on the listing contact form.
* CSV import and export for bulk listing management.
* Translation-ready: ships a POT file for any standard gettext/PO editor.
* Fast on large directories: marker clustering and on-demand loading keep thousands of listings responsive.

This plugin uses external services (map providers and, if you enable it, Google reCAPTCHA). See the **External Services** section below.

**Upgrading**

The full version of Web 2.0 Directory adds front-end paid submission, membership plans and WooCommerce checkout for paid, featured, renewed and upgraded listings. Those modules are not part of the free edition.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`, or install the ZIP via Plugins -> Add New -> Upload Plugin.
2. Activate **Web Directory Free** from the Plugins menu.
3. Open the settings page, pick your map engine and enter its API key/token (Google Maps API key, Mapbox token, or MapTiler key).
4. Create your categories and locations, build the listing form, add listings, and place the directory on any page with the shortcode.

== Frequently Asked Questions ==

= Who can add listings in the free edition? =
Listings are created and edited from the WordPress admin. Front-end submission (with optional moderation, expiration and renewal) is part of the full version.

= Do I need API keys? =
For maps, yes — each map provider needs its own key/token, entered on the settings page. Keys are stored on your site and are never sent to us.

= Which map providers are supported? =
Google Maps, Mapbox, and MapLibre with MapTiler tiles. You pick one on the settings page.

= Is it translation ready? =
Yes. A `languages/w2dc.pot` template is included; translate it with any standard gettext/PO editor.

= How do paid listings and membership plans work? =
Paid submission, membership plans and WooCommerce checkout come with the full version of Web 2.0 Directory, not the free edition.

== External Services ==

Web Directory Free uses the following third-party services. Nothing is sent until you use the matching feature:

* Map providers (Google Maps, Mapbox, MapTiler / MapLibre) — when a map loads or an address is geocoded, the request (coordinates, the address being searched, and your API key/token) is sent to the provider you chose. See that provider's terms and privacy policy.
* Google reCAPTCHA — when you turn it on for the contact form, the visitor's interaction is checked with Google. See Google's terms and privacy policy.

The free edition does not contact the author's servers: it gets updates through WordPress.org and does no license or "phone-home" checks.

== Changelog ==

= 2.1.0 =
* New: the [webdirectory-listings] shortcode accepts "categories" and "locations" attributes (term ids or slugs, comma-separated) to pin a listings grid to specific categories/locations.
* New: label-type map markers (the Rating chip and field-value labels) now take per-source background AND text colours — set them in Edit Map → Markers (the same colour control the dots use); background default white, text default #333. The Opening hours label gets two backgrounds — one for Open, one for Closed.
* Fix: the rating field's "Icon size (px)" box (search-form builder and the directory's rating element) now accepts any value you type — it no longer jumped to the maximum when you typed a smaller number such as 20.
* Improvement: the [webdirectory-map] shortcode now takes a map by id, slug or name — use id="..." (the old map_id still works) — and with no map given it shows all listings on a map with the default settings.
* Fix: a directory whose page is built with the [webdirectory custom_home] shortcode (for example inside a page builder like Divi or Elementor) is now recognised as that directory's page, so "Open page" opens it instead of offering to create a duplicate.
* Fix: migrating a custom field whose icon was an uploaded image no longer produces a broken icon — such fields fall back to their default icon.
* New: an alternative HTML marker mode — map markers rendered as real DOM elements instead of on the canvas, switchable in the Markers "Advanced" panel (canvas stays the default).
* Fix: a label marker’s connector “tip” no longer detaches or collapses to a sliver at steep/diagonal angles — it now hugs the pill’s rounded corner cleanly (canvas and HTML markers).
* Fix: the directory layout now adapts at the tablet / mobile endpoints set in the layout editor, instead of a fixed ~782px width.
* Fix: the on-map search form's collapse toggle is now shown only in full-screen — where its folded/expanded state is remembered — so leaving full-screen returns the form to expanded instead of leaving it stuck folded on the page.
* Fix: the search form's Radius slider spans the full form width now, aligned with the other fields (its stray side padding is gone).
* New: a Globe projection option for Mapbox and MapLibre directory maps (Edit Map, next to the map style) — a 3-D globe when zoomed out, flattening to the normal map as you zoom in.
* Fix: in the setup wizard, the map step opens the map created during setup or migration instead of starting a blank one and leaving you a duplicate.
* Improvement: the directory's Map element shows a "Create new map" button when the site has no maps yet, instead of an empty picker.
* Fix: the rating marker's text size now actually resizes the label on Mapbox and MapLibre maps, and markers stay locked to their spot while the globe rotates.
* Fix: the directory map no longer shows a false "Google Maps API key is not configured" notice when the key is set — it was removing its own map script along with conflicting ones.
* Fix: permanently deleting a listing no longer leaves empty "ghost" cards in its directories — stale search-index rows now go with the listing, so the results count matches.
* Fix: words no longer break in the middle at the end of a line. The 4-line trim on Content and other text fields used a legacy CSS box that ignored word-wrapping rules (most visible in Firefox); it now trims by height, so text wraps at spaces. Pasted text is also cleaned of invisible characters that force breaks, and the listing page's field values and the directions panel are covered too.
* Fix: the admin reminder about a missing Google Maps API key shows its bold text and settings link instead of raw HTML tags.
* Fix: in the listing-form builder, a field's chosen icon shows in the Field Properties panel right away instead of looking blank until you re-select it.
* Fix: in the listing-form builder, dropping a field back in the same place no longer leaves it dimmed.
* Fix: deactivating and reactivating the plugin no longer breaks permalinks — rewrite rules are flushed on the next page load, once the post types and URL rules are registered.
* New: give a directory a default filter (category, location, tag, author, custom fields or specific listings). A visitor's search overrides it field by field.
* New: "Hide listings until search" option for the Listings block — the grid stays empty until the visitor searches.
* New: a Slider element for directories — a looping, swipeable carousel of listing logos with an optional name, rating and "Featured" badge. Also the [webdirectory-slider] shortcode and WPBakery / Elementor elements.
* New: the listing-page Images gallery gains a Display option — Gallery or Slider; clicking an image still opens the lightbox.
* New: a one-click front-end self-test that checks the directory works on the live site, catching problems caused by other plugins.
* Improvement: with "Follow the map" on, the Listings block shows the map's matching listings as the normal grid — count, sort and pagination — instead of the scrolling sidebar.
* Performance: on a page with a map and search but no listings grid, the map search loads only the markers.
* Fix: on page-builder pages (Elementor, WPBakery, blocks), listing links point to the correct directory URL instead of the raw /w2dc_listing/ address.
* Fix: when editing a map, the live preview applies unsaved settings again (style, colours, controls).
* Fix: the image lightbox's previous / next arrows are vertically centred whatever the theme's button styles.
* Fix: migration now carries over the map engine and API key, and no longer adds a map where the old site had none.
* Fix: migrated directories come with a working search form (Address, Radius, Keyword, Categories, Locations) instead of an empty search area.
* Fix: with Yoast SEO, listing, category and location pages get their own page title again.
* Fix: a website address can be entered without "https://", and an email pasted with a stray space is no longer rejected.
* Improvement: the reCaptcha settings page lists which forms reCAPTCHA protects, above the enable switch.
* New: a dismissible notice on the plugin's admin pages introducing the full Web 2.0 Directory edition (front-end submission, membership & payment plans, technical support).
* Fix: when a cookie-consent plugin (for example Avada's Privacy option) holds back the Google Maps script, the map now says it is waiting for consent — and loads once cookies are accepted — instead of "Google Maps API key is not configured".
* Fix: an enabled "Content" field shows on listing cards and map popups again. On some sites (typically after migrating) it was silently dropped even though the listing editor still showed it.
* Fix: the listings pager no longer shows the theme's bullet points in front of the page numbers.
* Fix: "Show radius circle" now works on the live map, not just the Edit Map preview — drawn at load from the map's own "Show markers in radius" radius, moved to a visitor's address + radius search, and framed by the camera when it is wider than the saved zoom.
* Improvement: listing cards, map popups and the map sidebar lead with the photo as a cover image — flush to the top edge, rounded top corners, softer card corners.
* Developer: the shared listing-field markup (cards, map popups, sidebar) now carries neutral `…-listing-content__*` class names alongside the historical `…-popup__*` ones. Custom CSS keyed on the old names keeps working — they are kept as deprecated aliases.
* Improvement: a new directory opens with its General settings filled in — labels, slugs and the listing form template — instead of blank boxes. These are the values it already used behind the scenes, so existing directories are unchanged.

= 2.0.5 =
* Fix: choosing a different main image (logo) — or reordering a listing's images — now takes effect on the front. The listing renderer was reading a pre-rebuild image key and ignored edits made in the editor, so the main image "stuck" on the first image; it now honours the current image order and the chosen logo.
* New: a listing's images can be reordered by dragging their handle in the editor — the first image (or the one marked as the logo) becomes the main image.
* New: the on-map search form gains a collapse/expand toggle beside the drag handle — both shown by the "Allow form drag and toggle" option (Edit Map → Search form).
* Fix: after migrating a legacy site, category / location / listing links no longer open the directory home instead of the right page — the migration deterministically rebuilds the directory URL rules, and a "Rebuild directory routing" button on Tools → W2DC Migration re-applies them on demand.

= 2.0.4 =
* Fix: migrating from a legacy directory no longer risks published listings being switched to Draft — old carried-over expiration dates are grandfathered to "never expire" and the hourly expiration check is paused until the migration finishes (with automatic repair of any listings a previous run had suspended).
* Fix: the migration no longer stalls with an "Unexpected token" error on large sites — the heaviest step now runs one custom field per request and automatically retries and resumes after a server timeout.
* Fix: listing and directory links work right after migration — permalinks are refreshed automatically (no need to re-save Settings → Permalinks).
* Fix: the "Preview" button and "View Listing" link are back on the listing editor.
* Fix: migrated directories show a working map instead of an empty map area.
* New: the directory elements are available in both the WPBakery / Visual Composer and Elementor page builders, using the same element names, so pages built with them render and stay editable.
* New: listing cards gain a Cover / Contain image-fit option alongside the aspect-ratio control.

= 2.0.3 =
* New: a "Map language" setting — show Google Maps place labels, Places autocomplete and the geocoder in a chosen language (e.g. English), independent of the site language.
* Fix: a new listing created in the WordPress admin now publishes reliably even when the form takes more than a minute to fill in — WordPress' autosave could previously leave it as an unpublished draft that was missing from the Listings list and the map.
* Fix: the public directory map no longer breaks with a "Cookie check failed" (403) error on cached pages or after a long-open session — its read-only data is now fetched without a REST nonce, so full-page caches and expired sessions can't stop it loading.

= 2.0.2 =
* Security: only users allowed to submit listings can upload files; uploads are limited to safe file types and a maximum size, and low-privilege users are rate-limited.
* Security: through the API, users can now only view and edit their own listings.
* Security: anonymous star ratings are counted once per visitor and rate-limited (with optional reCAPTCHA) to stop rating spam.

= 2.0.1 =
* Packaging: restore the historical main plugin file name so updates from earlier versions apply cleanly without deactivating the plugin. No functional changes.

= 2.0 =
* Rebuilt on the shared SalePHP engine: the directory core (categories, locations, tags), the custom listing-form builder, maps (Google, Mapbox, MapLibre) and advanced search.
* Hardened request-input sanitization across admin handlers; added a nonce and capability check to the license-notice endpoint; guarded a CSV image path against traversal.
* No self-hosted updater or license checks — updates are delivered through WordPress.org.
* Trimmed the bundled demo payload (removed compressed archives and the large country sample data).
* Routed internal diagnostics through a WP_DEBUG-gated logger so production logs stay quiet.
