=== Web Directory Free - AI powered ===
Contributors: mihail-chepovskiy
Donate link: https://www.salephpscripts.com/
Tags: directory, classified plugin, listings, maps, ai
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A WordPress directory plugin for business listings: categories, locations, fields, maps, and AI that writes the listing fields for you.

== Description ==

Web Directory Free is a WordPress directory plugin that turns your site 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 - as a list, as cards, or on 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.

= AI that writes the listing, and search by sentence =

Add a key for a free AI service and a Write button appears beside the listing description: it reads the entry name, its categories and its location, and drafts the text. Nothing is sent anywhere until you enter that key, and the fields a person has to state as fact - prices, phone numbers, dates, opening hours - are never generated, because a plausible invented price is worse than an empty one.

The free edition ships with Groq, which has a free tier that needs no payment card. The separate **AI Assistant Add-on** widens it: OpenAI, DeepSeek, Mistral, OpenRouter and Google Gemini as further services, a Write button on every text field on the form instead of the description alone, and one control that fills every empty field in a single request so the texts agree with each other.

The add-on also brings assisted search. A visitor writes what they are after as a sentence, "a cheap place open on Sunday that takes cards", and it is read into the search form's own filters rather than into the keyword box: the category, the location and the distance, the sliders and the dropdowns your form carries. Only values the form actually offers are set, every one of them is shown above the results as a chip the visitor can drop, and a filter they set or cleared themselves is left exactly as they left it. A one-word search is answered the way it always was, without asking the model at all. The add-on is a plugin of its own and is managed from the same AI settings tab.

**Live demo:** [directory.salephpscripts.com](https://directory.salephpscripts.com/)

= What you can build =

A local business directory, a member or staff directory, a property or vehicle catalogue, a venue or event guide, a service-provider index, a classifieds board. Anything that is a list of places or things with fields, categories and a map.

= Organise your listings =

* **Categories and locations** are hierarchical, so Country, Region, City nests the way you expect, and each level gets its own page.
* **Tags** for the cross-cutting labels that do not fit a hierarchy.
* Each category can carry its own **marker icon and colour**, so the map reads at a glance.
* Every category, location and tag page is a real URL with its own listings, search and map.

= Build the listing form yourself =

The form builder is drag and drop: arrange fields in rows and columns, and add your own on top of the built-in ones. Field types included:

* Title, Content, Excerpt
* Categories, Tags
* Address and Map
* Images & Videos - photos plus YouTube or Vimeo links, shown in one gallery with a lightbox
* Contact info, Phone, Email, Website URL
* Text/string, Number, Price
* List - as a dropdown, radio buttons or checkboxes
* Date-Time
* Opening hours
* File upload

Every field can be placed independently on the listing card, the listing page, the search form and the map popup, so a field can be searchable without cluttering the card.

= Put the directory anywhere =

Each directory has a page builder: choose which elements appear on the home, category, location and listing pages, and in what order - search form, map, categories block, listings grid, slider, breadcrumbs, page title, buttons.

If you would rather place things by hand, every element is also a shortcode: `[webdirectory]`, `[webdirectory-search]`, `[webdirectory-map]`, `[webdirectory-listings]`, `[webdirectory-categories]`, `[webdirectory-locations]`, `[webdirectory-slider]`, `[webdirectory-breadcrumbs]`, `[webdirectory-listing-page]` and more. They work in the block editor, in Elementor and in WPBakery.

= Maps =

* Three engines: **Google Maps**, **Mapbox** and **MapLibre** with MapTiler tiles. Pick per site.
* Marker **clustering**, so thousands of listings stay usable.
* Per-category and per-listing **marker icons**.
* Rich **popups** built from the fields you chose, with the listing photo.
* A **map sidebar** that lists what is currently in view, and follows as the visitor pans.
* **Radius search** from an address, in miles or kilometres.
* Several layouts, including a full-width hero map and a sticky map beside the listings.

= Search that finds things =

The search form is built the same way as the listing form: drag in the elements you want.

* Keyword, categories, locations, address plus radius, rating.
* Any custom field you added becomes a filter - a price range, a number range, a date, a dropdown.
* A "More filters" separator to keep the visible form short.
* Sorting by newest, oldest, title, rating, random, or any numeric or date field you defined.
* Grid and list views, with the visitor's choice remembered.
* With the AI Assistant Add-on, a whole sentence instead of a form: the filters above set themselves from it, and the visitor can drop any of them.

= Ratings =

Built in, no add-on: visitors rate a listing, the average shows on the card, the listing page and the map popup, and rating becomes a search filter and a sort option. Ratings can be switched off entirely.

= Bulk work =

* **CSV import and export** for listings, including categories, locations, tags, custom fields, images and video links. Import creates or updates; export round-trips.
* A **thumbnail regeneration** tool for when you change image sizes.

= Housekeeping =

* **Colour palette** controls so the directory matches your theme, with several presets.
* **Email notifications** with editable subjects, each one switchable.
* **Google reCAPTCHA** (v2 or v3) on the listing contact form.
* A **diagnostics page** that checks the directory is wired up correctly and tells you what to fix if it is not.
* An **install wizard** that creates the pages and the first directory for you.
* **Translation ready**: ships a POT file for any standard gettext or PO editor.
* Built for **large directories**: a dedicated search index and sort index keep tens of thousands of listings responsive, and both rebuild in the background.

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

= What is not in the free edition =

Front-end submission. In the free edition listings are created and edited in the WordPress admin; visitors browse and search. The paid version adds front-end submission with membership plans, listing expiry and renewals, and WooCommerce checkout for paid, featured and upgraded listings.

**Get the full version:** [Web 2.0 Directory on CodeCanyon](https://codecanyon.net/item/web-20-directory-plugin-for-wordpress/6463373)

== 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.
* Groq (AI writing) - only when you have entered a Groq API key and pressed a Write button. What is sent is the text the draft is built from: the entry name, its categories, its location and the fields already filled in. Nothing is sent without a key, and no key ships with the plugin. See Groq's terms (https://groq.com/terms-of-use/) and privacy policy (https://groq.com/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.

== Screenshots ==

1. Setup wizard progress bar on the Settings step, showing the numbered stepper and Next button.
2. Setup wizard on the Form Builder step, showing the drag-and-drop listing form editor.
3. Setup wizard on the Edit Directory step, showing the directory page builder canvas.
4. Setup wizard - Demo content step: choose sample listings to import (adds a Demo tab to the CSV import screen).
5. Setup wizard - Create a map step: build your first standalone map before finishing setup.
6. The Create page with this directory button in the Edit Directory toolbar, which publishes a page containing the [webdirectory id=N] shortcode.
7. A published directory page (a page containing [webdirectory]) as visitors see it - page title, search form, category grid, map, and listings grid together.
8. The directory search form rendered by the search element, showing the keyword, location, and taxonomy filters.
9. The member dashboard 'My Listings' tab, where users manage their own listings.
10. The four top-level menus Web 2.0 Directory adds to the WordPress admin sidebar: Directories, Directory listings, Maps and Directory Admin.
11. Creating a directory: the General settings (labels, URL slugs, listing template) on the left of the directory edit screen.
12. The drag-and-drop Form Builder assembling a listing form from the field palette (text, price, date, opening hours, address, image upload).
13. A category term's icon picker offering a Font Awesome glyph with colour, a bundled PNG, or an uploaded image.
14. Choosing the map engine (Google Maps / Mapbox / MapLibre + MapTiler), entering the API key, and using the Test map engine keys button.
15. Building the on-map search form by dragging keyword, address+radius, category and custom-field slots onto the canvas.
16. The Customization tab under Directory Admin -> Settings, showing the Color palette dropdown and the Main colors / Links & buttons / Images sections.

== Changelog ==

= 2.3.1 - 2026-09-22 =
* New: the price can stand out in map popups, the sidebar and cards: badge, divider, accent colour, smaller currency sign and font size. On cards, a price placed last sits on the bottom edge, so prices line up.
* New: "Hide from anonymous users" for field groups. Logged-out visitors see the group title and a login prompt instead. Migrated groups keep this setting.
* New: WPML and Polylang support. Maps, listings, search and counts show the page's language. Each listing keeps one set of markers and one search-index entry for all its languages. Listing fields are copied to translations.
* New: settings per language on WPML and Polylang sites. Emails, AI prompts, the address format, the map language and a few more can differ per language. Emails go out in the listing's language.
* New: form templates per language on WPML and Polylang sites. Field names, help texts and option labels can be translated.
* New: plans per language on WPML and Polylang sites. Plan names, descriptions, badges and feature lines can be translated.
* New: directories per language on WPML and Polylang sites. The directory name, URL segments and form labels can be translated. Each language gets its own URLs.
* New: map search forms per language on WPML and Polylang sites.
* New: CSV import and export on WPML and Polylang sites. Translations go in the same row, in columns like title:fr or categories_list:fr.
* New: image and video captions per language on WPML and Polylang sites.
* New: the Submit button reads "Submit new ..." with the directory's singular label, as in earlier versions.
* New: right-to-left languages (Arabic, Hebrew, Persian). Directory pages, cards, popups, the sidebar, forms and the lightbox read from the right.
* New: "No maps" map engine, first in the list and the default on new installs. The directory then shows nothing about maps. Saved maps are kept for later. Legacy sites without maps migrate to it.
* Improvement: the migration keeps how listing images looked: logo fit, ratio, list width and gallery crop.
* Improvement: the demo export works on WPML and Polylang sites.
* Improvement: CSV category, location and tag columns also accept term IDs.
* Improvement: on WPML and Polylang sites, a new listing is saved in the language of its form.
* Improvement: on a listing page built from elements, category and directory links open without a full reload.
* Improvement: form builder: a group's categories are picked like a field's, with "Show for all categories".
* Improvement: the setup wizard now ends by creating the directory page ("My First Directory" with [webdirectory]), or opens it if it exists. No map step.
* Improvement: the plugin's admin menu items stay together.
* Improvement: a new Buttons element has all buttons on.
* Improvement: the Reset page also deletes directories, plans, claims and terms, and trashes the directory pages. "Everything" also removes hidden and per-user data. Settings of the old version are kept until it is migrated.
* Improvement: sticky listings now come first in every sort except Random, Distance and Relevance.
* Performance: a directory page without a map runs one search instead of two.
* Fix: sorting by date is correct on sites not in UTC.
* Fix: the CSV import reads the image captions column.
* Fix: map popups no longer indent fields without an icon.
* Fix: a field with its icon turned off no longer leaves a gap.
* Fix: the "Get directions" button looks right again.
* Fix: fields line up with icons in the map sidebar and on cards.
* Fix: other plugins' links on a listing page keep their own colours.
* Fix: Card image fit also works in list view.
* Fix: a site migrated from Web 2.0 Directory keeps its maps. Sites already migrated get them back once.
* Fix: a bold or italic directory shortcode no longer breaks the listing page.
* Fix: a field group shows only when one of its fields does. The listing page hides fields meant for other categories.
* Fix: the two handles of a price or number slider can no longer meet.
* Fix: the REST SQL profile (?w2dc_sql_debug=1) works after redirects and can be turned on from an admin page.
* Fix: sorting by title is fast on large directories.
* Fix: an untouched price or number slider no longer filters out listings without a price.
* Fix: no broken Purchase code row in the free edition's settings.
* Fix: the free edition no longer offers front-end submission. Its settings are dimmed and marked as full-version features.
* Fix: the form template editor no longer shows a duplicate "Edit Template" heading.
* Fix: no grey gap under the wizard bar on the Form Builder step.
* Fix: the wizard bar stays visible above the block editor.
* Fix: the Submit button is hidden when the directory's "Allow submission" is off.
* Developer: the sidebar and cards now use `w2dc-listing-content__*` classes instead of `w2dc-popup__*`. Update custom CSS that targets them.
* Developer: the `popup` field formatters are renamed to `listing_content`. The old names still work.

= 2.3.0 - 2026-09-16 =
* New: the plugin is now Web Directory Free - AI powered. AI writes your listing text. Add a key for an AI service - Groq ships with the plugin and its free tier needs no payment card - and a Write button appears beside the description: it reads the entry name, its categories and its location, and drafts the text. Nothing leaves the site until a key is entered, and the fields a person has to state as fact - prices, phone numbers, dates, opening hours, web addresses - are never generated, because a plausible invented price is worse than an empty one. Settings, AI is where the keys, the per-field switches and the per-visitor limits live.
* New: the AI tab says whether the AI Assistant Add-on is installed, installs and activates it for you when it is not, and tells you when a newer one has been published. One button on that tab, with no trip to the Plugins screen; the zip is still there to download if your server will not let WordPress write to its own plugins folder. The add-on brings OpenAI, DeepSeek, Mistral, OpenRouter and Google Gemini, a Write button on every text field on the form rather than the description alone, one control that fills every empty field in a single request so the drafts agree with each other.
* New: assisted search. With the AI Assistant Add-on installed, a visitor can write what they are after as a sentence - "a cheap place open on Sunday that takes cards" - and it is read into the search form's own filters: the category, the location and the distance, the sliders and the choice fields your form carries. Nothing is invented; only values the form actually offers are set, and every one of them appears above the results as a chip the visitor can drop. A filter they set or cleared themselves is left exactly as they left it, so the sentence fills in the rest rather than overruling them. A one-word search is answered the way it always was, without asking the model at all, and the form can mark the fields the AI filled in if you want it to.
* Improvement: a price is shown in bold and in the primary colour, so the number a visitor is looking for stands out from the rest of the card.
* Improvement: a position found with "Find my location" is kept to about a metre rather than to eleven centimetres, everywhere it is kept - in the browser, and in what the search sends on. The link you can share still blurs it to roughly a hundred metres.
* Fix: a field carries an icon only when you chose one for it. Several field types drew a built-in icon of their own on the listing card and in the map popups, so switching the icon off in the form builder changed nothing, and fields you had never given an icon to had one anyway.
* Fix: the icon you picked for a map marker is drawn again. A marker saved by name rather than by its full class came out as an empty pin, on the map and in the small preview beside it.
* Fix: fields line up down one edge whenever any field in the block has an icon, so a field without one no longer sits half a character to the left of its neighbours. Categories, tags and rating are laid out on their own and keep their full width.
* Fix: an icon is stored by its name rather than under the plugin's own prefix, so a form template exported from one site carries its icons into another. Templates already saved are converted once, on an admin page load.
* Fix: the start position you pick for a map in the form builder is stored to about a metre, rather than with the fifteen digits the map engine hands over. An existing position is shown at that precision the moment the form builder opens.
* Fix: a new map starts at the zoom the form builder's start position was framed at. The fraction was being dropped rather than rounded, so a preview framed at 7.66 handed the new map a 7, half a level wider than what you set up.

= 2.2.2 - 2026-09-14 =
* New: the search can be kept in the page address. Turn it on for a search form and whatever the visitor searched for is added to the address, so a filtered result can be bookmarked, sent to someone, or opened in a new tab and come back exactly as it was. Off by default, so a form meant to start clean every time is unchanged. A position found with "Find my location" is rounded to about a hundred metres before it goes anywhere near a shareable link, and a filtered address is marked as one search engines should follow but not index, so one page does not turn into thousands of near-duplicates.
* New: the filters currently in force are shown above the results, one chip each, and a click on a chip drops that filter and searches again. Every filter appears there whatever set it: a dropdown, a slider, a saved draft, or a link somebody sent you. Several categories give several chips, so dropping one does not drop the rest. The chips describe the search that actually ran, not whatever is typed into the form at that moment.
* New: the search element of a directory carries the same "keep the search in the address" switch as the search form of a map, set per element in the directory builder.
* New: a phone number and an email address on a listing are now links: the number dials, the address opens a mail window, and a number whose mode is set to WhatsApp, Viber or Telegram opens that app instead. This works everywhere a field is shown - the cards in a list or a grid, the map popups and the listing page. The three messenger links are only built from a number written in international form, one that starts with + or 00, because none of those services checks what it is handed: a number missing its country code is not refused, it is read as belonging to another country, and the visitor is put through to a stranger. Such a number is left as plain text in those three modes; as an ordinary phone number it still dials.
* New: a Relevance order in the sort list. When a phrase is searched the results are ranked by how well they match it, which they always were, but the dropdown went on saying "Newest first" while showing something else. Relevance now appears as its own row while a phrase is being searched, is selected on its own when a new phrase arrives, and disappears when the phrase does. Where an address is searched too, distance still wins: a named place is the more specific request.
* Improvement: Tools, Site Health now answers "can this server reach the services this site uses". Every key on a WordPress site is checked by a request made FROM the server, so when those requests cannot leave the building - most often because wp-config.php blocks them - every key test fails in a way that looks like a rejected key. The new check names the exact cause instead: the setting doing the blocking, the address to allow, a missing or ancient connection library, or a name that does not resolve.
* Improvement: the key tests on the settings screens say the same thing before they blame a key. Testing a map-engine key or the reCAPTCHA keys now starts by checking that this server can reach the service at all, so a blocked host is reported as a blocked host rather than as a key that does not work.
* Improvement: a keyword search now matches ANY of its words, closest matches first. Every word used to be required, so a single word no business writes about itself emptied the page: "shopping up to 100 dollars" asked for listings containing "dollars" and returned nothing, out of a hundred that matched the rest of it. Listings matching the whole phrase come first, then those matching part of it. The suggestion lists that appear as you type still require every word, or they would grow while you type instead of narrowing.
* Improvement: pressing Enter in the keyword or address box runs the search. The form carried no submit control, so the key most visitors try first did nothing at all.
* Fix: a radius search no longer loses its circle or jumps the zoom. After a successful search the map was put back to the zoom saved with it whenever the two were more than two levels apart, and a wide radius at that zoom is several screens across, so the ring sat off-screen and read as gone; for a related reason the centre moved on some searches and not on others. The map now frames the searched circle, and only when that circle has actually moved, so running the same search again with another filter changed leaves the view where you put it.
* Fix: the expiration emails are being sent again, and listings past their date are being expired again. The hourly check looked for the expiration date under the key the plugin used to write and stopped seeing the one it writes now, so a listing submitted, imported or edited after the update dropped out of it entirely: no pre-expiration notice, no expiration notice, and no change of status. It now reads both, so listings of either vintage are found.
* Fix: a listing the hourly check expires is now recorded as expired everywhere the plugin looks, rather than under one of the two status keys, so the badge and the front-end filtering agree about it.

= Earlier versions =
* The full version history is in changelog.txt, included with the plugin.
