Google Maps Plugin by Intergeo - Version 2.1.0

Version Description

Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Google Maps Plugin by Intergeo
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.0 to 2.1.0

CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
 
 
 
 
2
- Release 2.1
3
 
4
 
5
 
6
- Refactored for the new options in the pro version
1
 
2
+
3
+
4
+
5
+
6
 
7
 
8
 
 
css/frontend.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- * Version: 2.0.0
3
  */
4
 
5
  .intergeo_map_canvas img {
1
  /*
2
+ * Version: 2.1.0
3
  */
4
 
5
  .intergeo_map_canvas img {
css/library.css CHANGED
@@ -113,14 +113,14 @@
113
  width: 16%;
114
  }
115
 
116
- .intergeo_sidebar_subscribe {
117
  margin-bottom: 20px;
118
  padding: 10px;
119
  border: 1px solid #ccc;
120
  background: #fff;
121
  }
122
 
123
- .intergeo_sidebar_subscribe h3 {
124
  margin: 0;
125
  }
126
 
113
  width: 16%;
114
  }
115
 
116
+ #intergeo-subscribe-box {
117
  margin-bottom: 20px;
118
  padding: 10px;
119
  border: 1px solid #ccc;
120
  background: #fff;
121
  }
122
 
123
+ #intergeo-subscribe-box h3 {
124
  margin: 0;
125
  }
126
 
dashboard/dashboard.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+ if ( ! class_exists( 'THEMEISLE_DASHBOARD' ) ) {
6
+ /**
7
+ * Dashboard Widget
8
+ */
9
+ final class THEMEISLE_DASHBOARD {
10
+
11
+ /**
12
+ * The script version
13
+ *
14
+ * @var string Script version
15
+ */
16
+ public $script_version = '1.0.0';
17
+ /**
18
+ * The script url
19
+ *
20
+ * @var string The URL of the script
21
+ */
22
+ public $script_url;
23
+
24
+ /**
25
+ * The class instance
26
+ *
27
+ * @var THEMEISLE_DASHBOARD The singleton instance of the class
28
+ */
29
+ public static $instance;
30
+
31
+ /**
32
+ * The title of the widget
33
+ *
34
+ * @var string The dashboard widget title
35
+ */
36
+ public $dashboard_name;
37
+ /**
38
+ * Array that holds the urls of the blog feeds
39
+ *
40
+ * @var array Feeds to fetch news from
41
+ */
42
+ public $feeds;
43
+ /**
44
+ * The feed items array
45
+ *
46
+ * @var array The feeds items
47
+ */
48
+ public $items;
49
+
50
+ /**
51
+ * The instance of the class
52
+ *
53
+ * @var THEMEISLE_DASHBOARD The singleton instance
54
+ */
55
+ public static function instance() {
56
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof THEMEISLE_DASHBOARD ) ) {
57
+ self::$instance = new THEMEISLE_DASHBOARD;
58
+ self::$instance->setup_vars();
59
+ self::$instance->load_hooks();
60
+ }
61
+
62
+ return self::$instance;
63
+ }
64
+
65
+ /**
66
+ * Load hooks to show the widget
67
+ */
68
+ public function load_hooks() {
69
+ add_action( 'wp_dashboard_setup', array( &$this, 'add_widget' ) );
70
+ add_action( 'wp_network_dashboard_setup', array( &$this, 'add_widget' ) );
71
+ }
72
+
73
+ /**
74
+ * Setup class variables
75
+ */
76
+ public function setup_vars() {
77
+ $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', 'WordPress Guides/Tutorials' );
78
+ $this->feeds = apply_filters( 'themeisle_sdk_dashboard_widget_feeds', array(
79
+ 'https://themeisle.com/blog/feed'
80
+ ) );
81
+ $abs = untrailingslashit( ( dirname( __FILE__ ) ) );
82
+ $parts = str_replace( untrailingslashit( ABSPATH ), '', $abs );
83
+ $parts = explode( DIRECTORY_SEPARATOR, $parts );
84
+ $parts = array_filter( $parts );
85
+ $this->script_url = site_url() . '/' . implode( '/', $parts );
86
+ }
87
+
88
+ /**
89
+ * Add widget to the dashboard
90
+ *
91
+ * @return string|void
92
+ */
93
+ function add_widget() {
94
+ global $wp_meta_boxes;
95
+ if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) {
96
+ return;
97
+ }
98
+ // Load SimplePie Instance
99
+ $feed = fetch_feed( $this->feeds );
100
+ // TODO report error when is an error loading the feed
101
+ if ( is_wp_error( $feed ) ) {
102
+ return '';
103
+ }
104
+ $feed->enable_cache( true );
105
+ $feed->enable_order_by_date( true );
106
+ $feed->set_cache_class( 'WP_Feed_Cache' );
107
+ $feed->set_file_class( 'WP_SimplePie_File' );
108
+ $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 7200, $this->feeds ) );
109
+ do_action_ref_array( 'wp_feed_options', array( $feed, $this->feeds ) );
110
+ $feed->strip_comments( true );
111
+ $feed->strip_htmltags( array(
112
+ 'base',
113
+ 'blink',
114
+ 'body',
115
+ 'doctype',
116
+ 'embed',
117
+ 'font',
118
+ 'form',
119
+ 'frame',
120
+ 'frameset',
121
+ 'html',
122
+ 'iframe',
123
+ 'input',
124
+ 'marquee',
125
+ 'meta',
126
+ 'noscript',
127
+ 'object',
128
+ 'param',
129
+ 'script',
130
+ 'style',
131
+ ) );
132
+ $feed->init();
133
+ $feed->handle_content_type();
134
+ $items = $feed->get_items( 0, 5 );
135
+ foreach ( (array) $items as $item ) {
136
+ $this->items[] = array(
137
+ 'title' => $item->get_title(),
138
+ 'date' => $item->get_date( 'U' ),
139
+ 'link' => $item->get_permalink(),
140
+ );
141
+ }
142
+ wp_add_dashboard_widget( 'themeisle', $this->dashboard_name, array(
143
+ &$this,
144
+ 'render_dashboard_widget',
145
+ ) );
146
+ }
147
+
148
+ /**
149
+ * Render widget content
150
+ */
151
+ function render_dashboard_widget() {
152
+ ?>
153
+ <style type="text/css">
154
+ #themeisle h2.hndle {
155
+ background-image: url(<?php echo $this->script_url; ?>/logo.png);
156
+ background-repeat: no-repeat;
157
+ background-position: 90% 50%;
158
+ background-size: 29px;
159
+ }
160
+
161
+ .ti-dw-feed-item {
162
+ display: flex;
163
+ align-items: center;
164
+ }
165
+
166
+ .ti-dw-feed-item a {
167
+ float: left;
168
+ width: 89.9%;
169
+ }
170
+
171
+ .ti-dw-feed-item .ti-dw-day-container {
172
+ width: 100%;
173
+ letter-spacing: 3px;
174
+ display: block;
175
+ }
176
+
177
+ .ti-dw-feed-item .ti-dw-month-container {
178
+
179
+ width: 100%;
180
+ display: block;
181
+ font-weight: 600;
182
+ padding: 0px;
183
+ margin-top: -6px;
184
+ text-transform: uppercase;
185
+ font-size: 10px;
186
+ letter-spacing: 1px;
187
+ }
188
+
189
+ .ti-dw-feed-item .ti-dw-date-container {
190
+ float: left;
191
+ min-height: 30px;
192
+ margin-right: 0.1%;
193
+ width: 10%;
194
+ text-align: center;
195
+ }
196
+
197
+ </style>
198
+ <ul>
199
+ <?php
200
+ foreach ( $this->items as $item ) {
201
+ ?>
202
+ <li class="ti-dw-feed-item"><span class="ti-dw-date-container"><span
203
+ class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
204
+ class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><a
205
+ href="<?php echo add_query_arg(
206
+ array(
207
+ 'utm_campaign' => 'feed',
208
+ 'utm_medium' => 'dashboard_widget',
209
+ ), $item['link'] ); ?>" target="_blank"><?php echo $item['title']; ?></a>
210
+ <div class="clear"></div>
211
+ </li>
212
+ <?php
213
+ }
214
+ ?>
215
+ </ul>
216
+
217
+ <?php
218
+
219
+ }
220
+ }
221
+
222
+ }
223
+ /**
224
+ * The helper method to run the class
225
+ *
226
+ * @return THEMEISLE_DASHBOARD
227
+ */
228
+ function themeisle_dashboard_widget() {
229
+ return THEMEISLE_DASHBOARD::instance();
230
+ }
231
+
232
+ themeisle_dashboard_widget();
dashboard/logo.png ADDED
Binary file
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Intergeo - Google Maps Plugin
4
  Plugin URI: http://themeisle.com/plugins/intergeo-maps-lite/
5
  Description: A simple, easy and quite powerful Google Map tool to create, manage and embed custom Google Maps into your WordPress posts and pages. The plugin allows you to deeply customize look and feel of a map, add overlays like markers, rectangles, circles, polylines and polygons to your map. It could even be integraded with your Google Adsense account and show ad on your maps.
6
- Version: 2.0.0
7
  Author: Themeisle
8
  Author URI: http://themeisle.com
9
  License: GPL v2.0 or later
@@ -13,7 +13,7 @@ Domain Path: /languages
13
  */
14
  // <editor-fold defaultstate="collapsed" desc="constants">
15
  define( 'INTERGEO_PLUGIN_NAME', 'intergeo' ); // don't change it whatever
16
- define( 'INTERGEO_VERSION', '2.0.0' );
17
  define( 'INTERGEO_ABSPATH', dirname( __FILE__ ) );
18
  define( 'INTERGEO_ABSURL', plugins_url( '/', __FILE__ ) );
19
  defined( 'WPLANG' ) || define( 'WPLANG', '' );
@@ -1401,3 +1401,4 @@ function intergeo_change_subscribe_list() {
1401
 
1402
  require dirname( __FILE__ ) . '/subscribe/subscribe.php';
1403
  $intergeo_subscribe = new THEMEISLE_SUBSCRIBE( INTERGEO_PLUGIN_NAME );
 
3
  Plugin Name: Intergeo - Google Maps Plugin
4
  Plugin URI: http://themeisle.com/plugins/intergeo-maps-lite/
5
  Description: A simple, easy and quite powerful Google Map tool to create, manage and embed custom Google Maps into your WordPress posts and pages. The plugin allows you to deeply customize look and feel of a map, add overlays like markers, rectangles, circles, polylines and polygons to your map. It could even be integraded with your Google Adsense account and show ad on your maps.
6
+ Version: 2.1.0
7
  Author: Themeisle
8
  Author URI: http://themeisle.com
9
  License: GPL v2.0 or later
13
  */
14
  // <editor-fold defaultstate="collapsed" desc="constants">
15
  define( 'INTERGEO_PLUGIN_NAME', 'intergeo' ); // don't change it whatever
16
+ define( 'INTERGEO_VERSION', '2.1.0' );
17
  define( 'INTERGEO_ABSPATH', dirname( __FILE__ ) );
18
  define( 'INTERGEO_ABSURL', plugins_url( '/', __FILE__ ) );
19
  defined( 'WPLANG' ) || define( 'WPLANG', '' );
1401
 
1402
  require dirname( __FILE__ ) . '/subscribe/subscribe.php';
1403
  $intergeo_subscribe = new THEMEISLE_SUBSCRIBE( INTERGEO_PLUGIN_NAME );
1404
+ require dirname( __FILE__ ) . '/dashboard/dashboard.php';
languages/intergeo-maps.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Intergeo - Google Maps Plugin 2.0.0\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/intergeo-maps/issues\n"
7
- "POT-Creation-Date: 2017-01-05 15:34:22+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -985,19 +985,19 @@ msgstr ""
985
  msgid "Add New"
986
  msgstr ""
987
 
988
- #: templates/library/list.php:102
989
  msgid "Edit"
990
  msgstr ""
991
 
992
- #: templates/library/list.php:103
993
  msgid "Copy"
994
  msgstr ""
995
 
996
- #: templates/library/list.php:104
997
  msgid "Delete"
998
  msgstr ""
999
 
1000
- #: templates/library/list.php:139
1001
  msgid ""
1002
  "You do not have created maps. Start adding it by clicking \"Add New\" "
1003
  "button."
4
  msgstr ""
5
  "Project-Id-Version: Intergeo - Google Maps Plugin 2.0.0\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/intergeo-maps/issues\n"
7
+ "POT-Creation-Date: 2017-01-12 14:27:36+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
985
  msgid "Add New"
986
  msgstr ""
987
 
988
+ #: templates/library/list.php:100
989
  msgid "Edit"
990
  msgstr ""
991
 
992
+ #: templates/library/list.php:101
993
  msgid "Copy"
994
  msgstr ""
995
 
996
+ #: templates/library/list.php:102
997
  msgid "Delete"
998
  msgstr ""
999
 
1000
+ #: templates/library/list.php:137
1001
  msgid ""
1002
  "You do not have created maps. Start adding it by clicking \"Add New\" "
1003
  "button."
subscribe/subscribe.js CHANGED
@@ -1,4 +1,4 @@
1
- (function($, ti){
2
  $(document).ready(function(){
3
  $('.themeisle-sdk-subscribe-btn').on('click', function(e){
4
  var slug = $(this).data('product-slug');
@@ -20,4 +20,4 @@
20
  });
21
  });
22
  });
23
- })(jQuery, ti);
1
+ (function($){
2
  $(document).ready(function(){
3
  $('.themeisle-sdk-subscribe-btn').on('click', function(e){
4
  var slug = $(this).data('product-slug');
20
  });
21
  });
22
  });
23
+ })(jQuery);
subscribe/subscribe.php CHANGED
@@ -20,12 +20,6 @@ if ( ! class_exists( 'THEMEISLE_SUBSCRIBE' ) ) {
20
  * @var Slug of the product which use this script
21
  */
22
  public $product_slug;
23
- /**
24
- * The id where we should subscribe
25
- *
26
- * @var The list id in which to subscribe the user
27
- */
28
- public $list_id;
29
  /**
30
  * The script url
31
  *
@@ -63,7 +57,7 @@ if ( ! class_exists( 'THEMEISLE_SUBSCRIBE' ) ) {
63
  * @param $slug
64
  */
65
  public function __construct( $slug ) {
66
- $this->product_slug = $slug;
67
  $this->load_hooks();
68
  $this->setup_vars();
69
  }
@@ -74,7 +68,6 @@ if ( ! class_exists( 'THEMEISLE_SUBSCRIBE' ) ) {
74
  public function load_hooks() {
75
  add_action( $this->product_slug . '_render_subscribe_box', array( $this, 'render_box' ) );
76
  add_action( 'wp_ajax_themeisle_sdk_subscribe_' . $this->product_slug, array( $this, 'ajax_subscribe' ) );
77
- $this->list_id = apply_filters( $this->product_slug . '_themeisle_sdk_subscribe_list', $this->list_id );
78
  }
79
 
80
  /**
@@ -93,6 +86,10 @@ if ( ! class_exists( 'THEMEISLE_SUBSCRIBE' ) ) {
93
  * Render the box content
94
  */
95
  public function render_box() {
 
 
 
 
96
  wp_enqueue_script( 'themeisle-sdk-subscribe', $this->script_url . '/subscribe.js', array( 'jquery' ), $this->script_version, true );
97
  wp_localize_script( 'themeisle-sdk-subscribe', 'themeisle_sdk', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
98
  ?>
@@ -100,11 +97,10 @@ if ( ! class_exists( 'THEMEISLE_SUBSCRIBE' ) ) {
100
  <h3 class="themeisle-sdk-title"><?php echo esc_html( apply_filters( $this->product_slug . '_themeisle_subscribe_heading', $this->default_title ) ); ?></h3>
101
  <div class="themeisle-sdk-box-content">
102
  <?php
103
- $subscribed = get_option( $this->product_slug . '_themeisle_sdk_subscribed', 'no' );
104
- $display = ( $subscribed !== 'no' ) ? '' : 'display:none';
105
  echo sprintf( '<div class="themeisle-sdk-subscrive-success" style="' . $display . '"><p> %s </p></div>', esc_html( apply_filters( $this->product_slug . '_themeisle_subscribed_msg', $this->default_success ) ) );
106
  if ( $subscribed === 'no' ) {
107
- echo sprintf( '<fieldset class="themeisle-sdk-subscribe-fieldset"><p> %s </p><input name="themeisle-sdk-subscribe-email" class="themeisle-sdk-subscribe-email" id="' . $this->product_slug . '-themeisle-sdk-email-field" data-nonce="' . wp_create_nonce( $this->product_slug . '_themeisle_sdk_subscribe_nonce' ) . '" type="email" value="' . get_option( 'admin_email' ) . '" /><input type="button" id="' . $this->product_slug . '-themeisle-sdk-email-do" data-product-slug="' . $this->product_slug . '" class="themeisle-sdk-subscribe-btn button" value="' . apply_filters( $this->product_slug . '_themeisle_subscribe_submit', $this->default_submit ) . '"></fieldset>', esc_html( apply_filters( 'themeisle_subscribe_msg', $this->default_subscribe ) ) );
108
  }
109
  ?>
110
  </div>
@@ -126,7 +122,7 @@ if ( ! class_exists( 'THEMEISLE_SUBSCRIBE' ) ) {
126
  'email' => $email,
127
  'attributes' => array( 'NAME' => $user_info->first_name, 'SURNAME' => $user_info->last_name ),
128
  'blacklisted' => 0,
129
- 'listid' => array( $this->list_id ),
130
  'blacklisted_sms' => 0,
131
  );
132
  $status = $mailin->create_update_user( $data );
20
  * @var Slug of the product which use this script
21
  */
22
  public $product_slug;
 
 
 
 
 
 
23
  /**
24
  * The script url
25
  *
57
  * @param $slug
58
  */
59
  public function __construct( $slug ) {
60
+ $this->product_slug = str_replace( '-', '_', $slug );
61
  $this->load_hooks();
62
  $this->setup_vars();
63
  }
68
  public function load_hooks() {
69
  add_action( $this->product_slug . '_render_subscribe_box', array( $this, 'render_box' ) );
70
  add_action( 'wp_ajax_themeisle_sdk_subscribe_' . $this->product_slug, array( $this, 'ajax_subscribe' ) );
 
71
  }
72
 
73
  /**
86
  * Render the box content
87
  */
88
  public function render_box() {
89
+ $subscribed = get_option( $this->product_slug . '_themeisle_sdk_subscribed', 'no' );
90
+ if ( $subscribed === 'yes' ) {
91
+ return '';
92
+ }
93
  wp_enqueue_script( 'themeisle-sdk-subscribe', $this->script_url . '/subscribe.js', array( 'jquery' ), $this->script_version, true );
94
  wp_localize_script( 'themeisle-sdk-subscribe', 'themeisle_sdk', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
95
  ?>
97
  <h3 class="themeisle-sdk-title"><?php echo esc_html( apply_filters( $this->product_slug . '_themeisle_subscribe_heading', $this->default_title ) ); ?></h3>
98
  <div class="themeisle-sdk-box-content">
99
  <?php
100
+ $display = ( $subscribed !== 'no' ) ? '' : 'display:none';
 
101
  echo sprintf( '<div class="themeisle-sdk-subscrive-success" style="' . $display . '"><p> %s </p></div>', esc_html( apply_filters( $this->product_slug . '_themeisle_subscribed_msg', $this->default_success ) ) );
102
  if ( $subscribed === 'no' ) {
103
+ echo sprintf( '<fieldset class="themeisle-sdk-subscribe-fieldset"><p> %s </p><input name="themeisle-sdk-subscribe-email" class="themeisle-sdk-subscribe-email" id="' . $this->product_slug . '-themeisle-sdk-email-field" data-nonce="' . wp_create_nonce( $this->product_slug . '_themeisle_sdk_subscribe_nonce' ) . '" type="email" value="' . get_option( 'admin_email' ) . '" /><input type="button" id="' . $this->product_slug . '-themeisle-sdk-email-do" data-product-slug="' . $this->product_slug . '" class="themeisle-sdk-subscribe-btn button" value="' . apply_filters( $this->product_slug . '_themeisle_subscribe_submit', $this->default_submit ) . '"></fieldset>', esc_html( apply_filters( $this->product_slug . '_themeisle_subscribe_msg', $this->default_subscribe ) ) );
104
  }
105
  ?>
106
  </div>
122
  'email' => $email,
123
  'attributes' => array( 'NAME' => $user_info->first_name, 'SURNAME' => $user_info->last_name ),
124
  'blacklisted' => 0,
125
+ 'listid' => array( apply_filters( $this->product_slug . '_themeisle_sdk_subscribe_list', 0 ) ),
126
  'blacklisted_sms' => 0,
127
  );
128
  $status = $mailin->create_update_user( $data );
templates/library/list.php CHANGED
@@ -60,11 +60,9 @@
60
  <a href="<?php echo INTERGEO_PRO_URL?>" target="_blank" class="btn">Upgrade Now</a>
61
  </div>
62
  <?php endif; ?>
63
- <div class="intergeo_sidebar_subscribe">
64
  <?php
65
  do_action( INTERGEO_PLUGIN_NAME . '_render_subscribe_box' );
66
  ?>
67
- </div>
68
  </div>
69
 
70
  <?php if ( $query->have_posts() ) : ?>
60
  <a href="<?php echo INTERGEO_PRO_URL?>" target="_blank" class="btn">Upgrade Now</a>
61
  </div>
62
  <?php endif; ?>
 
63
  <?php
64
  do_action( INTERGEO_PLUGIN_NAME . '_render_subscribe_box' );
65
  ?>
 
66
  </div>
67
 
68
  <?php if ( $query->have_posts() ) : ?>