| 开发者 |
glocalsaino
freemius rafammoo |
|---|---|
| 更新时间 | 2026年8月27日 05:17 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
glocalsaino_map_base_layers filter, without modifying this plugin./wp-content/plugins/ or install it from the admin panel (Plugins → Add New)..kml files.[glocalsaino_map id="1"]) and paste it into any page or post.id (required) — the map's ID, shown next to each map in the admin panel.height — height in pixels (default: 550).zoom — initial zoom level (default: 8, only used together with lat/lng, or to force the zoom on top of the automatic layer fit).lat / lng — initial map center. When set, they take priority over the automatic fit-to-layers view.[glocalsaino_map id="1" height="700" zoom="12" lat="40.4168" lng="-3.7038"]Not yet, only .kml for now (KMZ is a KML compressed inside a ZIP; you'd need to decompress it first).
It has been tested with layers of more than 60,000 objects. The file is analyzed in the background on upload, and the viewer loads objects page by page, so the file size never blocks the admin panel or the visitor's browser.
For small and medium files, the defaults on most hosts are fine. For very large ones (tens of thousands of objects, or files of dozens of MB), check with your host or server admin:
upload_max_filesize and post_max_size (PHP): the file can't be uploaded past whichever of these two is smaller. The admin panel shows your current effective limit above the upload button.memory_limit (PHP): 256 MB or more is recommended for very large layers. The plugin already asks WordPress to raise it for its own background processing (wp_raise_memory_limit()), but that can't exceed your host's hard limit.DISABLE_WP_CRON), make sure a real server cron job hits wp-cron.php periodically, or background analysis will never start.The KML is analyzed in the background (WP-Cron) so the upload itself isn't blocked. While that finishes, the map shows a general view and a "Processing layers in the background" badge; if it takes longer than expected, the "Analyze now" button forces the analysis immediately.
None by default: the filter bar only appears once you choose a field under "Popup Fields" in the admin panel for that map.
As many as you want — there is no limit.
kml_map_save_layers() to add layers (e.g. External Data Layers) get the same protection via a new kml_map_get_layers() helper.javascript:) is never linked.Plugin URI): https://glocalsaino.com/layermapviewer/error_log() call added in 5.11.1 (only ever runs if the site already has WP_DEBUG_LOG on; no functional change).kml_map_save_layers(), a small safety net around saving a map's layers: if the data somehow couldn't be encoded to valid JSON, the existing layers are left untouched instead of being overwritten with an empty result. Used everywhere this plugin saves a map's layers, and available for add-ons to use too.glocalsaino_map_base_layers) instead of being hardcoded, so an add-on can offer more of them (e.g. topographic, alternate styles) without modifying this plugin. No visible change without such an add-on installed.glocalsaino_map_layer_types, e.g. the external data-source add-on) can now report why it found no data (bad URL, unexpected response format, etc.) as a last_error stored on the layer itself, so add-ons can surface it in their own admin UI instead of it only ever reaching the debug log. No effect on regular KML layers.Cache-Control: public, max-age=60 so regular KML layers can be cached, but that same caching could make the browser, a CDN or the hosting's own cache serve a stale response for a live layer's poll instead of hitting the server again. Live-layer requests now explicitly ask for an uncached response.height (default 550px), zoom (default 8) and lat/lng, to set the map's height and initial view instead of always fitting to the layers' bounds. See "Shortcode parameters" below.glocalsaino_map_layer_types filter, glocalsaino_map_after_add_layers_form and glocalsaino_map_layer_row_after actions) so add-ons can register additional layer types — for example, a live external data source — without modifying this plugin's code. No effect on sites without such an add-on installed.fopen()/fwrite()/fclose() aren't allowed by WordPress.org guidelines (WordPress.WP.AlternativeFunctions.file_system_operations_*). Switched the incremental index writer to file_put_contents() with FILE_APPEND (still memory-safe, one object at a time, never disallowed) and the reader to file_get_contents() per cell file, freeing each cell's content before moving to the next.InputNotSanitized warning.upload_max_filesize/post_max_size, memory_limit, WP-Cron) in a new FAQ entry, and added a short pointer to it next to the upload form.upload_max_filesize/post_max_size limit, instead of the misleading "files must have a .kml extension" message.InputNotSanitized warnings on $_FILES['kml_files'] that came back after adding the opacity parameter: with 4 arguments, Freemius's packaging tool now wraps the kml_map_upload_files() call across multiple lines, which again separated the phpcs:ignore comment from the actual flagged line. Fixed by extracting the $_FILES access into its own single-line variable, immune to argument-count-driven line wrapping.wp_org_gatekeeper from the Freemius config: it only mattered for generating a stripped-down free package from a premium source, which no longer applies now that there's no premium code at all. Set has_addons back to false until a real add-on product exists to link.<script> block to a properly enqueued script file (assets/js/admin-page.js), scoped only to this plugin's own admin page.vendor/freemius/wordpress-sdk/, loaded via vendor/autoload.php, per WordPress.org's guidance.