Popups, Welcome Bar, Optins and Lead Generation Plugin – Icegram - Version 2.1.6

Version Description

  • Update: UI/UX improvements

=

Download this release

Release Info

Developer Icegram
Plugin Icon 128x128 Popups, Welcome Bar, Optins and Lead Generation Plugin – Icegram
Version 2.1.6
Comparing to
See all releases

Code changes from version 2.1.5 to 2.1.6

icegram.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Icegram - Popups, Optins, CTAs & lot more...
4
  * Plugin URI: https://www.icegram.com/
5
  * Description: All in one solution to inspire, convert and engage your audiences. Action bars, Popup windows, Messengers, Toast notifications and more. Awesome themes and powerful rules.
6
- * Version: 2.1.5
7
  * Tested up to: 5.9.3
8
  * Author: icegram
9
  * Author URI: https://www.icegram.com/
@@ -122,7 +122,7 @@ if ( ! defined( 'IG_PLUGIN_FILE' ) ) {
122
  }
123
 
124
  if ( ! defined( 'IG_PLUGIN_VERSION' ) ) {
125
- define( 'IG_PLUGIN_VERSION', '2.1.5' );
126
  }
127
 
128
  if ( ! defined( 'IG_PRODUCT_ID' ) ) {
3
  * Plugin Name: Icegram - Popups, Optins, CTAs & lot more...
4
  * Plugin URI: https://www.icegram.com/
5
  * Description: All in one solution to inspire, convert and engage your audiences. Action bars, Popup windows, Messengers, Toast notifications and more. Awesome themes and powerful rules.
6
+ * Version: 2.1.6
7
  * Tested up to: 5.9.3
8
  * Author: icegram
9
  * Author URI: https://www.icegram.com/
122
  }
123
 
124
  if ( ! defined( 'IG_PLUGIN_VERSION' ) ) {
125
+ define( 'IG_PLUGIN_VERSION', '2.1.6' );
126
  }
127
 
128
  if ( ! defined( 'IG_PRODUCT_ID' ) ) {
lite/assets/images/IG-white_logo-transparent_back-512.png ADDED
Binary file
lite/class-icegram.php CHANGED
@@ -51,8 +51,8 @@ if ( ! class_exists( 'Icegram' ) ) {
51
 
52
  add_action( 'admin_init', array( &$this, 'import_gallery_item' ) );
53
 
54
- add_action( 'icegram_settings_after', array( &$this, 'klawoo_subscribe_form' ) );
55
- add_action( 'icegram_about_changelog', array( &$this, 'klawoo_subscribe_form' ) );
56
  add_action( 'icegram_settings_after', array( &$this, 'icegram_houskeeping' ) );
57
  add_action( 'admin_notices', array( &$this, 'add_admin_notices' ) );
58
  add_filter( 'plugin_action_links_' . plugin_basename( IG_PLUGIN_FILE ), array( $this, 'ig_plugin_settings_link' ), 11, 2 );
@@ -61,6 +61,8 @@ if ( ! class_exists( 'Icegram' ) ) {
61
  add_action( 'manage_ig_campaign_posts_custom_column', array( $this, 'edit_columns' ), 2 );
62
  // Ajax handler for campaign status toggle.
63
  add_action( 'wp_ajax_ig_toggle_campaign_status', array( $this, 'toggle_campaign_status' ) );
 
 
64
 
65
  } else {
66
  add_action( 'wp_footer', array( &$this, 'icegram_load_data' ) );
@@ -97,7 +99,7 @@ if ( ! class_exists( 'Icegram' ) ) {
97
  }
98
  add_action( 'wp_ajax_icegram_event_track', array( &$this, 'icegram_event_track' ) );
99
  add_action( 'wp_ajax_nopriv_icegram_event_track', array( &$this, 'icegram_event_track' ) );
100
- add_action( 'wp_ajax_klawoo_subscribe', array( &$this, 'klawoo_subscribe' ) );
101
  add_action( 'wp_ajax_icegram_run_housekeeping', array( &$this, 'run_housekeeping' ) );
102
  add_action( 'wp_ajax_save_gallery_data', array( &$this, 'save_gallery_data' ) );
103
 
@@ -214,7 +216,7 @@ if ( ! class_exists( 'Icegram' ) ) {
214
  }
215
  }
216
 
217
- public function klawoo_subscribe_form() {
218
  ?>
219
  <div class="wrap">
220
  <?php
@@ -228,45 +230,66 @@ if ( ! class_exists( 'Icegram' ) ) {
228
  <tr>
229
  <th scope="row"><?php _e( 'Get add-ons and tips...', 'icegram' ) ?></th>
230
  <td>
231
- <form name="klawoo_subscribe" action="#" method="POST" accept-charset="utf-8">
232
- <input class="ltr" type="text" name="name" id="name" placeholder="Name"/>
233
- <input class="regular-text ltr" type="text" name="email" id="email" placeholder="Email" value="<?php echo $customer_email ?>"/>
234
- <input type="hidden" name="list" value="7I763v6Ldrs3YhJeee5EOgFA"/>
235
- <input type="submit" name="submit" id="submit" class="button button-primary" value="Subscribe">
236
- <br><br>
237
- <input type="checkbox" name="es-gdpr-agree" id="es-gdpr-agree" value="1" required="required">
238
- <label for="es-gdpr-agree"><?php echo sprintf( __( 'I have read and agreed to our %s.', 'icegram' ), '<a href="https://www.icegram.com/privacy-policy/" target="_blank">' . __( 'Privacy Policy', 'icegram' ) . '</a>' ); ?></label>
239
- <br>
240
- </form>
241
- <div id="klawoo_response"></div>
 
242
  </td>
243
  </tr>
244
  </table>
245
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
246
  <script type="text/javascript">
247
  jQuery(function () {
248
- jQuery("form[name=klawoo_subscribe]").submit(function (e) {
249
  e.preventDefault();
250
-
251
- jQuery('#klawoo_response').html('');
252
- params = jQuery("form[name=klawoo_subscribe]").serializeArray();
253
- params.push({name: 'action', value: 'klawoo_subscribe'});
 
 
 
254
 
255
- // Add ajax security nonce.
256
- params.push({
257
- name: 'security',
258
- value: '<?php echo wp_create_nonce( 'ig-klawoo-subscription-form' );?>',
259
- });
260
  jQuery.ajax({
261
  method: 'POST',
262
  type: 'text',
263
  url: "<?php echo admin_url( 'admin-ajax.php' ); ?>",
264
- data: params,
265
- success: function (response) {
266
- if (response != '') {
267
- jQuery('#klawoo_response').html(response);
 
 
 
 
 
 
 
268
  } else {
269
- jQuery('#klawoo_response').html('error!');
 
 
 
270
  }
271
  }
272
  });
@@ -276,49 +299,77 @@ if ( ! class_exists( 'Icegram' ) ) {
276
  <?php
277
  }
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
 
280
- public function klawoo_subscribe() {
 
 
281
 
282
- check_ajax_referer( 'ig-klawoo-subscription-form', 'security' );
283
 
284
- $url = 'http://app.klawoo.com/subscribe';
 
 
 
 
 
285
 
286
- if ( ! empty( $_POST ) ) {
287
- $params = $_POST;
288
- } else {
289
- exit();
290
- }
291
- $method = 'POST';
292
- $qs = http_build_query( $params );
293
 
294
- $options = array(
295
- 'timeout' => 15,
296
- 'method' => $method
297
- );
298
 
299
- if ( $method == 'POST' ) {
300
- $options['body'] = $qs;
301
- } else {
302
- if ( strpos( $url, '?' ) !== false ) {
303
- $url .= '&' . $qs;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  } else {
305
- $url .= '?' . $qs;
306
  }
307
  }
308
 
309
- $response = wp_remote_request( $url, $options );
310
- if ( wp_remote_retrieve_response_code( $response ) == 200 ) {
311
- $data = $response['body'];
312
- if ( $data != 'error' ) {
313
-
314
- $message_start = substr( $data, strpos( $data, '<body>' ) + 6 );
315
- $remove = substr( $message_start, strpos( $message_start, '</body>' ) );
316
- $message = trim( str_replace( $remove, '', $message_start ) );
317
- echo( $message );
318
- exit();
319
- }
320
- }
321
- exit();
322
  }
323
 
324
  public function icegram_houskeeping() {
@@ -2301,84 +2352,184 @@ if ( ! class_exists( 'Icegram' ) ) {
2301
  }
2302
 
2303
  /**
2304
- * Is IG PRO?
2305
- *
2306
- * @return bool
2307
- *
2308
- * @since
2309
- */
2310
- public function is_pro() {
2311
- return file_exists( IG_PLUGIN_DIR . 'pro/icegram-pro.php' );
2312
- }
2313
-
2314
- /**
2315
- * Is IG MAX ?
2316
- *
2317
- * @return bool
2318
- *
2319
- * @since
2320
- */
2321
- public function is_max() {
2322
- return file_exists( IG_PLUGIN_DIR . 'max/icegram-max.php' );
2323
- }
2324
-
2325
- /**
2326
- * Is IG Premium?
2327
- *
2328
- * @return bool
2329
- *
2330
- * @since
2331
- */
2332
- public function is_premium() {
2333
-
2334
- return self::is_max() || self::is_pro();
2335
- }
2336
-
2337
- /**
2338
- * Method to check if onboarding is completed
2339
- *
2340
- * @return string
2341
- *
2342
- */
2343
- public function is_onboarding_completed() {
2344
-
2345
- $onboarding_complete = get_option( 'ig_is_onboarding_completed', 'no' );
2346
-
2347
- if ( 'yes' === $onboarding_complete ) {
2348
- return true;
2349
- }
2350
 
2351
- return false;
2352
 
 
 
2353
  }
2354
 
2355
- public function show_campaign_creation_guide() {
2356
- $installed_on = get_option( 'ig_installed_on' );
2357
- $count_posts = wp_count_posts( 'ig_campaign' );
2358
 
2359
- if( ( empty( $installed_on ) || 'no' === get_option( 'ig_is_onboarding_completed', 'no' ) ) && ! $count_posts->publish && ! $count_posts->draft ) {
2360
- return true;
2361
- }
2362
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2363
  }
2364
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2365
 
2366
- /**
2367
- * Insert $new in $array after $key
2368
- *
2369
- * @param $array
2370
- * @param $key
2371
- * @param $new
2372
- *
2373
- * @return array
2374
- *
2375
- */
2376
- public function ig_array_insert_after( $array, $key, $new ) {
2377
- $keys = array_keys( $array );
2378
- $index = array_search( $key, $keys );
2379
- $pos = false === $index ? count( $array ) : $index + 1;
2380
-
2381
- return array_merge( array_slice( $array, 0, $pos ), $new, array_slice( $array, $pos ) );
2382
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2383
  }
2384
  }
51
 
52
  add_action( 'admin_init', array( &$this, 'import_gallery_item' ) );
53
 
54
+ add_action( 'icegram_settings_after', array( &$this, 'es_subscribe_form' ) );
55
+ add_action( 'icegram_about_changelog', array( &$this, 'es_subscribe_form' ) );
56
  add_action( 'icegram_settings_after', array( &$this, 'icegram_houskeeping' ) );
57
  add_action( 'admin_notices', array( &$this, 'add_admin_notices' ) );
58
  add_filter( 'plugin_action_links_' . plugin_basename( IG_PLUGIN_FILE ), array( $this, 'ig_plugin_settings_link' ), 11, 2 );
61
  add_action( 'manage_ig_campaign_posts_custom_column', array( $this, 'edit_columns' ), 2 );
62
  // Ajax handler for campaign status toggle.
63
  add_action( 'wp_ajax_ig_toggle_campaign_status', array( $this, 'toggle_campaign_status' ) );
64
+ add_action( 'admin_bar_menu', array( $this, 'ig_show_documentation_link_in_admin_bar' ), 999 );
65
+ add_action( 'admin_head', array( $this, 'ig_documentation_link_admin_bar_css' ), 999 );
66
 
67
  } else {
68
  add_action( 'wp_footer', array( &$this, 'icegram_load_data' ) );
99
  }
100
  add_action( 'wp_ajax_icegram_event_track', array( &$this, 'icegram_event_track' ) );
101
  add_action( 'wp_ajax_nopriv_icegram_event_track', array( &$this, 'icegram_event_track' ) );
102
+ add_action( 'wp_ajax_es_list_subscribe', array( &$this, 'es_list_subscribe' ) );
103
  add_action( 'wp_ajax_icegram_run_housekeeping', array( &$this, 'run_housekeeping' ) );
104
  add_action( 'wp_ajax_save_gallery_data', array( &$this, 'save_gallery_data' ) );
105
 
216
  }
217
  }
218
 
219
+ public function es_subscribe_form() {
220
  ?>
221
  <div class="wrap">
222
  <?php
230
  <tr>
231
  <th scope="row"><?php _e( 'Get add-ons and tips...', 'icegram' ) ?></th>
232
  <td>
233
+ <form name="ig_subscription_form" id="ig-subscription-form">
234
+ <input type="hidden" id="sign-up-list" name="list" value="d44945bf9155"/>
235
+ <input type="hidden" id="sign-up-form-source" name="form-source" value=""/>
236
+ <input class="ltr" type="text" name="name" id="ig-sign-up-name" placeholder="Name"/>
237
+ <input class="regular-text ltr" type="text" name="email" id="ig-sign-up-email" placeholder="Email" value="<?php echo $customer_email ?>"/>
238
+ <input type="submit" name="submit" id="ig-sign-up-submit" class="button button-primary" value="Subscribe">
239
+ <br><br>
240
+ <input type="checkbox" name="es-gdpr-agree" id="es-gdpr-agree" value="1" required="required">
241
+ <label for="es-gdpr-agree"><?php echo sprintf( __( 'I have read and agreed to our %s.', 'icegram' ), '<a href="https://www.icegram.com/privacy-policy/" target="_blank">' . __( 'Privacy Policy', 'icegram' ) . '</a>' ); ?></label>
242
+ <br>
243
+ <div id="ig-subscribe-response"></div>
244
+ </form>
245
  </td>
246
  </tr>
247
  </table>
248
  </div>
249
+ <style type="text/css">
250
+ .ig-subscribe-response-success{
251
+ color:green;
252
+ padding-top:0.7rem;
253
+ font-size: 1rem;
254
+ }
255
+ .ig-subscribe-response-error{
256
+ color:red;
257
+ padding-top:0.7rem;
258
+ font-size: 1rem;
259
+ }
260
+ </style>
261
  <script type="text/javascript">
262
  jQuery(function () {
263
+ jQuery("form[name=ig_subscription_form]").submit(function (e) {
264
  e.preventDefault();
265
+ let name = jQuery('#ig-subscription-form #ig-sign-up-name').val();
266
+ let email = jQuery('#ig-subscription-form #ig-sign-up-email').val();
267
+ let form_source = jQuery('#ig-subscription-form #sign-up-form-source').val();
268
+ let list = jQuery('#ig-subscription-form #sign-up-list').val();
269
+
270
+ jQuery('#ig-subscribe-response').html('');
271
+ params = jQuery("form[name=ig_subscription_form]").serializeArray();
272
 
 
 
 
 
 
273
  jQuery.ajax({
274
  method: 'POST',
275
  type: 'text',
276
  url: "<?php echo admin_url( 'admin-ajax.php' ); ?>",
277
+ data: {
278
+ action: 'es_list_subscribe',
279
+ security: '<?php echo wp_create_nonce( 'ig-es-subscription-form' );?>',
280
+ name: name,
281
+ email: email,
282
+ list: list,
283
+ form_source: form_source,
284
+ },
285
+ success: function (response) {
286
+ if( 'success' === response.status ) {
287
+ jQuery('#ig-subscribe-response').html(response.message_text).addClass('ig-subscribe-response-success');
288
  } else {
289
+ if( 'undefined' == typeof response.message_text ){
290
+ response.message_text = 'Please try again later!';
291
+ }
292
+ jQuery('#ig-subscribe-response').html(response.message_text).addClass('ig-subscribe-response-error');
293
  }
294
  }
295
  });
299
  <?php
300
  }
301
 
302
+ /**
303
+ * Send a sign up request to ES installed on IG site.
304
+ *
305
+ * @since 2.1.6
306
+ *
307
+ * @param array $request_data
308
+ */
309
+ public function es_list_subscribe() {
310
+
311
+ check_ajax_referer( 'ig-es-subscription-form', 'security' );
312
+
313
+ $response = array(
314
+ 'status' => 'error',
315
+ );
316
 
317
+ $name = ! empty( $_POST['name'] ) ? sanitize_text_field( $_POST['name'] ) : '';
318
+ $email = ! empty( $_POST['email'] ) ? sanitize_text_field( $_POST['email'] ) : '';
319
+ $list = ! empty( $_POST['list'] ) ? sanitize_text_field( $_POST['list'] ) : '';
320
 
321
+ if ( ! empty( $list ) && is_email( $email ) ) {
322
 
323
+ $url_params = array(
324
+ 'ig_es_external_action' => 'subscribe',
325
+ 'name' => $name,
326
+ 'email' => $email,
327
+ 'list' => $list,
328
+ );
329
 
330
+ $ip_address = self::ig_get_ip();
331
+ if ( ! empty( $ip_address ) && 'UNKNOWN' !== $ip_address ) {
332
+ $url_params['ip_address'] = $ip_address;
333
+ }
 
 
 
334
 
335
+ $ig_url = 'https://www.icegram.com/';
336
+ $ig_url = add_query_arg( $url_params, $ig_url );
 
 
337
 
338
+ $args = array(
339
+ 'timeout' => 15,
340
+ );
341
+
342
+ // Make a get request.
343
+ $api_response = wp_remote_get( $ig_url, $args );
344
+
345
+ if ( ! is_wp_error( $api_response ) ) {
346
+ $body = ! empty( $api_response['body'] ) && self::is_valid_json( $api_response['body'] ) ? json_decode( $api_response['body'], true ) : '';
347
+
348
+ $success_message = __('Your subscription was successful! Kindly check your mailbox and confirm your subscription.', 'icegram');
349
+ if ( ! empty( $body ) ) {
350
+
351
+ // If we have received an id in response then email is successfully queued at mailgun server.
352
+ if ( ! empty( $body['status'] ) && 'SUCCESS' === $body['status'] ) {
353
+ $response['status'] = 'success';
354
+ $response['message'] = $body['message'];
355
+ $response['message_text'] = $success_message;
356
+
357
+ } elseif ( ! empty( $body['status'] ) && 'ERROR' === $body['status'] ) {
358
+ $response['status'] = 'error';
359
+ $response['message'] = $body['message'];
360
+ $response['message_text'] = $body['message_text'];
361
+ }
362
+ } else {
363
+ $response['status'] = 'success';
364
+ $response['message'] = 'es_optin_success_message';
365
+ $response['message_text'] = $success_message;
366
+ }
367
  } else {
368
+ $response['status'] = 'error';
369
  }
370
  }
371
 
372
+ wp_send_json( $response );
 
 
 
 
 
 
 
 
 
 
 
 
373
  }
374
 
375
  public function icegram_houskeeping() {
2352
  }
2353
 
2354
  /**
2355
+ * Is IG PRO?
2356
+ *
2357
+ * @return bool
2358
+ *
2359
+ * @since
2360
+ */
2361
+ public function is_pro() {
2362
+ return file_exists( IG_PLUGIN_DIR . 'pro/icegram-pro.php' );
2363
+ }
2364
+
2365
+ /**
2366
+ * Is IG MAX ?
2367
+ *
2368
+ * @return bool
2369
+ *
2370
+ * @since
2371
+ */
2372
+ public function is_max() {
2373
+ return file_exists( IG_PLUGIN_DIR . 'max/icegram-max.php' );
2374
+ }
2375
+
2376
+ /**
2377
+ * Is IG Premium?
2378
+ *
2379
+ * @return bool
2380
+ *
2381
+ * @since
2382
+ */
2383
+ public function is_premium() {
2384
+
2385
+ return self::is_max() || self::is_pro();
2386
+ }
2387
+
2388
+ /**
2389
+ * Method to check if onboarding is completed
2390
+ *
2391
+ * @return string
2392
+ *
2393
+ */
2394
+ public function is_onboarding_completed() {
 
 
 
 
 
 
2395
 
2396
+ $onboarding_complete = get_option( 'ig_is_onboarding_completed', 'no' );
2397
 
2398
+ if ( 'yes' === $onboarding_complete ) {
2399
+ return true;
2400
  }
2401
 
2402
+ return false;
 
 
2403
 
2404
+ }
2405
+
2406
+ public function show_campaign_creation_guide() {
2407
+ $installed_on = get_option( 'ig_installed_on' );
2408
+ $count_posts = wp_count_posts( 'ig_campaign' );
2409
+
2410
+ if( ( empty( $installed_on ) || 'no' === get_option( 'ig_is_onboarding_completed', 'no' ) ) && ! $count_posts->publish && ! $count_posts->draft ) {
2411
+ return true;
2412
+ }
2413
+ return false;
2414
+ }
2415
+
2416
+
2417
+ /**
2418
+ * Insert $new in $array after $key
2419
+ *
2420
+ * @param $array
2421
+ * @param $key
2422
+ * @param $new
2423
+ *
2424
+ * @return array
2425
+ *
2426
+ * @since 2.1.5
2427
+ */
2428
+ public function ig_array_insert_after( $array, $key, $new ) {
2429
+ $keys = array_keys( $array );
2430
+ $index = array_search( $key, $keys );
2431
+ $pos = false === $index ? count( $array ) : $index + 1;
2432
+
2433
+ return array_merge( array_slice( $array, 0, $pos ), $new, array_slice( $array, $pos ) );
2434
+ }
2435
+
2436
+ /**
2437
+ * Get Contact IP
2438
+ *
2439
+ * @return mixed|string|void
2440
+ *
2441
+ * @since 2.1.6
2442
+ */
2443
+ public function ig_get_ip() {
2444
+
2445
+ // Get real visitor IP behind CloudFlare network
2446
+ if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) {
2447
+ $ip = sanitize_text_field( $_SERVER['HTTP_CF_CONNECTING_IP'] );
2448
+ } elseif ( isset( $_SERVER['HTTP_X_REAL_IP'] ) ) {
2449
+ $ip = sanitize_text_field( $_SERVER['HTTP_X_REAL_IP'] );
2450
+ } elseif ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {
2451
+ $ip = sanitize_text_field( $_SERVER['HTTP_CLIENT_IP'] );
2452
+ } elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
2453
+ $ip = sanitize_text_field( $_SERVER['HTTP_X_FORWARDED_FOR'] );
2454
+ } elseif ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) {
2455
+ $ip = sanitize_text_field( $_SERVER['HTTP_X_FORWARDED'] );
2456
+ } elseif ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) {
2457
+ $ip = sanitize_text_field( $_SERVER['HTTP_FORWARDED_FOR'] );
2458
+ } elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {
2459
+ $ip = sanitize_text_field( $_SERVER['HTTP_FORWARDED'] );
2460
+ } else {
2461
+ $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( $_SERVER['REMOTE_ADDR'] ) : 'UNKNOWN';
2462
  }
2463
 
2464
+ return $ip;
2465
+ }
2466
+
2467
+ /**
2468
+ * Check whether the string is a valid JSON or not.
2469
+ *
2470
+ * @param string $string String we want to test if it's json.
2471
+ *
2472
+ * @return bool
2473
+ *
2474
+ * @since 2.1.6
2475
+ */
2476
+ public function is_valid_json( $string ) {
2477
+ return is_string( $string ) && is_array( json_decode( $string, true ) ) && ( json_last_error() === JSON_ERROR_NONE ) ? true : false;
2478
+ }
2479
+
2480
+ /**
2481
+ * Display documentation link on admin bar.
2482
+ *
2483
+ * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference.
2484
+ *
2485
+ * @return bool
2486
+ *
2487
+ * @since 2.1.6
2488
+ */
2489
+ public function ig_show_documentation_link_in_admin_bar( $wp_admin_bar ) {
2490
+
2491
+ $ig_is_page_for_notifications = apply_filters( 'ig-engage_is_page_for_notifications', false );
2492
 
2493
+ if( $ig_is_page_for_notifications ){
2494
+ $ig_logo = '<img class="ig-logo" src="' . IG_PLUGIN_URL . 'lite/assets/images/IG-white_logo-transparent_back-512.png">';
2495
+ // Add the main site admin menu item.
2496
+ $wp_admin_bar->add_menu(
2497
+ array(
2498
+ 'id' => 'icegram-documentation-link',
2499
+ 'href' => 'https://www.icegram.com/knowledgebase_category/icegram/',
2500
+ 'parent' => 'top-secondary',
2501
+ 'title' => $ig_logo . '<p class="ig-doc-text">Icegram Documentation</p>',
2502
+ 'meta' => array( 'class' => 'ig-doc-link', 'target' => '_blank' ),
2503
+ )
2504
+ );
 
 
 
 
2505
  }
2506
+ return true;
2507
+ }
2508
+
2509
+ /**
2510
+ * Add documentation link admin bar css
2511
+ *
2512
+ * @since 2.1.6
2513
+ */
2514
+ function ig_documentation_link_admin_bar_css() {
2515
+ ?>
2516
+ <style>
2517
+ #wpadminbar .ig-doc-link > .ab-item .ig-logo {
2518
+ width: 1.5rem;
2519
+ top: 0.2rem;
2520
+ position: relative;
2521
+ margin-right: 0.2rem;
2522
+ height: 1.5rem;
2523
+ }
2524
+
2525
+ #wpadminbar .ig-doc-link > .ab-item .ig-doc-text {
2526
+ display: inline;
2527
+ position: relative;
2528
+ bottom: 0.2rem;
2529
+ }
2530
+ </style>
2531
+ <?php
2532
+ }
2533
+
2534
  }
2535
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.icegram.com/
4
  Tags: popup, optin, hellobar, lead capture, form
5
  Requires at least: 3.9
6
  Tested up to: 5.9.3
7
- Stable tag: 2.1.5
8
  License: GPLv3
9
 
10
  The best WordPress popup plugin that lets you create popups and action bars within seconds. Customize exit-intent popup campaigns, action bars, badges, stickies, inline optin, fullscreen overlay, ribbons, sidebar panel and more in no time.
@@ -458,13 +458,16 @@ Contact Us, provide as much detail of the problem as you can. We will try to sol
458
 
459
  == Upgrade Notice ==
460
 
461
- = 2.1.5 =
462
 
463
- Fix: Classic Post Editor not showing
464
- Fix: UI issue with Contact Us popup on Docs & Support screen
465
 
466
  == Changelog ==
467
 
 
 
 
 
468
  **2.1.5 (14.04.2022)**
469
 
470
  * Update: UI/UX improvements
4
  Tags: popup, optin, hellobar, lead capture, form
5
  Requires at least: 3.9
6
  Tested up to: 5.9.3
7
+ Stable tag: 2.1.6
8
  License: GPLv3
9
 
10
  The best WordPress popup plugin that lets you create popups and action bars within seconds. Customize exit-intent popup campaigns, action bars, badges, stickies, inline optin, fullscreen overlay, ribbons, sidebar panel and more in no time.
458
 
459
  == Upgrade Notice ==
460
 
461
+ = 2.1.6 =
462
 
463
+ * Update: UI/UX improvements
 
464
 
465
  == Changelog ==
466
 
467
+ **2.1.6 (26.04.2022)**
468
+
469
+ * Update: UI/UX improvements
470
+
471
  **2.1.5 (14.04.2022)**
472
 
473
  * Update: UI/UX improvements