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

Version Description

Compatibility with Gravity Forms.

Download this release

Release Info

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

Code changes from version 1.9.10 to 1.9.11

assets/js/main.js CHANGED
@@ -1 +1 @@
1
- function load_scripts_and_css(a){var t={};jQuery.each(a.css,function(a,e){t["ig_css_"+a]=1}),jQuery.each(a.scripts,function(a,e){t["ig_script_"+a]=1});var e=function(e){var r=e.target.id||"";""!=r&&t.hasOwnProperty(r)&&delete t[r],jQuery.isEmptyObject(t)&&(jQuery(window).trigger("scripts_loaded.icegram"),jQuery(function(){window.icegram=new Icegram,window.icegram.init(a),jQuery("body").addClass("ig_"+icegram_pre_data.post_obj.device),icegram_timing.end=Date.now()}))};jQuery.each(a.css,function(a,t){jQuery("<link>").attr("type","text/css").attr("rel","stylesheet").attr("id","ig_css_"+a).attr("media","all").appendTo("head").on("load",e).attr("href",t)});var r=a.scripts.shift();jQuery("<script>").attr("type","text/javascript").attr("id","ig_script_0").appendTo("body").on("load",function(t){e(t),jQuery.each(a.scripts,function(a,t){jQuery("<script>").attr("type","text/javascript").attr("id","ig_script_"+(a+1)).appendTo("body").on("load",e).attr("src",t)})}).attr("src",r)}try{var icegram_data,icegram_timing={};icegram_pre_data.post_obj.referral_url=window.location.href,icegram_timing.start=Date.now(),"yes"===icegram_pre_data.post_obj.cache_compatibility?jQuery.ajax({url:icegram_pre_data.ajax_url,type:"POST",async:!0,cache:!1,data:icegram_pre_data.post_obj,dataType:"json",success:function(a){a?(icegram_data=a,load_scripts_and_css(icegram_data)):jQuery(".ig_inline_container:empty").remove()},error:function(a){}}):"undefined"!=typeof icegram_data&&load_scripts_and_css(icegram_data)}catch(e){console.log(e)}
1
+ function load_scripts_and_css(t){var a={};jQuery.each(t.css,function(t,e){a["ig_css_"+t]=1}),jQuery.each(t.scripts,function(t,e){a["ig_script_"+t]=1});var e=function(e){var r=e.target.id||"";""!=r&&a.hasOwnProperty(r)&&delete a[r],jQuery.isEmptyObject(a)&&(jQuery(window).trigger("scripts_loaded.icegram"),jQuery(function(){window.icegram=new Icegram,window.icegram.init(t),jQuery("body").addClass("ig_"+icegram_pre_data.post_obj.device),icegram_timing.end=Date.now()}))};jQuery.each(t.css,function(t,a){jQuery("<link>").attr("type","text/css").attr("rel","stylesheet").attr("id","ig_css_"+t).attr("media","all").appendTo("head").on("load",e).attr("href",a)});var r=t.scripts.shift();jQuery("<script>").attr("type","text/javascript").attr("id","ig_script_0").appendTo("body").on("load",function(a){e(a),jQuery.each(t.scripts,function(t,a){jQuery("<script>").attr("type","text/javascript").attr("id","ig_script_"+(t+1)).appendTo("body").on("load",e).attr("src",a)})}).attr("src",r)}try{var icegram_data,icegram_timing={};icegram_pre_data.post_obj.referral_url=window.location.href,icegram_timing.start=Date.now(),"yes"===icegram_pre_data.post_obj.cache_compatibility?(jQuery.ajax({url:icegram_pre_data.ajax_url,type:"POST",async:!0,cache:!1,data:icegram_pre_data.post_obj,dataType:"json",success:function(t){t?(icegram_data=t,load_scripts_and_css(icegram_data)):jQuery(".ig_inline_container:empty").remove()},error:function(t){}}),jQuery(window).on("init.icegram",function(t,a){a&&jQuery.each(a.messages,function(t,a){a.data.assets&&(jQuery.each(a.data.assets.styles||[],function(t,a){var e=jQuery("<div/>").html(a).find("link").attr("href");e&&0==jQuery('link[href="'+e+'"]').length&&jQuery("body").append(a)}),jQuery.each(a.data.assets.scripts||[],function(t,a){var e=jQuery("<div/>").html("<script "+a).find("script").attr("src");e&&0==jQuery('script[src="'+e+'"]').length&&jQuery("body").append("<script "+a)}))})})):"undefined"!=typeof icegram_data&&load_scripts_and_css(icegram_data)}catch(e){console.log(e)}
classes/compat/class-icegram-compat-gravityforms.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'ABSPATH' ) ) exit;
3
+ /**
4
+ * Icegram Campaign Admin class
5
+ */
6
+ if ( !class_exists( 'Icegram_Compat_gravityforms' ) ) {
7
+ class Icegram_Compat_gravityforms extends Icegram_Compat_Base {
8
+
9
+ function __construct() {
10
+ global $icegram;
11
+ parent::__construct();
12
+
13
+ if($icegram->cache_compatibility === 'yes') {
14
+ add_filter( 'gform_form_tag', 'change_form_action_url', 10, 2 );
15
+ function change_form_action_url( $form_tag, $form ) {
16
+ $form_tag = preg_replace( "|action='(.*?)'|", "action='".Icegram::get_current_page_url()."'", $form_tag );
17
+ return $form_tag;
18
+ }
19
+
20
+ }
21
+ }
22
+
23
+ function render_js() {
24
+ ?>
25
+
26
+ <style type="text/css">
27
+ body.ig_laptop div#ui-datepicker-div[style],
28
+ body.ig_tablet div#ui-datepicker-div[style],
29
+ body.ig_mobile div#ui-datepicker-div[style]{
30
+ z-index: 9999999!important;
31
+ }
32
+ </style>
33
+
34
+ <script type="text/javascript">
35
+ jQuery(function() {
36
+ jQuery( window ).on( "init.icegram", function(e, ig) {
37
+ // Find and init all datepicker inside gravityForms
38
+ jQuery('body').on('focus', 'form[id^="gform_"] .datepicker', function(){
39
+ jQuery(this).datepicker();
40
+ });
41
+ }); // init.icegram
42
+ });
43
+ </script>
44
+
45
+ <?php
46
+ }
47
+ }
48
+ }
icegram.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Icegram
4
  * Plugin URI: http://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: 1.9.10
7
  * Author: icegram
8
  * Author URI: http://www.icegram.com/
9
  *
@@ -35,7 +35,7 @@ class Icegram {
35
 
36
  function __construct() {
37
 
38
- $this->version = "1.9.10";
39
  $this->shortcode_instances = array();
40
  $this->mode = 'local';
41
  $this->plugin_url = untrailingslashit( plugins_url( '/', __FILE__ ) );
@@ -176,15 +176,17 @@ class Icegram {
176
  $no_offer_text = __('No, I don\'t like offers...','icegram');
177
  $option_name = 'dismiss_admin_notice_from_icegram';
178
  }
179
- if(!get_option('dismiss_admin_notice_in_app_offer') && in_array('ig-analytics/ig-analytics.php', $active_plugins)){
180
- $admin_notice_text = apply_filters('ig_in_app_offers',$admin_notice_text);
 
 
181
  $no_offer_text_set = array('save_money' => __('No, I don\'t want to save money ','icegram'),
182
  'full_price' => __('No, I will buy at full price later','icegram'),
183
  'insider_deals' => __('No, I don\'t like insider deals','icegram'),
184
  );
185
  $key = array_rand($no_offer_text_set);
186
  $no_offer_text = $no_offer_text_set[$key];
187
- $option_name = 'dismiss_admin_notice_in_app_offer';
188
  }
189
  if($admin_notice_text != ''){
190
  echo '<div class="icegram_notice" style="padding-top:1em;clear:both"><span class="dashicons dashicons-awards" style="font-size:3em;color:#b32727;margin:0 .4em .45em -0.2em;"></span>'.$admin_notice_text.
@@ -201,7 +203,8 @@ class Icegram {
201
  }
202
 
203
  //add in app promotion offers here
204
- public function add_in_app_offer($admin_notice_text){
 
205
  $screen = get_current_screen();
206
  if ( !in_array( $screen->id, array( 'ig_campaign', 'ig_message','edit-ig_message','edit-ig_campaign' ), true ) ) return '';
207
  //set offer according to day
@@ -212,20 +215,34 @@ class Icegram {
212
  $key = array_rand($last_day_text_set);
213
  $last_day_text = $last_day_text_set[$key];
214
 
215
- //offer 2 26th-30th Nov
216
- $date_start = date_create('2015-11-26');
217
- $date_finish = date_create('2015-11-30');
218
- if($current_wp_date == $date_finish ){
219
- $admin_notice_text = '<b>'. $last_day_text .' </b> - <a href="http://www.icegram.com/big-offer?utm_source=ig_sale&utm_medium=banner&utm_term='.$key.'&utm_campaign=big-offer", target="_icegram_offer">'. '<b>' . __('20% Off Storewide', 'icegram') . ' </b></a>';
220
- }else if ( ( $current_wp_date >= $date_start ) && ( $current_wp_date <= $date_finish )) {
221
- $admin_notice_text = '<b>'.__('Special Holiday Season - ').'</b><a href="http://www.icegram.com/big-offer?utm_source=ig_sale&utm_medium=banner&utm_term=holiday&utm_campaign=big-offer", target="_icegram_offer">'. '<b>' . __('20% Off Storewide', 'icegram') . ' </b></a>';
222
- }
223
-
224
- if ( !empty($admin_notice_text) ) {
225
- return $admin_notice_text;
226
- }
227
-
228
- return $admin_notice_text;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  }
230
 
231
  public function klawoo_subscribe_form() {
@@ -725,7 +742,7 @@ class Icegram {
725
  echo json_encode($icegram_data);
726
  wp_die();
727
  }else{
728
- wp_localize_script('icegram_main_js' , 'icegram_data' ,$icegram_data);
729
  }
730
  }
731
 
@@ -766,6 +783,14 @@ class Icegram {
766
 
767
  // Process
768
  function process_message_body(&$message_data){
 
 
 
 
 
 
 
 
769
  $content = $message_data['message'];
770
  $content = convert_chars(convert_smilies( wptexturize( $content )));
771
  if(isset($GLOBALS['wp_embed'])) {
@@ -781,8 +806,36 @@ class Icegram {
781
  if(!empty($message_data['form_html_original'] )){
782
  $message_data['form_html'] = do_shortcode( shortcode_unautop( $message_data['form_html_original'] ) );
783
  }
784
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
785
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
786
 
787
  function enqueue_admin_styles_and_scripts() {
788
 
3
  * Plugin Name: Icegram
4
  * Plugin URI: http://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: 1.9.11
7
  * Author: icegram
8
  * Author URI: http://www.icegram.com/
9
  *
35
 
36
  function __construct() {
37
 
38
+ $this->version = "1.9.11";
39
  $this->shortcode_instances = array();
40
  $this->mode = 'local';
41
  $this->plugin_url = untrailingslashit( plugins_url( '/', __FILE__ ) );
176
  $no_offer_text = __('No, I don\'t like offers...','icegram');
177
  $option_name = 'dismiss_admin_notice_from_icegram';
178
  }
179
+
180
+ $offer_content = apply_filters('ig_in_app_offers',$offer_content);
181
+ if(!get_option($offer_content['option_name']) && in_array('ig-analytics/ig-analytics.php', $active_plugins)){
182
+ $admin_notice_text = $offer_content['admin_notice_text'];
183
  $no_offer_text_set = array('save_money' => __('No, I don\'t want to save money ','icegram'),
184
  'full_price' => __('No, I will buy at full price later','icegram'),
185
  'insider_deals' => __('No, I don\'t like insider deals','icegram'),
186
  );
187
  $key = array_rand($no_offer_text_set);
188
  $no_offer_text = $no_offer_text_set[$key];
189
+ $option_name = $offer_content['option_name'];
190
  }
191
  if($admin_notice_text != ''){
192
  echo '<div class="icegram_notice" style="padding-top:1em;clear:both"><span class="dashicons dashicons-awards" style="font-size:3em;color:#b32727;margin:0 .4em .45em -0.2em;"></span>'.$admin_notice_text.
203
  }
204
 
205
  //add in app promotion offers here
206
+ public function add_in_app_offer($offer_content){
207
+ $active_plugins = get_option( 'active_plugins', array() );
208
  $screen = get_current_screen();
209
  if ( !in_array( $screen->id, array( 'ig_campaign', 'ig_message','edit-ig_message','edit-ig_campaign' ), true ) ) return '';
210
  //set offer according to day
215
  $key = array_rand($last_day_text_set);
216
  $last_day_text = $last_day_text_set[$key];
217
 
218
+ // offer 3: 1st - 8th Dec Super Bundle
219
+ $offer_3_start = date_create('2015-12-1');
220
+ $offer_3_finish = date_create('2015-12-8');
221
+ if ( ( $current_wp_date >= $offer_3_start ) && ( $current_wp_date <= $offer_3_finish )) {
222
+ $offer_content['admin_notice_text'] = '<b>'.__('Buy the Best Bundle on Icegram - ').'</b><a href="http://www.icegram.com/addons/icegram-super-bundle?utm_source=ig_super_bundle&utm_medium=banner&utm_term=super-bundle&utm_campaign=big-offer", target="_icegram_offer">'. '<b>' . __('The Super Bundle', 'icegram') . ' </b></a><b> - '.__('Hurry, buy before prices shoot up','icegram').'</b>';
223
+ $offer_content['option_name'] = 'dismiss_super_bundle_notice';
224
+ }
225
+
226
+ // offer 4: 9th - 15th Dec Theme Pack 2
227
+ $offer_4_start = date_create('2015-12-9');
228
+ $offer_4_finish = date_create('2015-12-15');
229
+ $offer_text_array = array('ig_split_testing_offer'=> '<b>'. __('Get Icegram\'s - ').'</b> <a href="http://www.icegram.com/?buy-now=3452&qty=1&coupon=ig_in_app_20&page=6&with-cart=0&utm_source=ig_sale_theme&utm_medium=banner&utm_term=theme-2&utm_campaign=big-offer", target="_icegram_offer"><b>' . __('Split Testing addon', 'icegram') . ' </b><b>'.__('at 20% off' ,'icegram').'</b></a>',
230
+ 'ig_theme_pack_2_offer' => '<b>'. __('Grab 42 high converting themes for Icegram at 20% off - ').'</b> <a href="http://www.icegram.com/?buy-now=5541&qty=1&coupon=ig_in_app_20&page=6&with-cart=0&utm_source=ig_sale_theme&utm_medium=banner&utm_term=theme-2&utm_campaign=big-offer", target="_icegram_offer"><b>' . __('The Theme Pack 2', 'icegram') . ' </b></a>');
231
+ if(!in_array('ig-split-testing/ig-split-testing.php', $active_plugins) && !in_array('ig-themes-pack-2/ig-themes-pack-2.php', $active_plugins)){
232
+ $offer_text = $offer_text_array[array_rand($offer_text_array)];
233
+ }elseif(!in_array('ig-split-testing/ig-split-testing.php', $active_plugins)){
234
+ $offer_text = $offer_text_array['ig_split_testing_offer'];
235
+ }elseif(!in_array('ig-themes-pack-2/ig-themes-pack-2.php', $active_plugins)){
236
+ $offer_text = $offer_text_array['ig_theme_pack_2_offer'];
237
+ }
238
+ if($current_wp_date == $offer_4_finish ){
239
+ $offer_content['admin_notice_text'] = '<b>'. $last_day_text .' </b> - '.$offer_text;
240
+ $offer_content['option_name'] = 'dismiss_ig_discount_notice';
241
+ }else if ( ( $current_wp_date >= $offer_4_start ) && ( $current_wp_date <= $offer_4_finish )) {
242
+ $offer_content['admin_notice_text'] = $offer_text;
243
+ $offer_content['option_name'] = 'dismiss_ig_discount_notice';
244
+ }
245
+ return $offer_content;
246
  }
247
 
248
  public function klawoo_subscribe_form() {
742
  echo json_encode($icegram_data);
743
  wp_die();
744
  }else{
745
+ wp_localize_script('icegram_main_js', 'icegram_data', $icegram_data);
746
  }
747
  }
748
 
783
 
784
  // Process
785
  function process_message_body(&$message_data){
786
+ global $wp_scripts;
787
+ global $wp_styles;
788
+
789
+
790
+ if($this->cache_compatibility == 'yes'){
791
+ $q_script = $wp_scripts->queue;
792
+ $q_style = $wp_styles->queue;
793
+ }
794
  $content = $message_data['message'];
795
  $content = convert_chars(convert_smilies( wptexturize( $content )));
796
  if(isset($GLOBALS['wp_embed'])) {
806
  if(!empty($message_data['form_html_original'] )){
807
  $message_data['form_html'] = do_shortcode( shortcode_unautop( $message_data['form_html_original'] ) );
808
  }
809
+ //TODO :: Handle case for inline style and script
810
+ if($this->cache_compatibility == 'yes'){
811
+
812
+ $handles = array_diff($wp_scripts->queue, $q_script);
813
+ unset($q_script);
814
+ if(!empty($handles)){
815
+ if(empty($message_data['assets']))
816
+ $message_data['assets'] = array();
817
+
818
+ ob_start();
819
+ $wp_scripts->do_items($handles);
820
+ $message_data['assets']['scripts'] = array_filter(explode('<script', ob_get_clean()));
821
+
822
+ }
823
 
824
+ //TODO :: do_items if required
825
+ $handles = array_diff($wp_styles->queue, $q_style);
826
+ unset($q_style);
827
+ if(!empty($handles)){
828
+ if(empty($message_data['assets']))
829
+ $message_data['assets'] = array();
830
+
831
+ foreach ($handles as $handle) {
832
+ ob_start();
833
+ $wp_styles->do_item($handle);
834
+ $message_data['assets']['styles'][$handle] = ob_get_clean();
835
+ }
836
+ }
837
+ }
838
+ }
839
 
840
  function enqueue_admin_styles_and_scripts() {
841
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.icegram.com/
4
  Tags: popup, window, hellobar, optin, lead capture, marketing, form, notification, messenger, targeting, monster, ninja ,wordpress lead generation, wordpress lightbox optin, wordpress lightbox optin form, wordpress lightbox optins, wordpress mobile optin forms, wordpress mobile popup, wordpress mobile popups, wordpress optin form, wordpress overlay popup, wordpress popup, wordpress popup form, wordpress popup plugin, wordpress popup solution, wordpress popups , popups, subscribe, wp popups, optin bars, action grabber, constant contact, toast notifications, leads, lists, builder, action bar, floating bar, footer bar, hellobar alternative, pop over, Popup plugin, aweber, campaign monitor, constant contact, email list, exit-intent, getresponse, analytics, Hubspot, icontact, infusionsoft, newsletter, Mailing list pop-up, retargeting, Animation,Popups with Animation ,Responsive Popup, split testing, AB testing
5
  Requires at least: 3.9
6
  Tested up to: 4.3.1
7
- Stable tag: 1.9.10
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -153,6 +153,9 @@ Contact Us, provide as much detail of the problem as you can. We will try to sol
153
  3. Editing an Icegram campaign - add multiple messages, edit them, targeting rules, full HTML editor, themes and more
154
 
155
  == Upgrade Notice ==
 
 
 
156
  = 1.9.10 =
157
  Fix for schedule campaign option
158
 
@@ -257,6 +260,9 @@ Initial Release
257
 
258
 
259
  == Changelog ==
 
 
 
260
  = 1.9.10 =
261
  * Fix: Campaigns were not getting scheduled according to site's timezone
262
 
4
  Tags: popup, window, hellobar, optin, lead capture, marketing, form, notification, messenger, targeting, monster, ninja ,wordpress lead generation, wordpress lightbox optin, wordpress lightbox optin form, wordpress lightbox optins, wordpress mobile optin forms, wordpress mobile popup, wordpress mobile popups, wordpress optin form, wordpress overlay popup, wordpress popup, wordpress popup form, wordpress popup plugin, wordpress popup solution, wordpress popups , popups, subscribe, wp popups, optin bars, action grabber, constant contact, toast notifications, leads, lists, builder, action bar, floating bar, footer bar, hellobar alternative, pop over, Popup plugin, aweber, campaign monitor, constant contact, email list, exit-intent, getresponse, analytics, Hubspot, icontact, infusionsoft, newsletter, Mailing list pop-up, retargeting, Animation,Popups with Animation ,Responsive Popup, split testing, AB testing
5
  Requires at least: 3.9
6
  Tested up to: 4.3.1
7
+ Stable tag: 1.9.11
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
153
  3. Editing an Icegram campaign - add multiple messages, edit them, targeting rules, full HTML editor, themes and more
154
 
155
  == Upgrade Notice ==
156
+ = 1.9.11 =
157
+ Compatibility with Gravity Forms.
158
+
159
  = 1.9.10 =
160
  Fix for schedule campaign option
161
 
260
 
261
 
262
  == Changelog ==
263
+ = 1.9.11 =
264
+ * Fix: Conditional login of Gravity forms was not working
265
+
266
  = 1.9.10 =
267
  * Fix: Campaigns were not getting scheduled according to site's timezone
268