=== Web 2.0 Directory ===
Contributors: salephpscripts
Donate link: https://www.salephpscripts.com/
Tags: maps, google maps, mapbox, maplibre, markers, store locator, directory, listings, map search, clusters
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Build powerful, searchable, responsive maps (Google Maps, Mapbox, MapLibre) with custom markers, clustering, frontend submission and advanced search.

== Description ==

Web 2.0 Directory lets you build custom, searchable maps for WordPress in minutes and place them anywhere with a shortcode. Choose your map engine — Google Maps, Mapbox or MapLibre — add high-quality markers, group them into a searchable listings directory, and let visitors filter by category, location, content fields or distance.

**Key features**

* Three map engines: Google Maps, Mapbox, and MapLibre (with MapTiler tiles).
* Custom markers with Font Awesome icons, per-category icons, and marker clustering.
* Advanced search: by category, location, custom content fields, address + radius, and free-hand "draw area" polygon search.
* Listings directory: sidebar list, listings below the map, InfoWindow popups, directions and read-more.
* Frontend submission form so visitors can add their own markers/listings, with optional moderation, expiration and renewal.
* Google reCAPTCHA support on contact and submission forms.
* CSV import/export for bulk marker/listing management.
* Translation-ready: ships a POT file you can translate with any standard gettext/PO editor.
* Powerful settings panel with per-map configuration.
* Fast and lightweight: marker clustering plus on-demand REST loading keep maps, listings and popups responsive even with thousands of markers - quick to load, display and search.

See the live demo: https://maps.salephpscripts.com/

This plugin connects to external services (map providers, reCAPTCHA, and the Web 2.0 Directory license/update server). Please read the **External Services** section below.

== Installation ==

1. Upload the `w2dc` folder to `/wp-content/plugins/`, or install the ZIP via Plugins -> Add New -> Upload Plugin.
2. Activate **Web 2.0 Directory** through the Plugins menu.
3. Open the Web 2.0 Directory settings page, choose your map engine and enter the matching API key/token (Google Maps API key, Mapbox token, or MapTiler key).
4. Create a map, add markers/listings, and place the map on any page with the provided shortcode.

== Frequently Asked Questions ==

= Which map engine should I use? =
Any of Google Maps, Mapbox or MapLibre. Google and Mapbox require an API key/token from the provider; MapLibre renders open tiles (for example from MapTiler) using your key.

= Do I need API keys? =
Yes. Map providers require their own key/token, which you enter on the settings page. The keys are stored on your site and are never sent to us.

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

= Can visitors submit their own listings? =
Yes, through the frontend submission form, with optional moderation, expiration and renewal.

== External Services ==

Web 2.0 Directory relies on the following third-party services. Each is used only in the situation described, and all map-provider API keys/tokens are supplied by you.

1. Web 2.0 Directory license & update server (salephpscripts.com)
Used in wp-admin only, when checking for plugin updates or validating your purchase code. It sends your purchase code and your site URL so the server can verify the license and return update information.
Terms & privacy: https://maps.salephpscripts.com/

2. Google Maps Platform (maps.googleapis.com) - only when the Google engine is selected
The browser loads the Google Maps JavaScript API (with your API key) and sends map view coordinates and address/search queries in order to render maps and autocomplete addresses.
Terms: https://cloud.google.com/maps-platform/terms - Privacy: https://policies.google.com/privacy

3. Mapbox (api.mapbox.com) - only when the Mapbox engine is selected
The browser loads Mapbox GL JS (with your access token) and requests map tiles and styles.
Terms: https://www.mapbox.com/legal/tos - Privacy: https://www.mapbox.com/legal/privacy

4. MapLibre / map tiles - only when the MapLibre engine is selected
The MapLibre GL JS library is loaded in the browser, and map tiles are requested from the tile provider you configure (for example MapTiler) using your key.
MapTiler terms: https://www.maptiler.com/terms/ - Privacy: https://www.maptiler.com/privacy-policy/

5. Google reCAPTCHA (www.google.com/recaptcha) - optional, only when enabled
When you enable reCAPTCHA for the contact/submission forms, the browser loads reCAPTCHA and sends interaction signals to Google to score the request.
Terms: https://policies.google.com/terms - Privacy: https://policies.google.com/privacy

== Screenshots ==

1. A map with clustered custom markers.
2. Listings sidebar.
3. Address + radius search.
4. The map with sidebar search.
5. Price markers.
6. The frontend submission form.
7. The Web 2.0 Directory settings panel.

== Changelog ==

= 1.3.0 =
* 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 in the search-form builder now accepts any value you type — it no longer jumped to the maximum when you typed a smaller number such as 20.
* 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 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).
* Improvement: the reCaptcha settings page now lists which forms reCAPTCHA protects — Login / Register / Lost-password, listing submission, "Contact this listing" (map popup / sidebar) and anonymous star ratings.
* 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.
* 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 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: words no longer break in the middle at the end of a line. The 4-line trim on 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 directions panel is covered too.
* 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.

= 1.2.5 =
* New: a Globe projection option for Mapbox and MapLibre maps (Edit Map, next to the map style) — the map shows a 3-D globe when zoomed out and flattens to the normal flat map as you zoom in.
* Fix: in the setup wizard, the map step now opens the map already created during setup for editing, instead of starting a blank new one (which left you with a duplicate).
* Fix: the rating marker's text size (the px next to "Rating (score + reviews)") now actually resizes the label on Mapbox and MapLibre maps, and markers stay locked to their spot while the globe rotates.
* New: a one-click front-end self-test that checks your maps and listings work on the live site, so problems caused by other plugins (caches, optimizers, security plugins) show up even when wp-admin looks fine.
* Fix: the map no longer shows a false "Google Maps API key is not configured" notice when the key is set. On sites where Web 2.0 Directory was the only plugin loading Google Maps, it was accidentally removing its own map script along with any conflicting ones; it now keeps its own, so the map displays.
* Fix: a website address can be entered without "https://" on the listing form, and an email pasted with a stray space is no longer rejected as invalid.
* Fix: long text on listing cards and map popups now wraps at word boundaries instead of breaking words at random characters.
* Fix: the admin reminder about a missing Google Maps API key now shows its bold text and settings-page link correctly instead of raw HTML tags.
* Fix: in the listing-form builder, a field's chosen icon now shows in the Field Properties panel right away, instead of looking blank until you re-select it.
* Fix: in the listing-form builder, grabbing a field and dropping it back in the same place no longer leaves it dimmed.

= 1.2.4 =
* Fix: on the listing form, choosing a different main image (logo) — or reordering the images — now takes effect on the front. The front-end listing renderer was still reading a pre-rebuild image key and ignored image/logo edits made in the new editor, so the main image "stuck" on the first image; it now reads 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) is the main image.
* New: the on-map search form gains a collapse/expand toggle beside the drag handle — both shown by the renamed "Allow form drag and toggle" option (Edit Map → Search form).

= 1.2.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: when the search form is placed on the page separately from the map, its Locations / Categories dropdowns now open above the map instead of being hidden behind it.
* Fix: the public 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.

= 1.2.2 =
* Improve: the Submit button on the front-end listing form now shows a loading indicator while the listing is saved (matching the map editor).
* Fix: the admin Settings screen now loads its section icons and styled dropdown (select) controls correctly - a packaging issue had left some bundled admin styles and scripts missing.
* Fix: the Listing Locations screen now shows the correct number of listings for each location instead of always showing 0.
* Fix: the address "restrict to a single country" setting now defaults to "Worldwide" instead of a blank selection.

= 1.2.0 =
* New: built-in star ratings - visitors can rate listings, and the average rating shows on markers, the map popup, the sidebar and listing pages (no separate add-on needed).
* New: a "Custom" colour palette - editing any colour on the Customization tab switches the palette to Custom automatically, so your own colours are kept.
* New: guided upgrade from the Google Maps Locator plugin - a one-time welcome screen introduces Web 2.0 Directory and runs the data migration, keeping all your purchase keys active.
* New: theme-aware Settings controls, and a "Depth" option for category / location term filters in the search form.
* Improve: smoother panning and zooming on large maps (cached projections and better marker-overlap handling).
* Improve: new maps inherit your default map settings, and map duplication now respects user capabilities.
* Fix: when a map provider API key is not configured, the "map can't load" notice now appears immediately instead of several seconds later.
* Fix: colours on a fresh install match the Default palette; a migrated site keeps its own colours under the Custom palette.
* Fix: the form builder keeps the map, markers and panel in sync when using undo / redo.

= 1.1.0 =
* New: 10 Google Maps and 10 MapLibre map style presets (colourful to dark).
* New: branded rocket marker icon and a matching map starting-point marker.
* Improve: faster marker loading on maps that use a listings limit.
* Fix: list / select / checkbox field values not showing in listings, popups and search.
* Fix: duplicated markers and gallery images on some listings.
* Fix: MapLibre style switching in the map editor's live preview.
* Fix: search-form fade animation and minor UI polish.

= 1.0.0 =
* Initial CodeCanyon release.
