`!(._`.`-. / _._ `_ ,_/ ' '-._.---.-.__|
|.{ " " `-==,',._\{ \ / {) / _ ">_,-' ` mt-2_|
+ \_.:--. `._ )`^-. "' , [_/( __,/-' +
|'"' \ " _L oD_,--' ) /. (| |
| | ,' _)_.\\._<> 6 _,' / ' |
| `. / [_/_'` `"( <'} ) |
+ \\ .-. ) / `-'"..' `:._ _) ' +
| ` \ ( `( / `:\ > \ ,-^. /' ' |
| `._, "" | \`' \| ?_) {\ |
| `=.---. `._._ ,' "` |' ,- '. |
+ | `-._ | / `:`<_|h--._ +
| ( > . | , `=.__.`-'\ |
| `. / | |{| ,-.,\ .|
| | ,' \ / `' ," \ |
+ | / |_' | __ / +
| | | '-' `-' \.|
| |/ Leaflet Maps Marker / |
| \. The most comprehensive & user-friendly ' |
+ mapping solution for WordPress +
| ,/ ______._.--._ _..---.---------._ |
| ,-----"-..?----_/ ) _,-'" " ( |
|.._( `-----' `-|
+----+-----+-----+-----+-----+----+-----+-----+-----+-----+-----+-----+
ASCII Map (C) 1998 Matthew Thomas (freely usable as long as this line is included)
Plugin Name: Leaflet Maps Marker
Plugin URI: https://www.mapsmarker.com
Description: The most comprehensive & user-friendly mapping solution for WordPress (Attention: Leaflet Maps Marker has earned its retirement - existing users get a parting gift: a 50% coupon code for an unexpiring Maps Marker Pro license - for a limited time only, get yours now! Read more & get 50% coupon code at https://www.mapsmarker.com/v3.12.3)
Tags: map, maps, Leaflet, OpenStreetMap, geoJSON, json, jsonp, OSM, travelblog, opendata, open data, opengov, open government, ogdwien, WMTS, geoRSS, location, geo, geo-mashup, geocoding, geolocation, travel, mapnick, osmarender, mapquest, geotag, geocaching, gpx, OpenLayers, mapping, bikemap, coordinates, geocode, geocoding, geotagging, latitude, longitude, position, route, tracks, google maps, googlemaps, gmaps, google map, google map short code, google map widget, google maps v3, google earth, gmaps, ar, augmented-reality, wms, web map service, geocache, geocaching, qr, qr code, fullscreen, marker, marker icons, layer, multiple markers, karte, blogmap, geocms, geographic, routes, tracks, directions, navigation, routing, location plan, YOURS, yournavigation, ORS, openrouteservice, widget, bing, bing maps, microsoft, map short code, map widget, kml, cross-browser, fully documented, traffic, bike lanes, map short code, custom marker text, custom marker icons and text, gpx
Version: 3.12.3
Author: MapsMarker.com e.U.
Author URI: https://www.mapsmarker.com
Requires at least: 3.3
Tested up to: 5.3.2
Copyright 2011-2020 - MapsMarker.com e.U. - All rights reserved
MapsMarker ®
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You have received a copy of the full GNU General Public License along with this program (see file licence-gpl20.txt)
*/
//info prevent file from being accessed directly
if (basename($_SERVER['SCRIPT_FILENAME']) == 'leaflet-maps-marker.php') { die ("Please do not access this file directly. Thanks!
www.mapsmarker.com"); }
function lmm_register_activation_hook_free() {
global $wp_version;
if (version_compare($wp_version,"3.3","<")){
exit('[Leaflet Maps Marker Plugin - installation failed!]: WordPress Version 3.3 or higher is needed for this plugin (you are using version '.$wp_version.') - please upgrade your WordPress installation!');
}
if (version_compare(phpversion(),"5.2","<")){
exit('[Leaflet Maps Marker Plugin - installation failed]: PHP 5.2 is needed for this plugin (you are using PHP '.phpversion().'; note: support for PHP 4 has been officially discontinued since 2007-12-31!) - please upgrade your PHP installation!');
}
}
register_activation_hook( __FILE__, 'lmm_register_activation_hook_free' );
function lmm_register_deactivation_hook_free() {
wp_clear_scheduled_hook('lmm_wp_session_garbage_collection');
}
register_deactivation_hook( __FILE__, 'lmm_register_deactivation_hook_free' );
//info: die if old pro version is active
if ( is_admin() ) {
include_once( ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'plugin.php' );
if (is_plugin_active('leaflet-maps-marker-pro/leaflet-maps-marker.php') || (is_plugin_active('maps-marker-pro/maps-marker-pro.php') || class_exists('Maps_Marker_Pro')) ) {
if (!is_multisite()) {
exit('[Leaflet Maps Marker - activation failed]: Please deactivate "Maps Marker Pro" first before downgrading to (outdated) "Leaflet Maps Marker" (click here for more details)');
} else {
if (is_network_admin()) {
echo 'Network wide activation of the (outdated) plugin "Leaflet Maps Marker" failed as the plugin "Maps Marker Pro" is still active on subsites. Please activate "Leaflet Maps Marker" on desired subsites only!
Click here for more details';
} else {
echo 'Too bad you want to use the (outdated) free version again :-( Please deactivate "Maps Marker Pro" first before downgrading to "Leaflet Maps Marker" (click here for more details)!';
}
}
}
}
//info: define necessary paths and urls
define( 'LEAFLET_WP_ADMIN_URL', get_admin_url() );
define ("LEAFLET_PLUGIN_URL", plugin_dir_url(__FILE__));
define ("LEAFLET_PLUGIN_DIR", plugin_dir_path(__FILE__));
$lmm_upload_dir = wp_upload_dir();
define ("LEAFLET_PLUGIN_ICONS_URL", $lmm_upload_dir['baseurl'] . "/leaflet-maps-marker-icons");
define ("LEAFLET_PLUGIN_ICONS_DIR", $lmm_upload_dir['basedir'] . DIRECTORY_SEPARATOR . "leaflet-maps-marker-icons");
class Leafletmapsmarker
{
function __construct() {
$lmm_options = get_option( 'leafletmapsmarker_options' );
add_action('init', array(&$this, 'lmm_load_translation_files'),1);
add_action('admin_init', array(&$this, 'lmm_load_settings_class'),2);
add_action('admin_init', array(&$this, 'lmm_install_and_updates'),3); //info: register_action_hook not used as otherwise Wordpress Network installs break
//info: deregister Google Maps scripts by other plugin&themes
if ( isset($lmm_options['google_api_deregister_scripts']) && ($lmm_options['google_api_deregister_scripts'] == 'enabled') ){
add_action('wp_enqueue_scripts', array(&$this, 'lmm_deregister_scripts'),4);
add_action('wp_head', array(&$this, 'lmm_deregister_scripts'),5);
add_action('init', array(&$this, 'lmm_deregister_scripts'),6);
add_action('wp_footer', array(&$this, 'lmm_deregister_scripts'),7);
add_action('wp_print_scripts', array(&$this, 'lmm_deregister_scripts'),8);
}
add_action('wp_enqueue_scripts', array(&$this, 'lmm_frontend_enqueue_scripts'), 5);
add_action('wp_print_styles', array(&$this, 'lmm_frontend_enqueue_stylesheets'),6);
add_action('admin_menu', array(&$this, 'lmm_admin_menu'),7);
add_action('admin_init', array(&$this, 'lmm_plugin_meta_links'),8);
add_action('admin_bar_menu', array(&$this, 'lmm_add_admin_bar_menu'),149);
if ( !empty($lmm_options) ) { //info: needed to suppress warning when reseting settings
add_shortcode($lmm_options['shortcode'], array(&$this, 'lmm_showmap'));
}
add_filter('widget_text', 'do_shortcode'); //info: needed for widgets
if ( isset($lmm_options['misc_global_admin_notices']) && ($lmm_options['misc_global_admin_notices'] == 'show') ){
add_action('admin_notices', array(&$this, 'lmm_compatibility_checks'));
}
if ( !empty($lmm_options) ) { //info: needed to suppress warning when reseting settings
if ($lmm_options['misc_add_georss_to_head'] == 'enabled') {
add_action( 'wp_head', array( &$this, 'lmm_add_georss_to_head' ) );
}
}
if ( isset($lmm_options['misc_tinymce_button']) && ($lmm_options['misc_tinymce_button'] == 'enabled') ) {
require_once( plugin_dir_path( __FILE__ ) . 'inc' . DIRECTORY_SEPARATOR . 'tinymce-plugin.php' );
}
if ( isset($lmm_options['misc_plugin_language']) && ($lmm_options['misc_plugin_language'] != 'automatic') ){
add_filter('plugin_locale', array(&$this,'lmm_set_plugin_locale'), 'lmm');
}
add_action('widgets_init', function() {return register_widget("Class_leaflet_recent_marker_widget");});
if ( isset($lmm_options['misc_admin_dashboard_widget']) && ($lmm_options['misc_admin_dashboard_widget'] == 'enabled') ){
if ( !is_multisite() ) {
add_action('wp_dashboard_setup', array( &$this,'lmm_register_widgets' ));
} else {
add_action('wp_network_dashboard_setup', array( &$this,'lmm_register_widgets' ));
add_action('wp_dashboard_setup', array( &$this,'lmm_register_widgets' ));
}
}
//info: dont show update pointers on new installs
$version_before_update = get_option('leafletmapsmarker_version_before_update');
if ($version_before_update != '0') {
add_action( 'admin_enqueue_scripts', array( $this, 'lmm_update_pointer_admin_scripts' ),1001);
}
//info: add features pointers
add_action( 'admin_enqueue_scripts', array( $this, 'lmm_feature_pointer_admin_scripts' ),1002);
//info: multisite only - delete tables+options+files if blog deleted from network admin
if ( is_multisite() ) {
add_action('delete_blog', array( &$this,'lmm_delete_multisite_blog' ));
}
//info: check template files for do_shortcode()-action
if ( (isset($lmm_options['misc_conditional_css_loading'])) && ($lmm_options['misc_conditional_css_loading'] == 'enabled') ){
add_action('template_include', array( &$this,'lmm_template_check_shortcode' ));
}
//info: style & add extra links to plugin page
add_action('plugin_row_meta', array( &$this,'lmm_plugins_page_add_links' ), 10, 2);
add_action( 'admin_enqueue_scripts', array( $this, 'lmm_style_plugins_page' ));
}
function lmm_deregister_scripts() {
global $wp_scripts;
if (isset($wp_scripts->registered) && is_array($wp_scripts->registered)) {
foreach ( $wp_scripts->registered as $script) {
if (strpos($script->src, 'maps.google.com/maps/api/js') !== false) {
wp_dequeue_script($script->handle);
}
if (strpos($script->src, 'maps.googleapis.com/maps/api/js') !== false) {
wp_dequeue_script($script->handle);
}
}
}
}
function lmm_style_plugins_page() {
global $pagenow;
if ($pagenow == "plugins.php") {
$plugin_version = get_option('leafletmapsmarker_version_pro');
wp_register_style( 'leafletmapsmarker-plugin-styling', LEAFLET_PLUGIN_URL . 'inc/css/leafletmapsmarker-plugins-styling.css', array(), $plugin_version);
wp_enqueue_style( 'leafletmapsmarker-plugin-styling' );
}
}
function lmm_plugins_page_add_links($links, $file) {
$plugin = plugin_basename(__FILE__);
if ($file == $plugin) {
$go_pro_link = '
';
$affiliate_link = '
';
$reseller_link = '
';
$rate_link = '
';
$translation_link = '
';
$hackerone_link = '
';
$fbook_link = '
';
$twitter_link = '
';
$rss_link = '
';
$rss_email_link = '
';
$links[] = $go_pro_link . $affiliate_link . ' ' . $reseller_link . ' ' . $rate_link . ' ' . $translation_link . ' ' . $hackerone_link . ' ' . $fbook_link . ' ' . $twitter_link . ' ' . $rss_link . ' ' . $rss_email_link;
}
return $links;
}
function lmm_delete_multisite_blog($blog_id) {
switch_to_blog($blog_id);
/* Remove tables */
$GLOBALS['wpdb']->query("DROP TABLE `".$GLOBALS['wpdb']->prefix."leafletmapsmarker_layers`");
$GLOBALS['wpdb']->query("DROP TABLE `".$GLOBALS['wpdb']->prefix."leafletmapsmarker_markers`");
/*remove map icons directory for subsite*/
$lmm_upload_dir = wp_upload_dir();
$icons_directory = $lmm_upload_dir['basedir'] . DIRECTORY_SEPARATOR . "leaflet-maps-marker-icons" . DIRECTORY_SEPARATOR;
if (is_dir($icons_directory)) {
foreach(glob($icons_directory.'*.*') as $v) {
unlink($v);
}
rmdir($icons_directory);
}
}
function lmm_update_pointer_admin_scripts() {
$page = (isset($_GET['page']) ? $_GET['page'] : '');
if ($page != 'leafletmapsmarker_pro_upgrade') {
$dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
$dismissed_pointers = array_flip($dismissed_pointers);
$do_add_script = false;
$lmm_version_new = get_option( 'leafletmapsmarker_version' );
$version_without_dots = "lmmv" . str_replace('.', '', $lmm_version_new);
if ( !isset($dismissed_pointers[$version_without_dots]) ) {
//info: delete expired lmmv(p)* update pointer IDs for current user
$current_dismissed_wp_pointers = get_user_meta(get_current_user_id(), "dismissed_wp_pointers");
$replace_lmmv = preg_replace('/(lmmv(p)?(\\d)+(,)?)/',NULL,$current_dismissed_wp_pointers['0']);
$replace_without_end_comma = preg_replace('/(,)$/',NULL,$replace_lmmv);
update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $replace_without_end_comma);
$do_add_script = true;
add_action( 'admin_print_footer_scripts', array( $this, 'lmm_update_pointer_footer_script' ) );
}
if ( $do_add_script ) {
wp_enqueue_script( 'wp-pointer' );
wp_enqueue_style( 'wp-pointer' );
}
}
}
function lmm_update_pointer_footer_script() {
$lmm_options = get_option( 'leafletmapsmarker_options' );
$lmm_version_new = get_option( 'leafletmapsmarker_version' );
$version_without_dots = "lmmv" . str_replace('.', '', $lmm_version_new);
$pointer_content = '
' . sprintf(esc_attr__('Please see the %1s for new features or the blog post on %2s for more details','lmm'), $changelog_url, $blogpost_url) . '
'; $pointer_content .= '' . __('Leaflet Maps Marker has earned its retirement - existing users get a parting gift: a 50% coupon code for an unexpiring Maps Marker Pro license (view demo).
For a limited time only, get yours now!','lmm') . '
| ';
echo ''.htmlspecialchars(stripslashes($row['markername'])).' ' . __('created on','lmm') . ' ' . date("Y-m-d - h:m", strtotime($row['createdon'])) . ', ' . __('created by','lmm') . ' ' . $row['createdby']; echo ' |
' . __('No marker created yet','lmm') . '
'; } if ( !isset($widgets[$widget_id]['blogposts']) ) { $show_rss = 1; } else if ( isset($widgets[$widget_id]['blogposts']) && ($widgets[$widget_id]['blogposts'] == 1) ) { $show_rss = 0; } else { $show_rss = 1; } //info: use custom name to prevent false malware detection by WordFence plugin function lmm_spc_custom_name($string) { return 'mapsmarker-dashboard-widget-rss-item-cache'; } if ($show_rss == 1) { require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'class-simplepie.php'); $feed = new SimplePie(); if ( file_exists(LEAFLET_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . 'readme-icons.txt') ) { $feed->enable_cache(true); $feed->set_cache_location($location = LEAFLET_PLUGIN_ICONS_DIR); $feed->set_cache_name_function('lmm_spc_custom_name'); $feed->set_cache_duration(86400); } else { $feed->enable_cache(false); } $feed->set_feed_url('http://feeds.feedburner.com/MapsMarkerPro'); $feed->set_stupidly_fast(true); $feed->enable_order_by_date(true); $feed->init(); $feed->handle_content_type(); echo '' . __('Latest blog posts from www.mapsmarker.com','lmm') . '
'; if ($feed->get_items() == NULL) { $blogpost_url = 'https://www.mapsmarker.com/news'; echo sprintf(__('Feed could not be retrieved, please try again later or read the latest blog posts at %s','lmm'),$blogpost_url); } foreach ($feed->get_items(0,3) as $item) { echo '' . $item->get_date('j F Y') . ': ' . str_replace('div>', 'span>', $item->get_title()) . '
'.PHP_EOL; } echo ''; echo '
'; echo ''; echo '
'; } function lmm_load_translation_files() { load_plugin_textdomain('lmm', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/'); } function lmm_set_plugin_locale( $lang ) { $lmm_options = get_option( 'leafletmapsmarker_options' ); global $locale; if ($lmm_options['misc_plugin_language_area'] == 'backend') { return is_admin() ? $lmm_options['misc_plugin_language'] : $locale; } else if ($lmm_options['misc_plugin_language_area'] == 'frontend') { return is_admin() ? $locale : $lmm_options['misc_plugin_language']; } else if ($lmm_options['misc_plugin_language_area'] == 'both') { return $lmm_options['misc_plugin_language']; } else { return $locale; } } function lmm_compatibility_checks() { include('inc' . DIRECTORY_SEPARATOR . 'compatibility-checks.php'); } function lmm_help() { include('leaflet-help-credits.php'); } function lmm_settings() { global $lmm_options_class; $lmm_options_class->display_page(); } function lmm_list_layers() { include('leaflet-list-layers.php'); } function lmm_list_markers() { include('leaflet-list-markers.php'); } function lmm_layer() { include('leaflet-layer.php'); } function lmm_marker() { include('leaflet-marker.php'); } function lmm_import_export() { include('leaflet-import-export.php'); } function lmm_tools() { include('leaflet-tools.php'); } function lmm_apis(){ if( ! current_user_can( 'activate_plugins' ) ) { return; } settings_errors(); echo '' . __('Do you have questions or issues? Please use the following support channels appropriately.','lmm') . '
';
$helptext .= '' . __('One personal request: before you post a new support ticket in the Wordpress Support Forum, please follow the instructions from http://www.mapsmarker.com/readme-first which give you a guideline on how to deal with the most common issues.','lmm') . '