Google Maps Widget – Ultimate Google Maps Plugin - Version 2.90

Version Description

  • 2015/12/14
  • added option for donating
  • checked WP v4.4 compatibility
Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 Google Maps Widget – Ultimate Google Maps Plugin
Version 2.90
Comparing to
See all releases

Code changes from version 2.85 to 2.90

Files changed (5) hide show
  1. css/gmw-admin.css +277 -10
  2. gmw-widget.php +4 -7
  3. google-maps-widget.php +107 -15
  4. js/gmw-admin.js +254 -225
  5. readme.txt +7 -2
css/gmw-admin.css CHANGED
@@ -2,6 +2,7 @@
2
  * Google Maps Widget
3
  * (c) Web factory Ltd, 2012 - 2015
4
  */
 
5
 
6
  .gmw-label {
7
  width: 115px;
@@ -42,45 +43,103 @@ option.promo {
42
  display: none;
43
  }
44
 
 
 
 
 
45
  .gmw-dialog .ui-dialog-titlebar {
46
- height: 60px;
47
- background-color: rgb(48, 48, 48);
 
48
  text-align: center;
49
  }
50
 
 
 
 
 
 
 
 
 
 
51
  .gmw-dialog .footer {
52
- padding: 30px 135px;
53
- background-color: rgb(48, 48, 48);
54
  color: rgb(137, 137, 137);
55
  }
56
 
57
  .gmw-dialog .content {
58
- padding: 30px 135px;
59
  background-color: #FFF;
60
  }
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  .gmw-dialog h3 b {
63
- color: rgb(225, 77, 67);
64
  }
65
 
66
  .gmw-dialog h3 {
67
  line-height: 150%;
68
  font-weight: normal;
69
  margin: 0 0 30px 0;
 
 
70
  }
71
 
72
  .gmw-dialog .ui-dialog-title {
73
  line-height: 60px;
74
  color: rgb(137, 137, 137);
 
 
75
  }
76
 
77
  .gmw-dialog .ui-dialog-titlebar-close {
78
- top: 12px;
 
79
  }
80
 
81
  #gmw_promo_dialog ul {
82
  list-style-position: inside;
83
  list-style-type: disc;
 
84
  }
85
 
86
  .gmw-dialog input {
@@ -105,11 +164,10 @@ option.promo {
105
  font-weight: bold;
106
  text-transform: uppercase;
107
  margin-top: 5px;
 
108
  }
109
 
110
- .gmw-dialog #gmw_already_subscribed {
111
- margin-top: 18px;
112
- display: inline-block;
113
  color: #999;
114
  }
115
 
@@ -218,4 +276,213 @@ ul.ui-tabs-nav{
218
 
219
  .ui-state-hover a {
220
  color: #0073aa !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  }
2
  * Google Maps Widget
3
  * (c) Web factory Ltd, 2012 - 2015
4
  */
5
+ @import url(http://fonts.googleapis.com/css?family=RobotoDraft:regular,bold,italic,thin,light&lang=en);
6
 
7
  .gmw-label {
8
  width: 115px;
43
  display: none;
44
  }
45
 
46
+ .gmw-dialog {
47
+ font-family: 'Roboto', sans-serif !important;
48
+ }
49
+
50
  .gmw-dialog .ui-dialog-titlebar {
51
+ line-height: 90px;
52
+ height: 90px;
53
+ background-color: #303030;
54
  text-align: center;
55
  }
56
 
57
+ .gmw-dialog .ui-dialog-titlebar span {
58
+ color: #fff;
59
+ }
60
+
61
+ .gmw-dialog .ui-dialog-titlebar span b {
62
+ color: #0085ba;
63
+ font-weight: normal;
64
+ }
65
+
66
  .gmw-dialog .footer {
67
+ padding: 20px 135px;
68
+ background-color: #303030;
69
  color: rgb(137, 137, 137);
70
  }
71
 
72
  .gmw-dialog .content {
 
73
  background-color: #FFF;
74
  }
75
 
76
+ .gmw-dialog .dashicons {
77
+ display: block !important;
78
+ width: 100%;
79
+ }
80
+
81
+ .gmw-left-box,
82
+ .gmw-right-box {
83
+ position: relative;
84
+ min-height: 335px;
85
+ padding: 42px 50px 63px 50px !important;
86
+ width: 34.6%;
87
+ float: left;
88
+ text-align: center;
89
+ }
90
+
91
+ .gmw-left-box .gmw_goto_activation.button-primary,
92
+ .gmw-right-box .gmw_goto_subscribe.button-secondary {
93
+ position: absolute;
94
+ bottom: 63px;
95
+ left: 77px;
96
+ letter-spacing: 1px;
97
+ width: 170px;
98
+ }
99
+
100
+ .gmw-left-box {
101
+ background: #0085ba;
102
+ }
103
+
104
+ .gmw-right-box {
105
+ background: #e5f3f8;
106
+ }
107
+
108
+
109
+ .gmw-dialog .boxed-h {
110
+ padding: 30px 0px;
111
+ margin: 0;
112
+ display: block;
113
+ }
114
+
115
  .gmw-dialog h3 b {
116
+ color: #fe4765;
117
  }
118
 
119
  .gmw-dialog h3 {
120
  line-height: 150%;
121
  font-weight: normal;
122
  margin: 0 0 30px 0;
123
+ font-size: 1.1em;
124
+ color: #666666;
125
  }
126
 
127
  .gmw-dialog .ui-dialog-title {
128
  line-height: 60px;
129
  color: rgb(137, 137, 137);
130
+ letter-spacing: 1px;
131
+ font-size: 20px;
132
  }
133
 
134
  .gmw-dialog .ui-dialog-titlebar-close {
135
+ top: 27px;
136
+ right: 25px;
137
  }
138
 
139
  #gmw_promo_dialog ul {
140
  list-style-position: inside;
141
  list-style-type: disc;
142
+ padding-bottom: 15px;
143
  }
144
 
145
  .gmw-dialog input {
164
  font-weight: bold;
165
  text-transform: uppercase;
166
  margin-top: 5px;
167
+ text-shadow: none;
168
  }
169
 
170
+ .gmw-dialog a {
 
 
171
  color: #999;
172
  }
173
 
276
 
277
  .ui-state-hover a {
278
  color: #0073aa !important;
279
+ }
280
+
281
+
282
+ .gmw-content-box-alternate h3,
283
+ .gmw-content-box h3 {
284
+ font-size: 26px;
285
+ font-weight: bold;
286
+ text-transform: uppercase;
287
+ }
288
+
289
+ .gmw-content-box h3,
290
+ .gmw-content-box p {
291
+ color: #fff;
292
+ margin: 0;
293
+ padding: 0;
294
+ }
295
+
296
+ .gmw-content-box-alternate i,
297
+ .gmw-content-box i {
298
+ font-size: 32px;
299
+ padding: 15px 0px;
300
+ }
301
+
302
+ .gmw-content-box-alternate i {
303
+ color: #666 !important;
304
+ }
305
+
306
+ .gmw-content-box i {
307
+ color: #fff;
308
+ }
309
+
310
+ .gmw-content-box-alternate h3,
311
+ .gmw-content-box-alternate p {
312
+ color: #666666;
313
+ margin: 0;
314
+ padding: 0;
315
+ }
316
+
317
+ .gmw-content-box ul li:before {
318
+ content:'\f147';
319
+ font-family: 'Dashicons';
320
+ display: inline-block;
321
+ font-size: 24px;
322
+ position: absolute;
323
+ left: 0;
324
+ top: 0;
325
+ }
326
+
327
+ .gmw-content-box ul li {
328
+ position: relative;
329
+ padding-left: 25px;
330
+ text-align: left;
331
+ padding-bottom: 10px;
332
+ color: #fff;
333
+ }
334
+
335
+ .gmw-content-box ul {
336
+ list-style: none !important;
337
+ }
338
+
339
+ .gmw-content-box-alternate ul li {
340
+ color: #666;
341
+ }
342
+
343
+ .gmw_goto_activation.button-primary {
344
+ border: 2px solid #fff;
345
+ border-radius: 4px;
346
+ background: #0085ba;
347
+ color: #fff;
348
+ font-weight: bold;
349
+ text-transform: uppercase;
350
+ font-size: 14px;
351
+ padding: 15px 40px;
352
+ text-shadow:none !important;
353
+ height: auto !important;
354
+ box-shadow:none !important;
355
+ }
356
+
357
+ .gmw_goto_activation.button-primary:hover {
358
+ background: rgba(0,0,0,0.15) !important;
359
+ }
360
+
361
+ .gmw_goto_activation.button-primary:visited {
362
+ background: #0085ba;
363
+ border: 2px solid #fff;
364
+ }
365
+
366
+ .gmw_goto_subscribe.button-secondary {
367
+ border: 2px solid #666;
368
+ box-shadow: none !important;
369
+ border-radius: 4px;
370
+ background: #e5f3f8;
371
+ color: #666;
372
+ font-weight: bold;
373
+ text-transform: uppercase;
374
+ font-size: 14px;
375
+ padding: 15px 40px;
376
+ text-shadow:none !important;
377
+ height: auto !important;
378
+ }
379
+
380
+ .gmw_goto_subscribe.button-secondary:hover {
381
+ background: rgba(0,0,0,0.15);
382
+ }
383
+
384
+ .gmw-footer-intro {
385
+ display: block;
386
+ padding: 45px 40px;
387
+ text-align: center;
388
+ margin: 0px !important;
389
+ font-size: 14px;
390
+ }
391
+
392
+ .gmw-footer-intro a {
393
+ color: #0085ba;
394
+ }
395
+
396
+
397
+ /* Donate */
398
+ #gmw_dialog_activate .content {
399
+ padding: 60px 130px;
400
+ }
401
+
402
+ #gmw_dialog_activate .content a {
403
+ color: #0085ba;
404
+ }
405
+
406
+ #gmw_code {
407
+ border: 1px solid #dcdcdc;
408
+ box-shadow:none;
409
+ padding: 25px !important;
410
+ height: 60px !important;
411
+ display: block;
412
+ border-radius:3px;
413
+ }
414
+
415
+ #gmw_activate {
416
+ display: block;
417
+ border: 1px solid #fff;
418
+ border-radius:4px;
419
+ background: #0085ba;
420
+ color: #fff !important;
421
+ font-weight: bold;
422
+ text-transform: uppercase;
423
+ font-size: 14px;
424
+ padding: 15px 40px;
425
+ text-shadow:none !important;
426
+ height: auto !important;
427
+ box-shadow:none !important;
428
+ }
429
+
430
+
431
+ #gmw_activate:hover {
432
+ background: #00719e !important;
433
+ }
434
+
435
+ .gmw-faq-ul li {
436
+ color: #888888 !important;
437
+ }
438
+
439
+ /* Subscribe */
440
+ #gmw_dialog_subscribe .content {
441
+ padding: 40px 130px;
442
+ }
443
+
444
+ #gmw_dialog_subscribe .content a {
445
+ color: #0085ba;
446
+ }
447
+
448
+ #gmw_dialog_subscribe h3 {
449
+ text-align: center;
450
+ }
451
+
452
+ #gmw_dialog_subscribe input[type="text"] {
453
+ border: 1px solid #dcdcdc;
454
+ box-shadow:none;
455
+ padding: 25px !important;
456
+ height: 60px !important;
457
+ display: block;
458
+ border-radius:3px;
459
+ }
460
+
461
+ #gmw_dialog_subscribe .button.button-primary {
462
+ display: block;
463
+ border: 1px solid #fff;
464
+ border-radius:4px;
465
+ background: #0085ba;
466
+ color: #fff !important;
467
+ font-weight: bold;
468
+ text-transform: uppercase;
469
+ font-size: 14px;
470
+ padding: 15px 40px;
471
+ text-shadow: none !important;
472
+ height: auto !important;
473
+ box-shadow: none !important;
474
+ }
475
+
476
+ #gmw_dialog_subscribe .button.button-primary:hover {
477
+ background: #00719e !important;
478
+ }
479
+
480
+ #gmw_dialog_subscribe .footer {
481
+ background:#0085ba;
482
+ }
483
+
484
+
485
+ #gmw_dialog_subscribe .footer p,
486
+ #gmw_dialog_subscribe .footer ul li {
487
+ color: #fff;
488
  }
gmw-widget.php CHANGED
@@ -251,13 +251,10 @@ class GoogleMapsWidget extends WP_Widget {
251
 
252
  echo '<div id="gmw-info">';
253
  echo '<h4>' . __('Support', 'google-maps-widget') . '</h4>';
254
- echo '<p>If you have any problems, questions or would like a new feature added post it on the <a href="https://wordpress.org/support/plugin/google-maps-widget" target="_blank">official support forum</a>. It\'s the only place to get support. Since it\'s free and community powered please be patient. <a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?business=gordan@webfactoryltd.com&cmd=_xclick&currency_code=USD&amount=19&item_name=Premium%20support%20for%20Google%20Maps%20Widget">Premium support</a> is available for $19.</p>';
255
- echo '<h4>' . __('Activate extra features &amp; options', 'google-maps-widget') . '</h4>';
256
- echo '<p>' . __('If you subscribe to our mailing list we\'ll instantly activate additional features in the plugin! At the moment those features are: shortcode support, 3 additional thumbnail map skins and 2 additional lightbox skins. More <i>activate by subscribing</i> features will be available soon!', 'google-maps-widget') . '<br>';
257
- if (GMW::is_activated()) {
258
- echo __('You\'ve already subscribed and activated extra features. Thank you!', 'google-maps-widget');
259
- } else {
260
- echo __('Subscribe and <a class="open_promo_dialog" href="#">activate extra features</a>.', 'google-maps-widget');
261
  }
262
  echo '</p>';
263
  echo '<h4>' . __('Rate the plugin &amp; spread the word', 'google-maps-widget') . '</h4>';
251
 
252
  echo '<div id="gmw-info">';
253
  echo '<h4>' . __('Support', 'google-maps-widget') . '</h4>';
254
+ echo '<p>If you have any problems, questions or would like a new feature added post it on the <a href="https://wordpress.org/support/plugin/google-maps-widget" target="_blank">official support forum</a>. Since it\'s free and community powered please be patient. <a href="mailto:wp.support@webfactoryltd.com?subject=GMW%20support">Premium support</a> via email is available to users who have donated.</p>';
255
+ if (!GMW::is_activated()) {
256
+ echo '<h4>' . __('Activate extra features &amp; options', 'google-maps-widget') . '</h4>';
257
+ echo '<p>' . __('If you donate or subscribe to our mailing list we\'ll instantly activate additional features in the plugin! At the moment those features are: shortcode support, 3 additional thumbnail map skins and 2 additional lightbox skins. More extra features will be available soon.', 'google-maps-widget') . '<br><a class="button-secondary open_promo_dialog" href="#">Activate extra features</a>';
 
 
 
258
  }
259
  echo '</p>';
260
  echo '<h4>' . __('Rate the plugin &amp; spread the word', 'google-maps-widget') . '</h4>';
google-maps-widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Maps Widget
4
  Plugin URI: http://www.googlemapswidget.com/
5
  Description: Display a single-image super-fast loading Google map in a widget. A larger, full featured map is available on click in a lightbox. Includes shortcode support and numerous options.
6
  Author: Web factory Ltd
7
- Version: 2.85
8
  Author URI: http://www.webfactoryltd.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
@@ -33,7 +33,7 @@ if (!defined('ABSPATH')) {
33
 
34
  define('GMW_OPTIONS', 'gmw_options');
35
  define('GMW_CRON', 'gmw_cron');
36
- define('GMW_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
37
 
38
 
39
  require_once GMW_PLUGIN_DIR . 'gmw-widget.php';
@@ -41,7 +41,7 @@ require_once GMW_PLUGIN_DIR . 'gmw-tracking.php';
41
 
42
 
43
  class GMW {
44
- static $version = '2.85';
45
 
46
  // hook everything up
47
  static function init() {
@@ -113,7 +113,7 @@ class GMW {
113
  $documentation_link = '<a target="_blank" href="http://www.googlemapswidget.com/documentation/" title="' . __('View Google Maps Widget documentation', 'google-maps-widget') . '">'. __('Documentation', 'google-maps-widget') . '</a>';
114
  $support_link = '<a target="_blank" href="http://wordpress.org/support/plugin/google-maps-widget" title="' . __('Problems? We are here to help!', 'google-maps-widget') . '">' . __('Support', 'google-maps-widget') . '</a>';
115
  $review_link = '<a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/google-maps-widget" title="' . __('If you like it, please review the plugin', 'google-maps-widget') . '">' . __('Review the plugin', 'google-maps-widget') . '</a>';
116
- $donate_link = '<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?business=gordan@webfactoryltd.com&cmd=_xclick&currency_code=USD&amount=&item_name=Google%20Maps%20Widget%20Donation" title="' . __('If you feel we deserve it, buy us coffee', 'google-maps-widget') . '">' . __('Donate', 'google-maps-widget') . '</a>';
117
  $activate_link = '<a href="' . esc_url(admin_url('widgets.php?gmw_open_promo_dialog')) . '">' . __('Activate premium features for <b>FREE</b>', 'google-maps-widget') . '</a>';
118
 
119
  if ($file == plugin_basename(__FILE__)) {
@@ -268,7 +268,7 @@ class GMW {
268
  echo '<div id="gmw_activate_notice" class="updated notice"><p>' . __('<b>Google Maps Widget</b> has extra premium features you can get for <b style="color: #d54e21;">FREE</b>. This is a limited time offer so act now!', 'google-maps-widget');
269
 
270
  echo '<br /><a href="' . esc_url($activate_url) . '" style="vertical-align: baseline; margin-top: 15px;" class="button-primary">' . __('Activate premium features for <b>FREE</b>', 'google-maps-widget') . '</a>';
271
- echo '&nbsp;&nbsp;<a href="' . esc_url($dismiss_url) . '" class="">' . __('Dismiss notice', 'google-maps-widget') . '</a>';
272
  echo '</p></div>';
273
  } // notice_activate_extra_features
274
 
@@ -315,7 +315,7 @@ class GMW {
315
  'subscribe_duplicate' => __('You are already subscribed to our list. One activation code is valid for all sites so just use the code you already have.', 'google-maps-widget'),
316
  'subscribe_error' => __('Something is not right on our end. Sorry :( Try again later.', 'google-maps-widget'),
317
  'activate_ok' => __('Superb! Extra features are active ;)', 'google-maps-widget'),
318
- 'dialog_title' => __('GOOGLE MAPS WIDGET - Activate Extra Features', 'google-maps-widget'),
319
  'undocumented_error' => __('An undocumented error has occured. Please refresh the page and try again.', 'google-maps-widget'),
320
  'id_base' => 'googlemapswidget');
321
  wp_localize_script('gmw-admin', 'gmw', $js_localize);
@@ -361,16 +361,83 @@ class GMW {
361
  }
362
 
363
  $out = '<div id="gmw_promo_dialog">';
364
- $out .= '<div id="gmw_dialog_subscribe"><div class="content"><h3 class="center">' . __('Fill out the form and<br>get extra features &amp; options <b>for FREE</b> instantly!', 'google-maps-widget') . '</h3>';
365
- $out .= '<p class="input_row"><input value="' . $name . '" type="text" id="gmw_name" name="gmw_name" placeholder="Your name"><span class="error name" style="display: none;">Please enter your name.</span></p>';
366
- $out .= '<p class="input_row"><input value="' . $current_user->user_email . '" type="text" name="gmw_email" id="gmw_email" placeholder="Your email address"><span style="display: none;" class="error email">Please double check your email address.</span></p>';
367
- $out .= '<p class="center"><a id="gmw_subscribe" href="#" class="button button-primary big-button">Activate extra features</a><br><a href="#" class="" id="gmw_already_subscribed">I already have an activation code</a></p></div>';
368
- $out .= '<div class="footer"><p><b>Still not sure?</b></p><ul><li>We\'ll never share your email address</li><li>We won\'t spam you or overwhelm with emails</li><li>Be the first to get notified about new features</li><li>You\'ll get discounts for our premium WP plugins</li></ul></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  $out .= '</div>'; // dialog subscribe
370
- $out .= '<div id="gmw_dialog_activate"><div class="content"><h3 class="center">' . __('Enter your code and activate extra features', 'google-maps-widget') . '</h3>';
371
- $out .= '<p class="input_row"><input type="text" id="gmw_code" name="gmw_code" placeholder="Your activation code"><span style="display: none;" class="error gmw_code">Please double check the activation code.</span></p><p class="center"><a href="#" class="button button-primary big-button" id="gmw_activate">Activate extra features</a></p></div>';
372
- $out .= '<div class="footer"><p><b>FAQ</b></p><ul><li>Already subscribed? Enter your activation code above.</li><li>Didn\'t receive the email? Check your SPAM folder.</li><li>Still not getting the email? Try a different email address.</li><li>Code is valid for an unlimited number of plugin installations.</li></ul></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  $out .= '</div>'; // activate screen
 
374
  $out .= '</div>'; // dialog
375
 
376
  echo $out;
@@ -421,9 +488,34 @@ class GMW {
421
  } // email_activate
422
 
423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
424
  // check if activation code for additional features is valid
425
  static function validate_activation_code($code) {
426
- if (strlen($code) == 6 && ($code[0] + $code[5]) == 9) {
 
 
427
  return true;
428
  } else {
429
  return false;
4
  Plugin URI: http://www.googlemapswidget.com/
5
  Description: Display a single-image super-fast loading Google map in a widget. A larger, full featured map is available on click in a lightbox. Includes shortcode support and numerous options.
6
  Author: Web factory Ltd
7
+ Version: 2.90
8
  Author URI: http://www.webfactoryltd.com/
9
  Text Domain: google-maps-widget
10
  Domain Path: lang
33
 
34
  define('GMW_OPTIONS', 'gmw_options');
35
  define('GMW_CRON', 'gmw_cron');
36
+ define('GMW_PLUGIN_DIR', plugin_dir_path(__FILE__));
37
 
38
 
39
  require_once GMW_PLUGIN_DIR . 'gmw-widget.php';
41
 
42
 
43
  class GMW {
44
+ static $version = '2.90';
45
 
46
  // hook everything up
47
  static function init() {
113
  $documentation_link = '<a target="_blank" href="http://www.googlemapswidget.com/documentation/" title="' . __('View Google Maps Widget documentation', 'google-maps-widget') . '">'. __('Documentation', 'google-maps-widget') . '</a>';
114
  $support_link = '<a target="_blank" href="http://wordpress.org/support/plugin/google-maps-widget" title="' . __('Problems? We are here to help!', 'google-maps-widget') . '">' . __('Support', 'google-maps-widget') . '</a>';
115
  $review_link = '<a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/google-maps-widget" title="' . __('If you like it, please review the plugin', 'google-maps-widget') . '">' . __('Review the plugin', 'google-maps-widget') . '</a>';
116
+ $donate_link = '<a target="_blank" href="https://gum.co/gmw-wp" title="' . __('If you feel we deserve it, buy us coffee', 'google-maps-widget') . '">' . __('Donate', 'google-maps-widget') . '</a>';
117
  $activate_link = '<a href="' . esc_url(admin_url('widgets.php?gmw_open_promo_dialog')) . '">' . __('Activate premium features for <b>FREE</b>', 'google-maps-widget') . '</a>';
118
 
119
  if ($file == plugin_basename(__FILE__)) {
268
  echo '<div id="gmw_activate_notice" class="updated notice"><p>' . __('<b>Google Maps Widget</b> has extra premium features you can get for <b style="color: #d54e21;">FREE</b>. This is a limited time offer so act now!', 'google-maps-widget');
269
 
270
  echo '<br /><a href="' . esc_url($activate_url) . '" style="vertical-align: baseline; margin-top: 15px;" class="button-primary">' . __('Activate premium features for <b>FREE</b>', 'google-maps-widget') . '</a>';
271
+ echo '&nbsp;&nbsp;<a href="' . esc_url($dismiss_url) . '">' . __('Dismiss notice', 'google-maps-widget') . '</a>';
272
  echo '</p></div>';
273
  } // notice_activate_extra_features
274
 
315
  'subscribe_duplicate' => __('You are already subscribed to our list. One activation code is valid for all sites so just use the code you already have.', 'google-maps-widget'),
316
  'subscribe_error' => __('Something is not right on our end. Sorry :( Try again later.', 'google-maps-widget'),
317
  'activate_ok' => __('Superb! Extra features are active ;)', 'google-maps-widget'),
318
+ 'dialog_title' => __('Google Maps Widget <b>Extra Features</b>', 'google-maps-widget'),
319
  'undocumented_error' => __('An undocumented error has occured. Please refresh the page and try again.', 'google-maps-widget'),
320
  'id_base' => 'googlemapswidget');
321
  wp_localize_script('gmw-admin', 'gmw', $js_localize);
361
  }
362
 
363
  $out = '<div id="gmw_promo_dialog">';
364
+
365
+ $out .= '<div id="gmw_dialog_intro">
366
+ <div class="content">
367
+ <h3 class="center boxed-h">' . __('Choose your prefered way of activating extra features:', 'google-maps-widget') . '</h3>';
368
+ $out .= '<div class="gmw-left-box gmw-content-box">
369
+ <h3>Donate</h3>
370
+ <p>what you think is fair</p>
371
+ <i class="dashicons dashicons-heart"></i>
372
+ <ul>
373
+ <li>Premium email support for 1 year</li>
374
+ <li>Access to all new extra features</li>
375
+ <li>No annoying emails</li>
376
+ <li>Instant activation</li>
377
+ </ul>
378
+ <a href="https://gum.co/gmw-wp" data-noprevent="1" class="gmw_goto_activation button-primary" target="_blank">Donate</a>
379
+ </div>';
380
+ $out .= '<div class="gmw-right-box gmw-content-box gmw-content-box-alternate">
381
+ <h3>Subscribe</h3>
382
+ <p>and receive promotional e-mails</p>
383
+ <i class="dashicons dashicons-email-alt"></i>
384
+ <ul>
385
+ <li>Community based support</li>
386
+ <li>Access to new extra features</li>
387
+ <li>Receive promotional emails</li>
388
+ <li>Instant activation</li>
389
+ </ul>
390
+ <br>
391
+ <a href="#" class="gmw_goto_subscribe button-secondary">Subscribe</a>
392
+ </div>';
393
+ $out .= '<p class="clear center gmw-footer-intro">Already have an activation code? <a href="#" class="gmw_goto_activation">Enter it here</a></p>';
394
+ $out .= '</div></div>'; // dialog intro
395
+
396
+ $out .= '<div id="gmw_dialog_subscribe">
397
+ <div class="content">
398
+ <h3>' . __('Fill out the form and get extra features for <b>FREE</b> instantly!', 'google-maps-widget') . '</h3>';
399
+ $out .= '<p class="input_row">
400
+ <input value="' . $name . '" type="text" id="gmw_name" name="gmw_name" placeholder="Your name">
401
+ <span class="error name" style="display: none;">Please enter your name.</span>
402
+ </p>';
403
+ $out .= '<p class="input_row">
404
+ <input value="' . $current_user->user_email . '" type="text" name="gmw_email" id="gmw_email" placeholder="Your email address">
405
+ <span style="display: none;" class="error email">Please double check your email address.</span>
406
+ </p>';
407
+ $out .= '<p class="center">
408
+ <a id="gmw_subscribe" href="#" class="button button-primary">Activate extra features</a></p>
409
+ <p class="center"><a href="#" class="gmw_goto_activation">I already have an activation code</a></p>
410
+ </div>';
411
+ $out .= '<div class="footer">
412
+ <p><b>Still not sure?</b></p>
413
+ <ul>
414
+ <li>We\'ll never share your email address</li>
415
+ <li>We won\'t spam you or overwhelm with emails</li>
416
+ <li>You\'ll get discounts for our premium WP plugins</li>
417
+ </ul>
418
+ </div>';
419
  $out .= '</div>'; // dialog subscribe
420
+
421
+ $out .= '<div id="gmw_dialog_activate">
422
+ <div class="content">';
423
+ $out .= '<p class="input_row">
424
+ <input type="text" id="gmw_code" name="gmw_code" placeholder="Please enter the activation code">
425
+ <span style="display: none;" class="error gmw_code">Please double check the activation code.</span></p>
426
+ <p class="center">
427
+ <a href="#" class="button button-primary" id="gmw_activate">Activate extra features</a>
428
+ </p>
429
+ <p class="center">If you don\'t have an activation code - <a href="#" class="gmw_goto_intro">Get it now</a></p>
430
+ </div>';
431
+ $out .= '<div class="footer">
432
+ <p><b>FAQ</b></p>
433
+ <ul class="gmw-faq-ul">
434
+ <li>Donated and haven\'t received the code? <a href="mailto:gmw@webfactoryltd.com?subject=Lost%20activation%20code">Email us</a></li>
435
+ <li>Didn\'t receive the email? Check your SPAM folder.</li>
436
+ <li>Code is valid for an unlimited number of plugin installations.</li>
437
+ </ul>
438
+ </div>';
439
  $out .= '</div>'; // activate screen
440
+
441
  $out .= '</div>'; // dialog
442
 
443
  echo $out;
488
  } // email_activate
489
 
490
 
491
+ // check if activation code for additional features is valid
492
+ static function validate_activation_code_format($code) {
493
+ // old key format
494
+ if (strlen($code) == 6) {
495
+ if (($code[0] + $code[5]) != 9 || !ctype_xdigit($code)) {
496
+ return false;
497
+ }
498
+ return true;
499
+ } // old key format
500
+
501
+ // new key format
502
+ if (strlen($code) == 35) {
503
+ if (preg_match('/^[a-z0-9]{8}-[a-z0-9]{8}-[a-z0-9]{8}-[a-z0-9]{8}$/i', $code, $matches) != 1) {
504
+ return false;
505
+ }
506
+
507
+ return true;
508
+ } // new key format
509
+
510
+ return false;
511
+ } // validate_activation_code_format
512
+
513
+
514
  // check if activation code for additional features is valid
515
  static function validate_activation_code($code) {
516
+ $code = trim($code);
517
+
518
+ if (self::validate_activation_code_format($code)) {
519
  return true;
520
  } else {
521
  return false;
js/gmw-admin.js CHANGED
@@ -1,226 +1,255 @@
1
- /*
2
- * Google Maps Widget
3
- * (c) Web factory Ltd, 2012 - 2015
4
- */
5
-
6
-
7
- jQuery(function($) {
8
- // init JS for each active widget
9
- $(".widget-liquid-right [id*='" + gmw.id_base + "'].widget, .inactive-sidebar [id*='" + gmw.id_base + "'].widget, #accordion-panel-widgets [id*='" + gmw.id_base + "'].customize-control-widget_form").each(function (i, widget) {
10
- gmw_init_widget_ui(widget);
11
- }); // foreach GMW active widget
12
-
13
- // re-init JS on widget update and add
14
- $(document).on('widget-updated', function(event, widget) {
15
- id = $(widget).attr('id');
16
- if (id.indexOf(gmw.id_base) != -1) {
17
- gmw_init_widget_ui(widget);
18
- }
19
- });
20
- $(document).on('widget-added', function(event, widget) {
21
- id = $(widget).attr('id');
22
- if (id.indexOf(gmw.id_base) != -1) {
23
- gmw_init_widget_ui(widget);
24
- }
25
- });
26
-
27
-
28
- // init JS UI for an individual GMW
29
- function gmw_init_widget_ui(widget) {
30
- // handle dropdown fields that have dependant fields
31
- $('.gmw_thumb_pin_type', widget).on('change', function(e) {
32
- gmw_change_pin_type(widget);
33
- }).trigger('change');
34
- $('.gmw_thumb_link_type', widget).on('change', function(e) {
35
- gmw_change_link_type(widget);
36
- }).trigger('change');
37
- $('.gmw_thumb_color_scheme', widget).on('change', function(e) {
38
- gmw_promo_option_change(widget, '.gmw_thumb_color_scheme');
39
- });
40
- $('.gmw_lightbox_skin', widget).on('change', function(e) {
41
- gmw_promo_option_change(widget, '.gmw_lightbox_skin');
42
- });
43
-
44
- // open promo/activation dialog
45
- $('.open_promo_dialog', widget).on('click', function(e) {
46
- e.preventDefault();
47
- gmw_open_promo_dialog(this);
48
-
49
- return false;
50
- });
51
-
52
- // init tabs
53
- $('.gmw-tabs', widget).tabs({ active: gmw_get_active_tab($('.gmw-tabs', widget).attr('id')),
54
- activate: function(event, ui) { gmw_save_active_tab(this); }
55
- });
56
- } // gmw_init_widget_ui
57
-
58
-
59
- // get active tab index from cookie
60
- function gmw_get_active_tab(el_id) {
61
- id = parseInt(0 + $.cookie(el_id), 10);
62
- if (isNaN(id) === true) {
63
- id = 0;
64
- }
65
-
66
- return id;
67
- } // get_active_tab
68
-
69
-
70
- // save active tab index to cookie
71
- function gmw_save_active_tab(elem) {
72
- $.cookie($(elem).attr('id'), $(elem).tabs('option', 'active'), { expires: 30 });
73
- } // save_active_tab
74
-
75
-
76
- // show/hide custom link field based on user's link type choice
77
- function gmw_change_link_type(widget) {
78
- if ($('.gmw_thumb_link_type', widget).val() == 'custom') {
79
- $('.gmw_thumb_link_section', widget).show();
80
- } else {
81
- $('.gmw_thumb_link_section', widget).hide();
82
- }
83
- } // link_type
84
-
85
-
86
- // show/hide custom pin URL field based on user's pin type choice
87
- function gmw_change_pin_type(widget) {
88
- if ($('.gmw_thumb_pin_type', widget).val() == 'custom') {
89
- $('.gmw_thumb_pin_type_custom_section', widget).show();
90
- $('.gmw_thumb_pin_type_predefined_section', widget).hide();
91
- } else {
92
- $('.gmw_thumb_pin_type_custom_section', widget).hide();
93
- $('.gmw_thumb_pin_type_predefined_section', widget).show();
94
- }
95
- } // pin_type
96
-
97
-
98
- // extra features related functions
99
- // open promo dialog on load
100
- if (window.location.search.search('gmw_open_promo_dialog') != -1) {
101
- gmw_open_promo_dialog();
102
- }
103
-
104
-
105
- // opens promo dialog when special value is selected in widget's options
106
- function gmw_promo_option_change(widget, el) {
107
- if (($(el, widget).val()) == '-1') {
108
- $(el, widget).find('option').attr('selected', '');
109
- $(el, widget).find('option:first').attr('selected', 'selected');
110
- gmw_open_promo_dialog(widget);
111
- }
112
- } // promo_option_change
113
-
114
-
115
- // already subscribed button in dialog
116
- $('#gmw_already_subscribed').on('click', function(e) {
117
- e.preventDefault();
118
- $('#gmw_dialog_subscribe').hide();
119
- $('#gmw_dialog_activate').show();
120
-
121
- return false;
122
- }); // already subscribed click
123
-
124
-
125
- // subscribe button in dialog
126
- $('#gmw_subscribe').on('click', function(e) {
127
- e.preventDefault();
128
-
129
- err = false;
130
- $('#gmw_promo_dialog input.error').removeClass('error');
131
- $('#gmw_promo_dialog span.error').hide();
132
-
133
- if ($('#gmw_name').val().length < 3) {
134
- $('#gmw_name').addClass('error');
135
- $('#gmw_promo_dialog span.error.name').show();
136
- $('#gmw_name').focus().select();
137
-
138
- err = true;
139
- } // check name
140
-
141
- re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
142
- if (!re.test($('#gmw_email').val())) {
143
- $('#gmw_email').addClass('error');
144
- $('#gmw_promo_dialog span.error.email').show();
145
- $('#gmw_email').focus().select();
146
- return false;
147
- }
148
-
149
- if (err) {
150
- return false;
151
- }
152
-
153
- $.post(ajaxurl,
154
- { 'action': 'gmw_subscribe',
155
- 'name': $('#gmw_name').val(),
156
- 'email': $('#gmw_email').val()
157
- },
158
- function(data) {
159
- if (data && data.success == true) {
160
- $('#gmw_dialog_subscribe').hide();
161
- $('#gmw_dialog_activate').show();
162
- alert(gmw.subscribe_ok);
163
- } else if (data && data.success == false && data.data == 'duplicate') {
164
- $('#gmw_dialog_subscribe').hide();
165
- $('#gmw_dialog_activate').show();
166
- alert(gmw.subscribe_duplicate);
167
- } else {
168
- alert(gmw.subscribe_error);
169
- }
170
- }, 'json').fail(function() {
171
- alert(gmw.undocumented_error);
172
- });
173
-
174
- return false;
175
- }); // subscribe click
176
-
177
-
178
- // check code and activate button in dialog
179
- $('#gmw_activate').on('click', function(e) {
180
- e.preventDefault();
181
-
182
- $('#gmw_promo_dialog input.error').removeClass('error');
183
- $('#gmw_promo_dialog span.error').hide();
184
-
185
- $.post(ajaxurl, { action: 'gmw_activate', 'code': $('#gmw_code').val()}, function(data) {
186
- if (data && data.success == true) {
187
- alert(gmw.activate_ok);
188
- if ($('#gmw_promo_dialog').data('widget-id')) {
189
- $('#' + $('#gmw_promo_dialog').data('widget-id') + ' .widget-control-save').trigger('click');
190
- $('#gmw_activate_notice').hide();
191
- $('#gmw_promo_dialog').dialog('close');
192
- } else {
193
- window.location = 'widgets.php';
194
- }
195
- } else {
196
- $('#gmw_promo_dialog span.error.gmw_code').show();
197
- $('#gmw_code').focus().select();
198
- }
199
- }, 'json').fail(function() {
200
- alert(gmw.undocumented_error);
201
- });
202
-
203
- return false;
204
- }); // activate button click
205
-
206
-
207
- // open promo/activation dialog
208
- function gmw_open_promo_dialog(widget) {
209
- $('#gmw_dialog_subscribe').show();
210
- $('#gmw_dialog_activate').hide();
211
-
212
- $('#gmw_promo_dialog').dialog({
213
- 'dialogClass' : 'wp-dialog gmw-dialog',
214
- 'modal' : true,
215
- 'width': 650,
216
- 'title': gmw.dialog_title,
217
- 'autoOpen': false,
218
- 'closeOnEscape': true,
219
- close: function(event, ui) { $('#gmw_promo_dialog').data('widget-id', ''); }
220
- }).dialog('open');
221
-
222
- if (widget) {
223
- $('#gmw_promo_dialog').data('widget-id', $(widget).parents('div.widget').attr('id'));
224
- }
225
- } // open_promo_dialog
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  }); // onload
1
+ /*
2
+ * Google Maps Widget
3
+ * (c) Web factory Ltd, 2012 - 2015
4
+ */
5
+
6
+
7
+ jQuery(function($) {
8
+ // init JS for each active widget
9
+ $(".widget-liquid-right [id*='" + gmw.id_base + "'].widget, .inactive-sidebar [id*='" + gmw.id_base + "'].widget, #accordion-panel-widgets [id*='" + gmw.id_base + "'].customize-control-widget_form").each(function (i, widget) {
10
+ gmw_init_widget_ui(widget);
11
+ }); // foreach GMW active widget
12
+
13
+ // re-init JS on widget update and add
14
+ $(document).on('widget-updated', function(event, widget) {
15
+ id = $(widget).attr('id');
16
+ if (id.indexOf(gmw.id_base) != -1) {
17
+ gmw_init_widget_ui(widget);
18
+ }
19
+ });
20
+ $(document).on('widget-added', function(event, widget) {
21
+ id = $(widget).attr('id');
22
+ if (id.indexOf(gmw.id_base) != -1) {
23
+ gmw_init_widget_ui(widget);
24
+ }
25
+ });
26
+
27
+
28
+ // init JS UI for an individual GMW
29
+ function gmw_init_widget_ui(widget) {
30
+ // handle dropdown fields that have dependant fields
31
+ $('.gmw_thumb_pin_type', widget).on('change', function(e) {
32
+ gmw_change_pin_type(widget);
33
+ }).trigger('change');
34
+ $('.gmw_thumb_link_type', widget).on('change', function(e) {
35
+ gmw_change_link_type(widget);
36
+ }).trigger('change');
37
+ $('.gmw_thumb_color_scheme', widget).on('change', function(e) {
38
+ gmw_promo_option_change(widget, '.gmw_thumb_color_scheme');
39
+ });
40
+ $('.gmw_lightbox_skin', widget).on('change', function(e) {
41
+ gmw_promo_option_change(widget, '.gmw_lightbox_skin');
42
+ });
43
+
44
+ // open promo/activation dialog
45
+ $('.open_promo_dialog', widget).on('click', function(e) {
46
+ e.preventDefault();
47
+ gmw_open_promo_dialog(this);
48
+
49
+ return false;
50
+ });
51
+
52
+ // init tabs
53
+ $('.gmw-tabs', widget).tabs({ active: gmw_get_active_tab($('.gmw-tabs', widget).attr('id')),
54
+ activate: function(event, ui) { gmw_save_active_tab(this); }
55
+ });
56
+ } // gmw_init_widget_ui
57
+
58
+
59
+ // get active tab index from cookie
60
+ function gmw_get_active_tab(el_id) {
61
+ id = parseInt(0 + $.cookie(el_id), 10);
62
+ if (isNaN(id) === true) {
63
+ id = 0;
64
+ }
65
+
66
+ return id;
67
+ } // get_active_tab
68
+
69
+
70
+ // save active tab index to cookie
71
+ function gmw_save_active_tab(elem) {
72
+ $.cookie($(elem).attr('id'), $(elem).tabs('option', 'active'), { expires: 30 });
73
+ } // save_active_tab
74
+
75
+
76
+ // show/hide custom link field based on user's link type choice
77
+ function gmw_change_link_type(widget) {
78
+ if ($('.gmw_thumb_link_type', widget).val() == 'custom') {
79
+ $('.gmw_thumb_link_section', widget).show();
80
+ } else {
81
+ $('.gmw_thumb_link_section', widget).hide();
82
+ }
83
+ } // link_type
84
+
85
+
86
+ // show/hide custom pin URL field based on user's pin type choice
87
+ function gmw_change_pin_type(widget) {
88
+ if ($('.gmw_thumb_pin_type', widget).val() == 'custom') {
89
+ $('.gmw_thumb_pin_type_custom_section', widget).show();
90
+ $('.gmw_thumb_pin_type_predefined_section', widget).hide();
91
+ } else {
92
+ $('.gmw_thumb_pin_type_custom_section', widget).hide();
93
+ $('.gmw_thumb_pin_type_predefined_section', widget).show();
94
+ }
95
+ } // pin_type
96
+
97
+
98
+ // extra features related functions
99
+ // open promo dialog on load
100
+ if (window.location.search.search('gmw_open_promo_dialog') != -1) {
101
+ gmw_open_promo_dialog();
102
+ }
103
+
104
+
105
+ // opens promo dialog when special value is selected in widget's options
106
+ function gmw_promo_option_change(widget, el) {
107
+ if (($(el, widget).val()) == '-1') {
108
+ $(el, widget).find('option').attr('selected', '');
109
+ $(el, widget).find('option:first').attr('selected', 'selected');
110
+ gmw_open_promo_dialog(widget);
111
+ }
112
+ } // promo_option_change
113
+
114
+
115
+ // already subscribed button in dialog
116
+ $('.gmw_goto_activation').on('click', function(e) {
117
+ $('#gmw_dialog_intro').hide();
118
+ $('#gmw_dialog_subscribe').hide();
119
+ $('#gmw_dialog_activate').show();
120
+
121
+ if ($(this).data('noprevent')) {
122
+ return true;
123
+ } else {
124
+ e.preventDefault();
125
+ return false;
126
+ }
127
+ }); // already subscribed click
128
+
129
+
130
+ // go to intro button in dialog
131
+ $('.gmw_goto_intro').on('click', function(e) {
132
+ e.preventDefault();
133
+ $('#gmw_dialog_intro').show();
134
+ $('#gmw_dialog_subscribe').hide();
135
+ $('#gmw_dialog_activate').hide();
136
+
137
+ return false;
138
+ }); // go to intro click
139
+
140
+
141
+ // go to subscribe in dialog
142
+ $('.gmw_goto_subscribe').on('click', function(e) {
143
+ e.preventDefault();
144
+ $('#gmw_dialog_intro').hide();
145
+ $('#gmw_dialog_subscribe').show();
146
+ $('#gmw_dialog_activate').hide();
147
+
148
+ return false;
149
+ }); // already subscribed click
150
+
151
+
152
+ // subscribe button in dialog
153
+ $('#gmw_subscribe').on('click', function(e) {
154
+ e.preventDefault();
155
+
156
+ err = false;
157
+ $('#gmw_promo_dialog input.error').removeClass('error');
158
+ $('#gmw_promo_dialog span.error').hide();
159
+
160
+ if ($('#gmw_name').val().length < 3) {
161
+ $('#gmw_name').addClass('error');
162
+ $('#gmw_promo_dialog span.error.name').show();
163
+ $('#gmw_name').focus().select();
164
+
165
+ err = true;
166
+ } // check name
167
+
168
+ re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
169
+ if (!re.test($('#gmw_email').val())) {
170
+ $('#gmw_email').addClass('error');
171
+ $('#gmw_promo_dialog span.error.email').show();
172
+ $('#gmw_email').focus().select();
173
+ return false;
174
+ }
175
+
176
+ if (err) {
177
+ return false;
178
+ }
179
+
180
+ $.post(ajaxurl,
181
+ { 'action': 'gmw_subscribe',
182
+ 'name': $('#gmw_name').val(),
183
+ 'email': $('#gmw_email').val()
184
+ },
185
+ function(data) {
186
+ if (data && data.success == true) {
187
+ $('#gmw_dialog_subscribe').hide();
188
+ $('#gmw_dialog_activate').show();
189
+ alert(gmw.subscribe_ok);
190
+ } else if (data && data.success == false && data.data == 'duplicate') {
191
+ $('#gmw_dialog_subscribe').hide();
192
+ $('#gmw_dialog_activate').show();
193
+ alert(gmw.subscribe_duplicate);
194
+ } else {
195
+ alert(gmw.subscribe_error);
196
+ }
197
+ }, 'json').fail(function() {
198
+ alert(gmw.undocumented_error);
199
+ });
200
+
201
+ return false;
202
+ }); // subscribe click
203
+
204
+
205
+ // check code and activate button in dialog
206
+ $('#gmw_activate').on('click', function(e) {
207
+ e.preventDefault();
208
+
209
+ $('#gmw_promo_dialog input.error').removeClass('error');
210
+ $('#gmw_promo_dialog span.error').hide();
211
+
212
+ $.post(ajaxurl, { action: 'gmw_activate', 'code': $('#gmw_code').val()}, function(data) {
213
+ if (data && data.success == true) {
214
+ alert(gmw.activate_ok);
215
+ if ($('#gmw_promo_dialog').data('widget-id')) {
216
+ $('#' + $('#gmw_promo_dialog').data('widget-id') + ' .widget-control-save').trigger('click');
217
+ $('#gmw_activate_notice').hide();
218
+ $('#gmw_promo_dialog').dialog('close');
219
+ } else {
220
+ window.location = 'widgets.php';
221
+ }
222
+ } else {
223
+ $('#gmw_promo_dialog span.error.gmw_code').show();
224
+ $('#gmw_code').focus().select();
225
+ }
226
+ }, 'json').fail(function() {
227
+ alert(gmw.undocumented_error);
228
+ });
229
+
230
+ return false;
231
+ }); // activate button click
232
+
233
+
234
+ // open promo/activation dialog
235
+ function gmw_open_promo_dialog(widget) {
236
+ $('#gmw_dialog_intro').show();
237
+ $('#gmw_dialog_subscribe').hide();
238
+ $('#gmw_dialog_activate').hide();
239
+
240
+ $('#gmw_promo_dialog').dialog({
241
+ 'dialogClass' : 'wp-dialog gmw-dialog',
242
+ 'modal' : true,
243
+ 'width': 650,
244
+ 'title': gmw.dialog_title,
245
+ 'autoOpen': false,
246
+ 'closeOnEscape': true,
247
+ create: function(event, ui) { $(this).siblings().find('span.ui-dialog-title').html(gmw.dialog_title); },
248
+ close: function(event, ui) { $('#gmw_promo_dialog').data('widget-id', ''); }
249
+ }).dialog('open');
250
+
251
+ if (widget) {
252
+ $('#gmw_promo_dialog').data('widget-id', $(widget).parents('div.widget').attr('id'));
253
+ }
254
+ } // open_promo_dialog
255
  }); // onload
readme.txt CHANGED
@@ -5,8 +5,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?business=gordan@webfactoryltd
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 3.3
8
- Tested up to: 4.3
9
- Stable tag: 2.85
10
 
11
  Displays a single-image super-fast loading Google map in a widget. A larger map with all the usual features is available on click in a lightbox.
12
 
@@ -121,6 +121,11 @@ If you can't figure it out open a thread in the support forums.
121
  6. Widget options - info & support
122
 
123
  == Changelog ==
 
 
 
 
 
124
  = 2.85 =
125
  * 2015/12/02
126
  * enhancements in PHP
5
  License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 3.3
8
+ Tested up to: 4.4
9
+ Stable tag: 2.90
10
 
11
  Displays a single-image super-fast loading Google map in a widget. A larger map with all the usual features is available on click in a lightbox.
12
 
121
  6. Widget options - info & support
122
 
123
  == Changelog ==
124
+ = 2.90 =
125
+ * 2015/12/14
126
+ * added option for donating
127
+ * checked WP v4.4 compatibility
128
+
129
  = 2.85 =
130
  * 2015/12/02
131
  * enhancements in PHP