",$wpgmza_current_map_id) . "
";
// NB: "True" represents below, this should really be changed to something clearer or constants should be used in the very least
if($map->storeLocator && !empty($map->wpgmza_store_locator_position))
$ret_msg .= $map->storeLocator->html;
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
$core_dependencies = array();
$scriptLoader = new WPGMZA\ScriptLoader($wpgmza->isProVersion());
$v8Scripts = $scriptLoader->getPluginScripts();
foreach($v8Scripts as $handle => $script)
{
$core_dependencies[] = $handle;
}
$apiLoader = new WPGMZA\GoogleMapsAPILoader();
if($apiLoader->isIncludeAllowed())
{
$core_dependencies[] = 'wpgmza_api_call';
if($wpgmza->settings->engine == 'google-maps')
{
// TODO: Why is this not handled by the API loader?
wp_enqueue_script('wpgmza_canvas_layer_options', plugin_dir_url(__FILE__) . 'lib/CanvasLayerOptions.js', array('wpgmza_api_call'));
wp_enqueue_script('wpgmza_canvas_layer', plugin_dir_url(__FILE__) . 'lib/CanvasLayer.js', array('wpgmza_api_call'));
}
}
// TODO: Come up with a proper solution. Gutenberg dependency breaks developer mode
$gutenbergIndex = array_search('wpgmza-gutenberg', $core_dependencies);
if($gutenbergIndex !== false)
array_splice($core_dependencies, $gutenbergIndex, 1);
if(isset($wpgmza_settings['wpgmza_maps_engine']) && $wpgmza_settings['wpgmza_maps_engine'] == 'open-layers')
{
if($index = array_search('wpgmza-google-vertex-context-menu', $core_dependencies))
array_splice($core_dependencies, $index, 1);
}
/* Developer Hook (Action) - Enqueue additional frontend scripts */
do_action("wpgooglemaps_hook_user_js_after_core");
$res = array();
$res[$wpgmza_current_map_id] = wpgmza_get_map_data($wpgmza_current_map_id);
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
/* Developer Hook (Action) - Enqueue additional frontend scripts */
do_action("wpgooglemaps_basic_hook_user_js_after_core");
/* Developer Hook (Action) - Localize additional frontend script variable */
do_action("wpgooglemaps_hook_user_js_after_localize", $map);
if(empty($wpgmza->settings->disable_autoptimize_compatibility_fix))
{
// Autoptimize fix, bypass CSS where our map is present as large amounts of inline JS (our localized data) crashes their plugin. Added at their advice.
add_filter('autoptimize_filter_css_noptimize', '__return_true');
}
return $ret_msg;
}
/**
* Check if the marker file exists
* @param Integer $mapid Map ID
* @return void
*/
function wpgmza_check_if_marker_file_exists($mapid) {
global $blog_id;
wpgmaps_handle_directory();
$upload_dir = wp_upload_dir();
$xml_marker_location = get_option("wpgmza_xml_location");
$path = wpgmza_return_marker_path();
$file = $path . (is_multisite() ? "$blog_id-" : "") . "{$mapid}markers.xml";
if(file_exists($file))
return;
wpgmaps_update_xml_file($mapid);
}
/**
* Create the HTML output for the store locator
* @param Integer $map_id Map ID
* @return string HTML output for the store locator
*/
function wpgmaps_sl_user_output_basic($map_id)
{
trigger_error("Deprecated in 8.0.20");
}
/**
* Return the plugin URL
* @return string Plugin URL
*/
function wpgmaps_get_plugin_url() {
return plugin_dir_url( __FILE__ );
}
/**
* Not called at all
*
* @deprecated since V7
*/
function wpgmaps_menu_marker_layout() {
if (!$_GET['action']) {
wpgmza_marker_page();
} else {
echo"";
$my_theme = wp_get_theme();
$name = $my_theme->get( 'Name' );
$version = $my_theme->get( 'Version' );
$modified_version = str_replace('.', '', $version);
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
// Only check for avada major versions below 4 - 7.1 has a different version structure, causing this error to show for new users
$modified_major = intval(substr($modified_version, 0, 1));
if($modified_major <= 3){
if( $name == 'Avada' && intval( $modified_version ) <= 393 && !isset( $wpgmza_settings['wpgmza_settings_force_jquery'] ) ){
echo "
".printf( /* translators: %s: WP Go Maps Settings Link */ __("We have detected a conflict between your current theme's version and our plugin. Should you be experiencing issues with your maps displaying, please update Avada to version 3.9.4 or go to settings page and check the highlighted checkbox.", "wp-google-maps"), admin_url('/admin.php?page=wp-google-maps-menu-settings#wpgmza_settings_force_jquery') )."
";
}
}
wpgmaps_check_versions();
wpgmaps_list_maps();
}
else {
wpgmza_stats("list_maps_basic");
echo"
".__("My Maps","wp-google-maps")."
";
echo"
".__("Create unlimited maps","wp-google-maps")." ".__("with the","wp-google-maps")." ".__("Pro Version","wp-google-maps")." ".__("of WP Go Maps for only","wp-google-maps")." $39.99 ".__("once off!","wp-google-maps")."
";
$my_theme = wp_get_theme();
$name = $my_theme->get( 'Name' );
$version = $my_theme->get( 'Version' );
$modified_version = str_replace('.', '', $version);
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
// Only check for avada major versions below 4 - 7.1 has a different version structure, causing this error to show for new users
$modified_major = intval(substr($modified_version, 0, 1));
if($modified_major <= 3){
if( $name == 'Avada' && intval( $modified_version ) <= 393 && !isset( $wpgmza_settings['wpgmza_settings_force_jquery'] ) ){
echo "
".printf( /* translators: %s: WP Go Maps Settings Link */ __("We have detected a conflict between your current theme's version and our plugin. Should you be experiencing issues with your maps displaying, please update Avada to version 3.9.4 or go to settings page and check the highlighted checkbox.", "wp-google-maps"), admin_url('/admin.php?page=wp-google-maps-menu-settings#wpgmza_settings_force_jquery') )."
";
}
}
wpgmaps_list_maps();
}
echo "
";
echo"
";
}
/**
* Deprecated
*
* @deprecated since V7
*/
function wpgmza_marker_page() {
echo"
";
wpgmaps_list_markers();
echo "
";
echo"
";
}
/**
* Deprecated
*
* @deprecated since V7
*/
function wpgmaps_list_markers() {
global $wpdb;
global $wpgmza_tblname;
$columns = implode(', ', wpgmza_get_marker_columns());
$results = $wpdb->get_results("SELECT $columns FROM $wpgmza_tblname ORDER BY `address` DESC");
echo "
".__("ID","wp-google-maps")." |
".__("Icon","wp-google-maps")." |
".__("Linked to","wp-google-maps")." |
".__("Title","wp-google-maps")." |
".__("Address","wp-google-maps")." |
".__("GPS","wp-google-maps")." |
".__("Pic","wp-google-maps")." |
".__("Link","wp-google-maps")." |
";
foreach ( $results as $result ) {
echo "id)."\">";
echo "".intval($result->id)." | ";
echo "".esc_html($result->icon)." | ";
echo "".intval($result->map_id)." | ";
echo "".esc_html($result->title)." | ";
echo "".esc_html($result->address)." | ";
echo "".floatval($result->lat).",".floatval($result->lng)." | ";
echo "".esc_html($result->pic)." | ";
echo "".esc_url($result->link)." | ";
echo "
";
}
echo "
";
}
function wpgmaps_check_versions() {
// Deprecated in 8.1.0
}
function wpgmza_basic_menu() {
// Deprecated in 8.1.0
}
function wpgmza_edit_marker($mid) {
global $wpgmza_tblname_maps;
global $wpdb;
if ($_GET['action'] == "edit_marker" && isset($mid)) {
$mid = sanitize_text_field($mid);
$res = wpgmza_get_marker_data($mid);
echo "
WP Go Maps
".__("Edit Marker Location","wp-google-maps")." ".__("ID","wp-google-maps")."#$mid
";
}
}
function wpgmaps_admin_scripts()
{
trigger_error("Deprecated since 8.1.0");
}
function wpgmaps_admin_styles()
{
trigger_error("Deprecated since 8.1.0");
}
function wpgmaps_user_scripts()
{
trigger_error("Deprecated since 8.1.0");
}
function wpgmaps_chmodr($path, $filemode)
{
// Removed in 6.0.25. is_dir caused fatal errors on some hosts
trigger_error("Deprecated since 6.0.25");
}
/*
* Deprecated since 9.0.0
*
* Now managed by Shortcodes class
*/
/*
if (function_exists('wpgmza_register_pro_version')){
if (isset($wpgmza_pro_version) && function_exists('wpgmza_register_gold_version') && version_compare($wpgmza_pro_version, '7.10.29', '<=')) {
// Deprecated with Pro >= 7.10.30, where legacy-map-edit-page.js is used instead
add_action('admin_head', 'wpgmaps_admin_javascript_gold');
}
add_shortcode( 'wpgmza', 'wpgmaps_tag_pro' );
} else {
add_shortcode( 'wpgmza', 'wpgmaps_tag_basic' );
}
*/
function wpgmaps_check_permissions() {
$filename = dirname( __FILE__ ).'/wpgmaps.tmp';
$testcontent = "Permission Check\n";
$handle = @fopen($filename, 'w');
if (@fwrite($handle, $testcontent) === FALSE) {
@fclose($handle);
add_option("wpgmza_permission","n");
return false;
}
else {
@fclose($handle);
add_option("wpgmza_permission","y");
return true;
}
}
function wpgmaps_permission_warning() {
echo "
";
_e("The plugin directory does not have 'write' permissions. Please enable 'write' permissions (755) for ");
echo "\"".c."\" ";
_e("in order for this plugin to work! Please see ");
echo "";
_e("this page");
echo " ";
_e("for help on how to do it.");
echo " ";
}
/* handle database check upon upgrade */
function wpgmaps_update_db_check() {
global $wpgmza_version;
if (get_option('wpgmza_db_version') != $wpgmza_version) {
update_option("wpgmza_temp_api",'AIzaSyDo_fG7DXBOVvdhlrLa-PHREuFDpTklWhY');
// NB: Moved to WPGMZA\Database
//wpgmaps_handle_db();
}
}
add_action('plugins_loaded', 'wpgmaps_update_db_check');
function wpgmaps_handle_db() {
global $wpdb;
global $wpgmza_version;
global $wpgmza_tblname_poly;
global $wpgmza_tblname_polylines;
global $wpgmza_tblname_categories;
global $wpgmza_tblname_category_maps;
global $wpgmza_tblname_circles;
global $wpgmza_tblname_rectangles;
global $wpgmza_tblname;
require_once(wpgmza_basic_get_admin_path() . 'includes/upgrade.php');
$table_name = $wpdb->prefix . "wpgmza";
$sql = "
CREATE TABLE `".$wpgmza_tblname_category_maps."` (
id int(11) NOT NULL AUTO_INCREMENT,
cat_id INT(11) NOT NULL,
map_id INT(11) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
";
dbDelta($sql);
$table_name = $wpdb->prefix . "wpgmza_maps";
/* 6.3.14 */
$check = $wpdb->query("ALTER TABLE $table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci");
/* check for previous versions containing 'desc' instead of 'description' */
$results = $wpdb->get_results("DESC $wpgmza_tblname");
$founded = 0;
foreach ($results as $row ) {
if ($row->Field == "desc") {
$founded++;
}
}
if ($founded>0) { $wpdb->query("ALTER TABLE $wpgmza_tblname CHANGE `desc` `description` MEDIUMTEXT"); }
/* check for older version of "category" and change to varchar instead of int */
$results = $wpdb->get_results("DESC $wpgmza_tblname");
$founded = 0;
foreach ($results as $row ) {
if ($row->Field == "category") {
if ($row->Type == "int(11)") {
$founded++;
}
}
}
if ($founded>0) { $wpdb->query("ALTER TABLE $wpgmza_tblname CHANGE `category` `category` VARCHAR(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0'"); }
// NB: Moved to WPGMZA\Database
// add_option("wpgmza_db_version", $wpgmza_version);
// update_option("wpgmza_db_version",$wpgmza_version);
}
function wpgmza_get_map_data($map_id) {
global $wpdb;
global $wpgmza_tblname_maps;
$result = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpgmza_tblname_maps WHERE `id` = %d LIMIT 1" , intval($map_id)) );
if (isset($result[0])) { return $result[0]; }
}
function wpgmza_get_marker_data($mid) {
global $wpdb;
global $wpgmza_tblname;
$columns = implode(', ', wpgmza_get_marker_columns());
$result = $wpdb->get_results( $wpdb->prepare("SELECT $columns FROM $wpgmza_tblname WHERE `id` = %d LIMIT 1 " , intval($mid)) );
$res = $result[0];
return $res;
}
function wpgmaps_upgrade_notice() {
trigger_error('Deprecated since 8.1.0');
}
function wpgmza_stats($sec) {
$wpgmza_stats = get_option("wpgmza_stats");
if ($wpgmza_stats) {
if (isset($wpgmza_stats[$sec]["views"])) {
$wpgmza_stats[$sec]["views"] = $wpgmza_stats[$sec]["views"] + 1;
$wpgmza_stats[$sec]["last_accessed"] = date("Y-m-d H:i:s");
} else {
$wpgmza_stats[$sec]["views"] = 1;
$wpgmza_stats[$sec]["last_accessed"] = date("Y-m-d H:i:s");
$wpgmza_stats[$sec]["first_accessed"] = date("Y-m-d H:i:s");
}
} else {
$wpgmza_stats[$sec]["views"] = 1;
$wpgmza_stats[$sec]["last_accessed"] = date("Y-m-d H:i:s");
$wpgmza_stats[$sec]["first_accessed"] = date("Y-m-d H:i:s");
}
update_option("wpgmza_stats",$wpgmza_stats);
}
function wpgmaps_filter(&$array)
{
trigger_error("Deprecated since 8.0.20");
}
function wpgmaps_debugger($section) {
global $debug;
global $debug_start;
global $debug_step;
if ($debug) {
$end = (float) array_sum(explode(' ',microtime()));
echo "";
}
}
/**
* This fuction remain in place, however, does execute any code
*
* It should be noted this code has technically been disabled for an extensive amount of time, the setting that controls this function was removed pre V8
*
* @deprecated since 8.1.18
*/
function wpgmaps_load_jquery() {}
function wpgmza_get_category_data($cat_id) {
global $wpgmza;
global $wpgmza_tblname_categories;
global $wpdb;
if(!preg_match_all('/\d+/', $cat_id, $m))
return null;
$ids = array_map('intval', $m[0]);
if(method_exists($wpgmza, 'getProVersion') && version_compare($wpgmza->getProVersion(), '7.0.0', '>='))
{
$result = $wpdb->get_row("
SELECT * FROM $wpgmza_tblname_categories
WHERE id IN (" . implode(',', $ids) . ")
AND active = 0
ORDER BY priority DESC
LIMIT 1
");
}
else
{
$result = $wpdb->get_row("
SELECT * FROM $wpgmza_tblname_categories
WHERE id = " . $ids[0] . "
AND active = 0
LIMIT 1
");
}
return $result;
}
function wpgmza_get_category_icon($cat_id) {
global $wpgmza;
global $wpgmza_tblname_categories;
global $wpdb;
$cat_id = (int)$cat_id;
$result = $wpdb->get_var("
SELECT `category_icon`
FROM `$wpgmza_tblname_categories`
WHERE `id` = '$cat_id'
AND `active` = 0
LIMIT 1
");
return $result;
}
function wpgmza_return_error($data) {
echo "
".strip_tags($data->get_error_message())."
".strip_tags($data->get_error_data())."
";
}
function wpgmza_write_to_error_log($data) {
error_log(date("Y-m-d H:i:s"). ": WP Go Maps : " . $data->get_error_message() . "->" . $data->get_error_data());
return;
}
function wpgmza_error_directory() {
return true;
}
function wpgmza_return_error_log() {
$check = wp_upload_dir();
$file = $check['basedir']."/wp-google-maps/error_log.txt";
$ret = "";
if (@file_exists($file)) {
$fh = @fopen($check['basedir']."/wp-google-maps/error_log.txt","r");
$ret = "";
if ($fh) {
for ($i=0;$i<10;$i++) {
$visits = fread($fh,4096);
$ret .= $visits;
}
} else {
$ret .= "No errors to report on";
}
} else {
$ret .= "No errors to report on";
}
return $ret;
}
function wpgmaps_marker_permission_check() {
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
if (isset($wpgmza_settings['wpgmza_settings_marker_pull']) && $wpgmza_settings['wpgmza_settings_marker_pull'] == '0') {
/* using db method, do nothing */
return;
}
if (function_exists("wpgmza_register_pro_version")) {
global $wpgmza_pro_version;
if (floatval($wpgmza_pro_version) < 5.41) {
$marker_location = get_option("wpgmza_xml_location");
} else {
$marker_location = wpgmza_return_marker_path();
}
} else {
$marker_location = wpgmza_return_marker_path();
}
$wpgmza_file_perms = substr(sprintf('%o', fileperms($marker_location)), -4);
$fpe = false;
$fpe_error = "";
if ($wpgmza_file_perms == "0777" || $wpgmza_file_perms == "0755" || $wpgmza_file_perms == "0775" || $wpgmza_file_perms == "0705" || $wpgmza_file_perms == "2705" || $wpgmza_file_perms == "2775" || $wpgmza_file_perms == "2777" ) {
$fpe = true;
$fpe_error = "";
}
else if ($wpgmza_file_perms == "0") {
$fpe = false;
$fpe_error = __("This folder does not exist. Please create it.","wp-google-maps"). ": ". $marker_location;
} else {
$fpe = false;
$fpe_error = __("WP Go Maps does not have write permission to the marker location directory. This is required to store marker data. Please CHMOD the folder ","wp-google-maps").$marker_location.__(" to 755 or 777, or change the directory in the Maps->Settings page. (Current file permissions are ","wp-google-maps").$wpgmza_file_perms.")";
}
if (!$fpe) {
echo "
";
}
}
function wpgmza_basic_support_menu()
{
trigger_error("Deprecated since 8.1.0");
}
function wpgmza_return_country_tld_array(){
$path = plugin_dir_path(__FILE__).'js/countries.json';
$file = file_get_contents($path);
$countries = json_decode( $file );
$tld = array();
if( $countries ){
foreach( $countries as $country ){
if( $country->topLevelDomain[0] !== '' ){
$tld[str_replace('.', '', $country->topLevelDomain[0])] = $country->name;
}
}
asort( $tld );
} else {
$tld['us'] = __('United States of America', 'wp-google-maps');
}
return $tld;
}
function google_maps_api_key_warning(){
global $wpgmza;
if($wpgmza->settings->engine != 'google-maps' || empty($wpgmza->settings->engine))
return;
$g_api_key = get_option('wpgmza_google_maps_api_key');
if( !$g_api_key || $g_api_key == '' ){
$video = "
".__('View the instruction video', 'wp-google-maps')."";
$documentation = "
".__('Read the documentation', 'wp-google-maps')."";
echo "
".__('Important Notification', 'wp-google-maps')."
";
$article = "
".__('You can read more about that here.', 'wp-google-maps')."";
echo "
".__('*ALL* Google Maps now require an API key to function.','wp-google-maps').' '.$article.'
';
echo "
".__("Before creating a map please follow these steps:","wp-google-maps")."";
echo "
";
echo "- ";
echo " ".__("Create an API key now","wp-google-maps")."";
echo "
";
echo "- ";
echo "
";
echo "
";
echo "";
echo "
" . __('Alternatively, please switch to the OpenLayers map engine on the maps settings page', 'wp-google-maps') . "
";
echo sprintf( __('Need help? %s or %s.', 'wp-google-maps'), esc_url($video), esc_url($documentation) )."";
echo "
";
}
}
if( isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' ){
if( is_admin() ){
add_action('admin_enqueue_styles', 'wpgmza_deregister_styles',999);
add_action('admin_enqueue_scripts', 'wpgmza_deregister_styles',999);
add_action('admin_head', 'wpgmza_deregister_styles',999);
add_action('init', 'wpgmza_deregister_styles',999);
add_action('admin_footer', 'wpgmza_deregister_styles',999);
add_action('admin_print_styles', 'wpgmza_deregister_styles',999);
}
}
function wpgmza_deregister_styles() {
global $wp_styles;
if (isset($wp_styles->registered) && is_array($wp_styles->registered)) {
foreach ( $wp_styles->registered as $script) {
if (strpos($script->src, 'jquery-ui.theme.css') !== false || strpos($script->src, 'jquery-ui.css') !== false) {
// $script->handle = "";
// $script->src = "";
}
}
}
}
function wpgmza_caching_notice_changes($markers = false, $return = false){
if( isset( $_GET['page'] ) && strpos( $_GET['page'], "wp-google-maps" ) !== false ){
if( $return ){
$class = "update-nag";
} else {
$class = "notice notice-info";
}
$message = "";
$w3tc_nonce_url = wp_nonce_url( network_admin_url(
'admin.php?page=w3tc_dashboard&w3tc_flush_all' ),
'w3tc' );
$cleared_link = "";
$cache_plugin = "";
if ( defined( 'W3TC' ) ) {
$cache_plugin = "W3 Total Cache";
$cleared_link = $w3tc_nonce_url;
} else if( function_exists( 'wpsupercache_activate' ) ){
$cache_plugin = "WP Super Cache";
$cleared_link = admin_url('options-general.php?page=wpsupercache');
} else if( class_exists( 'WpFastestCache' ) ){
$cache_plugin = "WP Fastest Cache";
$cleared_link = admin_url('admin.php?page=wpfastestcacheoptions');
}
if( defined( 'W3TC' ) || function_exists( 'wpsupercache_activate' ) || class_exists( 'WpFastestCache' ) ){
if ($markers) {
$message = sprintf( __( "One or more markers have been added or changed, please
clear your cache.", "wp-google-maps" ), $cleared_link );
} else {
$message = sprintf( __( "We have detected that you are using %s on your website. Please
clear your cache to ensure that your map is updated.", "wp-google-maps" ), $cache_plugin, $cleared_link );
}
if( $message != "" ){
if( $return ){
return "
$message
";
} else {
echo "
$message
";
}
}
} else {
return;
}
}
}
function wpgm_pro_link($link) {
if (defined('wpgm_aff')) {
$id = sanitize_text_field(wpgm_aff);
if ($id && $id !== "") {
return esc_attr("http://affiliatetracker.io/?aff=".$id."&affuri=".base64_encode($link));
} else {
return esc_attr($link);
}
} else {
return esc_attr($link);
}
}
/**
* Migrates text lat/lng columns into spatial latlng column if necessary
* @return void
*/
if(!function_exists('wpgmza_migrate_spatial_data'))
{
function wpgmza_migrate_spatial_data()
{
trigger_error('Deprecated since 8.1.0');
}
}
// Get admin path
function wpgmza_basic_get_admin_path()
{
$default = ABSPATH . 'wp-admin/';
if(file_exists($default))
return $default;
return $admin_path = str_replace( get_bloginfo( 'url' ) . '/', ABSPATH, get_admin_url() );
}
if(!function_exists('wpgmza_enqueue_fontawesome'))
{
/**
* Enqueues fontawesome
* DEPRECATED :- This functionality has been handed off to the ScriptLoader class
*/
function wpgmza_enqueue_fontawesome()
{
}
}
add_action('plugins_loaded', function() {
if(!empty($_GET['wpgmza-build']))
{
$scriptLoader = new WPGMZA\ScriptLoader(false);
$scriptLoader->build();
// Update readme
$contents = file_get_contents(plugin_dir_path(__FILE__) . "wpGoogleMaps.php");
if(preg_match_all('#/\*.+?\*/#sm', $contents, $comments))
{
$changelog = $comments[0][1];
$changelog = preg_replace("/^ \*/m", "*", $changelog);
$changelog = preg_replace("/^\/\*.+\r?\n/", "", $changelog);
$changelog = preg_replace("/^\*\//m", "", $changelog);
$changelog = preg_replace("/^\* (\d+\.\d+\.\d+[^\r\n]+)/m", "= $1 =", $changelog);
$changelog = preg_replace("/^\*( *)(\r?\n)/m", "$2", $changelog);
$readme = file_get_contents(plugin_dir_path(__FILE__) . 'readme.txt');
$readme = preg_replace('/== Changelog ==.+For more, please view the WP Go Maps site/sm', "== Changelog ==\r\n\r\n$changelog\r\n\r\nFor more, please view the WP Go Maps site\r\n", $readme);
file_put_contents(plugin_dir_path(__FILE__) . 'readme.txt', $readme);
}
if(class_exists('WPGMZA\\ProPlugin'))
{
$scriptLoader = new WPGMZA\ScriptLoader(true);
$scriptLoader->build();
}
echo "Build successful";
exit;
}
});
function wpgmaps_danger_zone_nonce() {
$nonce = wp_create_nonce('wpgmza_maps_settings_danger_zone_delete_data');
$t = "";
return $t;
}
function wpgmaps_check_if_no_api_key() {
global $wpgmza;
if($wpgmza->settings->engine != 'google-maps' || empty($wpgmza->settings->engine))
return;
$g_api_key = get_option('wpgmza_google_maps_api_key');
if( !$g_api_key || $g_api_key == '' ){
$nonce = wp_create_nonce('wpgmza_maps_engine_dialog_set_engine');
$t = "";
return $t;
}
}