Version Description
Recommended. Code cleanup for better WP repo compatibility
Download this release
Release Info
Developer | niravmehta |
Plugin | Popups, Welcome Bar, Optins and Lead Generation Plugin – Icegram |
Version | 1.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1.1 to 1.1.2
- about-icegram.php +9 -51
- icegram-includes/class-icegram-upgrade.php +0 -394
- icegram.php +10 -19
- readme.txt +19 -14
about-icegram.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
add_action( 'admin_footer', 'icegram_support_ticket_content' );
|
8 |
|
9 |
function icegram_support_ticket_content() {
|
10 |
-
global $current_user, $pagenow, $typenow
|
11 |
|
12 |
if ( $pagenow != 'edit.php' ) return;
|
13 |
|
@@ -15,16 +15,18 @@ function icegram_support_ticket_content() {
|
|
15 |
|
16 |
if ( !( $current_user instanceof WP_User ) ) return;
|
17 |
|
18 |
-
if( isset( $_POST['submit_query'] ) && $_POST['submit_query'] == "Send" ){
|
19 |
|
20 |
|
21 |
$additional_info = ( isset( $_POST['additional_information'] ) && !empty( $_POST['additional_information'] ) ) ? sanitize_text_field( $_POST['additional_information'] ) : '';
|
22 |
$additional_info = str_replace( '###', '<br />', $additional_info );
|
23 |
$additional_info = str_replace( array( '[', ']' ), '', $additional_info );
|
24 |
|
25 |
-
$
|
26 |
-
$
|
27 |
-
$
|
|
|
|
|
28 |
$headers .= 'MIME-Version: 1.0' . "\r\n";
|
29 |
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
|
30 |
|
@@ -50,30 +52,6 @@ function icegram_support_ticket_content() {
|
|
50 |
$name = $first_name . ' ' . $last_name;
|
51 |
$customer_name = ( !empty( $name ) ) ? $name : $current_user->data->display_name;
|
52 |
$customer_email = $current_user->data->user_email;
|
53 |
-
$license_key = $icegram_upgrader->license_key;
|
54 |
-
$wp_version = ( is_multisite() ) ? 'WPMU ' . get_bloginfo('version') : 'WP ' . get_bloginfo('version');
|
55 |
-
$admin_url = admin_url();
|
56 |
-
$php_version = ( function_exists( 'phpversion' ) ) ? phpversion() : '';
|
57 |
-
$wp_max_upload_size = size_format( wp_max_upload_size() );
|
58 |
-
$server_max_upload_size = ini_get('upload_max_filesize');
|
59 |
-
$server_post_max_size = ini_get('post_max_size');
|
60 |
-
$wp_memory_limit = WP_MEMORY_LIMIT;
|
61 |
-
$wp_debug = ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) ? 'On' : 'Off';
|
62 |
-
$this_plugins_version = $icegram_upgrader->plugin_data['Name'] . ' ' . $icegram_upgrader->plugin_data['Version'];
|
63 |
-
$ip_address = $_SERVER['REMOTE_ADDR'];
|
64 |
-
$additional_information = "Additional Information =>
|
65 |
-
(WP Version: $wp_version) ###
|
66 |
-
(Admin URL: $admin_url) ###
|
67 |
-
(PHP Version: $php_version) ###
|
68 |
-
(WP Max Upload Size: $wp_max_upload_size) ###
|
69 |
-
(Server Max Upload Size: $server_max_upload_size) ###
|
70 |
-
(Server Post Max Size: $server_post_max_size) ###
|
71 |
-
(WP Memory Limit: $wp_memory_limit) ###
|
72 |
-
(WP Debug: $wp_debug) ###
|
73 |
-
(" . $icegram_upgrader->plugin_data['Name'] . " Version: $this_plugins_version) ###
|
74 |
-
(License Key: $license_key)###
|
75 |
-
(IP Address: $ip_address)
|
76 |
-
";
|
77 |
|
78 |
?>
|
79 |
<form id="icegram_form_post_query" method="POST" action="" enctype="multipart/form-data">
|
@@ -155,13 +133,6 @@ function icegram_support_ticket_content() {
|
|
155 |
<td><label for="client_email"><?php _e('E-mail', 'icegram'); ?>*</label></td>
|
156 |
<td><input type="email" class="regular-text sm_text_field" id="client_email" name="client_email" value="<?php echo $customer_email; ?>" /></td>
|
157 |
</tr>
|
158 |
-
<!--
|
159 |
-
<tr>
|
160 |
-
<td><label for="current_plugin"><?php _e('Product', 'icegram'); ?></label></td>
|
161 |
-
<td><input type="text" class="regular-text sm_text_field" id="current_plugin" name="current_plugin" value="<?php echo $this_plugins_version; ?>" readonly /></td>
|
162 |
-
</tr>
|
163 |
-
-->
|
164 |
-
<input type="hidden" id="current_plugin" name="current_plugin" value="<?php echo $this_plugins_version; ?>" />
|
165 |
<tr>
|
166 |
<td><label for="subject"><?php _e('Subject', 'icegram'); ?>*</label></td>
|
167 |
<td><input type="text" class="regular-text sm_text_field" id="subject" name="subject" value="<?php echo ( !empty( $subject ) ) ? $subject : ''; ?>" /></td>
|
@@ -179,19 +150,6 @@ function icegram_support_ticket_content() {
|
|
179 |
<td><input type="submit" class="button" id="icegram_submit_query" name="submit_query" value="Send" /></td>
|
180 |
</tr>
|
181 |
</table>
|
182 |
-
<input type="hidden" name="license_key" value="<?php echo $license_key; ?>" />
|
183 |
-
<input type="hidden" name="sku" value="<?php echo $icegram_upgrader->sku; ?>" />
|
184 |
-
<input type="hidden" class="hidden_field" name="wp_version" value="<?php echo $wp_version; ?>" />
|
185 |
-
<input type="hidden" class="hidden_field" name="admin_url" value="<?php echo $admin_url; ?>" />
|
186 |
-
<input type="hidden" class="hidden_field" name="php_version" value="<?php echo $php_version; ?>" />
|
187 |
-
<input type="hidden" class="hidden_field" name="wp_max_upload_size" value="<?php echo $wp_max_upload_size; ?>" />
|
188 |
-
<input type="hidden" class="hidden_field" name="server_max_upload_size" value="<?php echo $server_max_upload_size; ?>" />
|
189 |
-
<input type="hidden" class="hidden_field" name="server_post_max_size" value="<?php echo $server_post_max_size; ?>" />
|
190 |
-
<input type="hidden" class="hidden_field" name="wp_memory_limit" value="<?php echo $wp_memory_limit; ?>" />
|
191 |
-
<input type="hidden" class="hidden_field" name="wp_debug" value="<?php echo $wp_debug; ?>" />
|
192 |
-
<input type="hidden" class="hidden_field" name="current_plugin" value="<?php echo $this_plugins_version; ?>" />
|
193 |
-
<input type="hidden" class="hidden_field" name="ip_address" value="<?php echo $ip_address; ?>" />
|
194 |
-
<input type="hidden" class="hidden_field" name="additional_information" value='<?php echo $additional_information; ?>' />
|
195 |
</form>
|
196 |
</div>
|
197 |
<?php
|
@@ -225,7 +183,7 @@ if ( !wp_script_is( 'thickbox' ) ) {
|
|
225 |
</div>
|
226 |
|
227 |
<div class="icegram-badge">
|
228 |
-
<?php printf(__( "Version: %s", "icegram"),
|
229 |
</div>
|
230 |
<div class="icegram-support">
|
231 |
<?php _e( 'Questions? Need Help?', "icegram" ); ?>
|
@@ -328,4 +286,4 @@ if ( !wp_script_is( 'thickbox' ) ) {
|
|
328 |
|
329 |
</div>
|
330 |
|
331 |
-
</div>
|
7 |
add_action( 'admin_footer', 'icegram_support_ticket_content' );
|
8 |
|
9 |
function icegram_support_ticket_content() {
|
10 |
+
global $current_user, $pagenow, $typenow;
|
11 |
|
12 |
if ( $pagenow != 'edit.php' ) return;
|
13 |
|
15 |
|
16 |
if ( !( $current_user instanceof WP_User ) ) return;
|
17 |
|
18 |
+
if( isset( $_POST['submit_query'] ) && $_POST['submit_query'] == "Send" && !empty($_POST['client_email'])){
|
19 |
|
20 |
|
21 |
$additional_info = ( isset( $_POST['additional_information'] ) && !empty( $_POST['additional_information'] ) ) ? sanitize_text_field( $_POST['additional_information'] ) : '';
|
22 |
$additional_info = str_replace( '###', '<br />', $additional_info );
|
23 |
$additional_info = str_replace( array( '[', ']' ), '', $additional_info );
|
24 |
|
25 |
+
$from = 'From: ';
|
26 |
+
$from .= ( isset( $_POST['client_name'] ) && !empty( $_POST['client_name'] ) ) ? sanitize_text_field( $_POST['client_name'] ) : '';
|
27 |
+
$from .= ' <' . sanitize_text_field( $_POST['client_email'] ) . '>' . "\r\n";
|
28 |
+
$headers .= $from;
|
29 |
+
$headers .= str_replace('From: ', 'Reply-To: ', $from);
|
30 |
$headers .= 'MIME-Version: 1.0' . "\r\n";
|
31 |
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
|
32 |
|
52 |
$name = $first_name . ' ' . $last_name;
|
53 |
$customer_name = ( !empty( $name ) ) ? $name : $current_user->data->display_name;
|
54 |
$customer_email = $current_user->data->user_email;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
?>
|
57 |
<form id="icegram_form_post_query" method="POST" action="" enctype="multipart/form-data">
|
133 |
<td><label for="client_email"><?php _e('E-mail', 'icegram'); ?>*</label></td>
|
134 |
<td><input type="email" class="regular-text sm_text_field" id="client_email" name="client_email" value="<?php echo $customer_email; ?>" /></td>
|
135 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
<tr>
|
137 |
<td><label for="subject"><?php _e('Subject', 'icegram'); ?>*</label></td>
|
138 |
<td><input type="text" class="regular-text sm_text_field" id="subject" name="subject" value="<?php echo ( !empty( $subject ) ) ? $subject : ''; ?>" /></td>
|
150 |
<td><input type="submit" class="button" id="icegram_submit_query" name="submit_query" value="Send" /></td>
|
151 |
</tr>
|
152 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
</form>
|
154 |
</div>
|
155 |
<?php
|
183 |
</div>
|
184 |
|
185 |
<div class="icegram-badge">
|
186 |
+
<?php printf(__( "Version: %s", "icegram"), "1.1.2" ); ?>
|
187 |
</div>
|
188 |
<div class="icegram-support">
|
189 |
<?php _e( 'Questions? Need Help?', "icegram" ); ?>
|
286 |
|
287 |
</div>
|
288 |
|
289 |
+
</div>
|
icegram-includes/class-icegram-upgrade.php
DELETED
@@ -1,394 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class IceGram_Upgrade {
|
3 |
-
|
4 |
-
var $base_name;
|
5 |
-
var $check_update_timeout;
|
6 |
-
var $last_checked;
|
7 |
-
var $plugin_data;
|
8 |
-
var $sku;
|
9 |
-
var $license_key;
|
10 |
-
var $download_url;
|
11 |
-
var $installed_version;
|
12 |
-
var $live_version;
|
13 |
-
var $changelog;
|
14 |
-
var $slug;
|
15 |
-
var $name;
|
16 |
-
var $documentation_link;
|
17 |
-
var $prefix;
|
18 |
-
var $text_domain;
|
19 |
-
var $login_link;
|
20 |
-
var $due_date;
|
21 |
-
|
22 |
-
function __construct( $file, $sku, $prefix, $plugin_name, $text_domain, $documentation_link ) {
|
23 |
-
|
24 |
-
$this->check_update_timeout = (24 * 60 * 60); // 24 hours
|
25 |
-
|
26 |
-
if (! function_exists( 'get_plugin_data' )) {
|
27 |
-
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
28 |
-
}
|
29 |
-
$this->plugin_data = get_plugin_data( $file );
|
30 |
-
$this->base_name = plugin_basename( $file );
|
31 |
-
$this->slug = dirname( $this->base_name );
|
32 |
-
$this->name = $plugin_name;
|
33 |
-
$this->sku = $sku;
|
34 |
-
$this->documentation_link = $documentation_link;
|
35 |
-
$this->prefix = $prefix;
|
36 |
-
$this->text_domain = $text_domain;
|
37 |
-
|
38 |
-
add_site_option( $this->prefix.'_last_checked', '' );
|
39 |
-
add_site_option( $this->prefix.'_download_url', '' );
|
40 |
-
add_site_option( $this->prefix.'_installed_version', '' );
|
41 |
-
add_site_option( $this->prefix.'_live_version', '' );
|
42 |
-
|
43 |
-
if ( empty( $this->last_checked ) ) {
|
44 |
-
$this->last_checked = (int)get_site_option( $this->prefix.'_last_checked' );
|
45 |
-
}
|
46 |
-
|
47 |
-
if (get_site_option( $this->prefix.'_installed_version' ) != $this->plugin_data ['Version']) {
|
48 |
-
update_site_option( $this->prefix.'_installed_version', $this->plugin_data ['Version'] );
|
49 |
-
}
|
50 |
-
|
51 |
-
if ( ( get_site_option( $this->prefix.'_live_version' ) == '' ) || ( get_site_option( $this->prefix.'_live_version' ) < get_site_option( $this->prefix.'_installed_version' ) ) ) {
|
52 |
-
update_site_option( $this->prefix.'_live_version', $this->plugin_data['Version'] );
|
53 |
-
}
|
54 |
-
|
55 |
-
// Actions for License Validation & Upgrade process
|
56 |
-
add_action( 'admin_footer', array ($this, 'support_ticket_content' ) );
|
57 |
-
add_action( "after_plugin_row_".$this->base_name, array ($this, 'update_row' ), 10, 2 );
|
58 |
-
|
59 |
-
// add_filter( 'plugins_api', array( $this, 'overwrite_wp_plugin_api_for_plugin' ), 10, 3 );
|
60 |
-
// add_filter( 'site_transient_update_plugins', array ($this, 'overwrite_site_transient' ), 10, 2 );
|
61 |
-
|
62 |
-
add_filter( 'plugin_row_meta', array( $this, 'add_support_link' ), 10, 4 );
|
63 |
-
|
64 |
-
}
|
65 |
-
|
66 |
-
function check_for_updates() {
|
67 |
-
|
68 |
-
$this->live_version = get_site_option( $this->prefix.'_live_version' );
|
69 |
-
$this->installed_version = get_site_option( $this->prefix.'_installed_version' );
|
70 |
-
|
71 |
-
if (version_compare( $this->installed_version, $this->live_version, '<=' )) {
|
72 |
-
|
73 |
-
$result = wp_remote_post( 'http://www.icegram.com/wp-admin/admin-ajax.php?action=get_products_latest_version&uuid=' . urlencode( admin_url( '/' ) ) . '&requester=' . get_option('admin_email') );
|
74 |
-
|
75 |
-
if (is_wp_error($result)) {
|
76 |
-
return;
|
77 |
-
}
|
78 |
-
|
79 |
-
$response = json_decode( $result ['body'] );
|
80 |
-
|
81 |
-
$live_version = $response->version;
|
82 |
-
$download_url = $response->download_url;
|
83 |
-
|
84 |
-
if ($this->live_version == $live_version || $response == 'false') {
|
85 |
-
return;
|
86 |
-
}
|
87 |
-
|
88 |
-
update_site_option( $this->prefix.'_live_version', $live_version );
|
89 |
-
update_site_option( $this->prefix.'_download_url', $download_url );
|
90 |
-
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
function overwrite_site_transient($plugin_info, $force_check_updates = false) {
|
95 |
-
|
96 |
-
if (empty( $plugin_info->checked ))
|
97 |
-
return $plugin_info;
|
98 |
-
|
99 |
-
$time_not_changed = isset( $this->last_checked ) && $this->check_update_timeout > ( time() - $this->last_checked );
|
100 |
-
|
101 |
-
if ( $force_check_updates || !$time_not_changed ) {
|
102 |
-
$this->check_for_updates();
|
103 |
-
$this->last_checked = time();
|
104 |
-
update_site_option( $this->prefix.'_last_checked', $this->last_checked );
|
105 |
-
}
|
106 |
-
|
107 |
-
$plugin_base_file = $this->base_name;
|
108 |
-
$live_version = get_site_option( $this->prefix.'_live_version' );
|
109 |
-
$installed_version = get_site_option( $this->prefix.'_installed_version' );
|
110 |
-
|
111 |
-
if (version_compare( $live_version, $installed_version, '>' )) {
|
112 |
-
$plugin_info->response [$plugin_base_file] = new stdClass();
|
113 |
-
$plugin_info->response [$plugin_base_file]->slug = substr( $plugin_base_file, 0, strpos( $plugin_base_file, '/' ) );
|
114 |
-
$plugin_info->response [$plugin_base_file]->new_version = $live_version;
|
115 |
-
$plugin_info->response [$plugin_base_file]->url = 'http://www.icegram.com';
|
116 |
-
$plugin_info->response [$plugin_base_file]->package = get_site_option( $this->prefix.'_download_url' );
|
117 |
-
}
|
118 |
-
|
119 |
-
return $plugin_info;
|
120 |
-
}
|
121 |
-
|
122 |
-
function overwrite_wp_plugin_api_for_plugin($api = false, $action = '', $args = '') {
|
123 |
-
|
124 |
-
if ($args->slug != $this->slug)
|
125 |
-
return $api;
|
126 |
-
|
127 |
-
if ('plugin_information' == $action || false === $api || $_REQUEST ['plugin'] == $args->slug) {
|
128 |
-
$api->name = $this->name;
|
129 |
-
$api->version = get_site_option( $this->prefix.'_live_version' );
|
130 |
-
$api->download_link = get_site_option( $this->prefix.'_download_url' );
|
131 |
-
}
|
132 |
-
|
133 |
-
return $api;
|
134 |
-
}
|
135 |
-
|
136 |
-
function update_row($file, $plugin_data) {
|
137 |
-
$license_key = get_site_option( $this->prefix.'_license_key' );
|
138 |
-
$valid_color = '#AAFFAA';
|
139 |
-
$invalid_color = '#FFAAAA';
|
140 |
-
$color = ($license_key != '') ? $valid_color : $invalid_color;
|
141 |
-
?>
|
142 |
-
<style type="text/css">
|
143 |
-
div#TB_window {
|
144 |
-
background: lightgrey;
|
145 |
-
}
|
146 |
-
</style>
|
147 |
-
<script type="text/javascript">
|
148 |
-
jQuery(function(){
|
149 |
-
jQuery(document).ready(function(){
|
150 |
-
var loaded_url = jQuery('a.<?php echo $this->prefix; ?>_support_link').attr('href');
|
151 |
-
|
152 |
-
if ( loaded_url != undefined && ( loaded_url.indexOf('width') == -1 || loaded_url.indexOf('height') == -1 ) ) {
|
153 |
-
var width = jQuery(window).width();
|
154 |
-
var H = jQuery(window).height();
|
155 |
-
var W = ( 720 < width ) ? 720 : width;
|
156 |
-
var adminbar_height = 0;
|
157 |
-
|
158 |
-
if ( jQuery('body.admin-bar').length )
|
159 |
-
adminbar_height = 28;
|
160 |
-
|
161 |
-
jQuery('a.<?php echo $this->prefix; ?>_support_link').each(function(){
|
162 |
-
var href = jQuery(this).attr('href');
|
163 |
-
if ( ! href )
|
164 |
-
return;
|
165 |
-
href = href.replace(/&width=[0-9]+/g, '');
|
166 |
-
href = href.replace(/&height=[0-9]+/g, '');
|
167 |
-
jQuery(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );
|
168 |
-
});
|
169 |
-
|
170 |
-
}
|
171 |
-
|
172 |
-
});
|
173 |
-
|
174 |
-
});
|
175 |
-
</script>
|
176 |
-
<?php
|
177 |
-
}
|
178 |
-
|
179 |
-
function support_ticket_content() {
|
180 |
-
global $current_user, $wpdb, $pagenow;
|
181 |
-
|
182 |
-
if ( $pagenow != 'plugins.php' ) return;
|
183 |
-
|
184 |
-
if ( !( $current_user instanceof WP_User ) ) return;
|
185 |
-
|
186 |
-
if( isset( $_POST['icegram_submit_query'] ) && $_POST['icegram_submit_query'] == "Send" ){
|
187 |
-
|
188 |
-
check_admin_referer( 'icegram-submit-query_' . $this->sku );
|
189 |
-
|
190 |
-
$additional_info = ( isset( $_POST['additional_information'] ) && !empty( $_POST['additional_information'] ) ) ? sanitize_text_field( $_POST['additional_information'] ) : '';
|
191 |
-
$additional_info = str_replace( '=====', '<br />', $additional_info );
|
192 |
-
$additional_info = str_replace( array( '[', ']' ), '', $additional_info );
|
193 |
-
|
194 |
-
$headers = 'From: ';
|
195 |
-
$headers .= ( isset( $_POST['client_name'] ) && !empty( $_POST['client_name'] ) ) ? sanitize_text_field( $_POST['client_name'] ) : '';
|
196 |
-
$headers .= ' <' . sanitize_text_field( $_POST['client_email'] ) . '>' . "\r\n";
|
197 |
-
$headers .= 'MIME-Version: 1.0' . "\r\n";
|
198 |
-
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
|
199 |
-
|
200 |
-
ob_start();
|
201 |
-
echo $additional_info . '<br /><br />';
|
202 |
-
echo nl2br($_POST['message']) ;
|
203 |
-
$message = ob_get_clean();
|
204 |
-
if ( empty( $_POST['name'] ) ) {
|
205 |
-
wp_mail( 'hello@icegram.com', $_POST['subject'], $message, $headers );
|
206 |
-
header('Location: ' . $_SERVER['HTTP_REFERER'] );
|
207 |
-
}
|
208 |
-
|
209 |
-
}
|
210 |
-
|
211 |
-
?>
|
212 |
-
<div id="<?php echo $this->prefix; ?>_post_query_form" style="display: none;">
|
213 |
-
<style>
|
214 |
-
table#<?php echo $this->prefix; ?>_post_query_table {
|
215 |
-
padding: 5px;
|
216 |
-
}
|
217 |
-
table#<?php echo $this->prefix; ?>_post_query_table tr td {
|
218 |
-
padding: 5px;
|
219 |
-
}
|
220 |
-
input.<?php echo $this->sku; ?>_text_field {
|
221 |
-
padding: 5px;
|
222 |
-
}
|
223 |
-
label {
|
224 |
-
font-weight: bold;
|
225 |
-
}
|
226 |
-
</style>
|
227 |
-
<?php
|
228 |
-
|
229 |
-
if ( !wp_script_is('jquery') ) {
|
230 |
-
wp_enqueue_script('jquery');
|
231 |
-
wp_enqueue_style('jquery');
|
232 |
-
}
|
233 |
-
|
234 |
-
$first_name = get_user_meta($current_user->ID, 'first_name', true);
|
235 |
-
$last_name = get_user_meta($current_user->ID, 'last_name', true);
|
236 |
-
$name = $first_name . ' ' . $last_name;
|
237 |
-
$customer_name = ( !empty( $name ) ) ? $name : $current_user->data->display_name;
|
238 |
-
$customer_email = $current_user->data->user_email;
|
239 |
-
$wp_version = ( is_multisite() ) ? 'WPMU ' . get_bloginfo('version') : 'WP ' . get_bloginfo('version');
|
240 |
-
$admin_url = admin_url();
|
241 |
-
$php_version = ( function_exists( 'phpversion' ) ) ? phpversion() : '';
|
242 |
-
$wp_max_upload_size = size_format( wp_max_upload_size() );
|
243 |
-
$server_max_upload_size = ini_get('upload_max_filesize');
|
244 |
-
$server_post_max_size = ini_get('post_max_size');
|
245 |
-
$wp_memory_limit = WP_MEMORY_LIMIT;
|
246 |
-
$wp_debug = ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) ? 'On' : 'Off';
|
247 |
-
$this_plugins_version = $this->plugin_data['Name'] . ' ' . $this->plugin_data['Version'];
|
248 |
-
$ip_address = $_SERVER['REMOTE_ADDR'];
|
249 |
-
$additional_information = "===== [Additional Information] =====
|
250 |
-
[WP Version: $wp_version] =====
|
251 |
-
[Admin URL: $admin_url] =====
|
252 |
-
[PHP Version: $php_version] =====
|
253 |
-
[WP Max Upload Size: $wp_max_upload_size] =====
|
254 |
-
[Server Max Upload Size: $server_max_upload_size] =====
|
255 |
-
[Server Post Max Size: $server_post_max_size] =====
|
256 |
-
[WP Memory Limit: $wp_memory_limit] =====
|
257 |
-
[WP Debug: $wp_debug] =====
|
258 |
-
[" . $this->plugin_data['Name'] . " Version: " . $this->plugin_data['Version'] . "] =====
|
259 |
-
[IP Address: $ip_address] =====
|
260 |
-
";
|
261 |
-
|
262 |
-
?>
|
263 |
-
<form id="<?php echo $this->prefix; ?>_form_post_query" method="POST" action="" enctype="multipart/form-data" oncontextmenu="return false;">
|
264 |
-
<script type="text/javascript">
|
265 |
-
jQuery(function(){
|
266 |
-
jQuery('input#<?php echo $this->prefix; ?>_submit_query').click(function(e){
|
267 |
-
var error = false;
|
268 |
-
|
269 |
-
var client_name = jQuery('input#client_name').val();
|
270 |
-
if ( client_name == '' ) {
|
271 |
-
jQuery('input#client_name').css('border-color', 'red');
|
272 |
-
error = true;
|
273 |
-
} else {
|
274 |
-
jQuery('input#client_name').css('border-color', '');
|
275 |
-
}
|
276 |
-
|
277 |
-
var client_email = jQuery('input#client_email').val();
|
278 |
-
if ( client_email == '' ) {
|
279 |
-
jQuery('input#client_email').css('border-color', 'red');
|
280 |
-
error = true;
|
281 |
-
} else {
|
282 |
-
jQuery('input#client_email').css('border-color', '');
|
283 |
-
}
|
284 |
-
|
285 |
-
var subject = jQuery('table#<?php echo $this->prefix; ?>_post_query_table input#subject').val();
|
286 |
-
if ( subject == '' ) {
|
287 |
-
jQuery('input#subject').css('border-color', 'red');
|
288 |
-
error = true;
|
289 |
-
} else {
|
290 |
-
jQuery('input#subject').css('border-color', '');
|
291 |
-
}
|
292 |
-
|
293 |
-
var message = jQuery('table#<?php echo $this->prefix; ?>_post_query_table textarea#message').val();
|
294 |
-
if ( message == '' ) {
|
295 |
-
jQuery('textarea#message').css('border-color', 'red');
|
296 |
-
error = true;
|
297 |
-
} else {
|
298 |
-
jQuery('textarea#message').css('border-color', '');
|
299 |
-
}
|
300 |
-
|
301 |
-
if ( error == true ) {
|
302 |
-
jQuery('label#error_message').text('* All fields are compulsory.');
|
303 |
-
e.preventDefault();
|
304 |
-
} else {
|
305 |
-
jQuery('label#error_message').text('');
|
306 |
-
}
|
307 |
-
|
308 |
-
});
|
309 |
-
|
310 |
-
jQuery("span.<?php echo $this->prefix; ?>_support a.thickbox").click( function(){
|
311 |
-
setTimeout(function() {
|
312 |
-
jQuery('#TB_ajaxWindowTitle strong').text('Send your query');
|
313 |
-
}, 0 );
|
314 |
-
});
|
315 |
-
|
316 |
-
jQuery('div#TB_ajaxWindowTitle').each(function(){
|
317 |
-
var window_title = jQuery(this).text();
|
318 |
-
if ( window_title.indexOf('Send your query') != -1 ) {
|
319 |
-
jQuery(this).remove();
|
320 |
-
}
|
321 |
-
});
|
322 |
-
|
323 |
-
jQuery('input,textarea').keyup(function(){
|
324 |
-
var value = jQuery(this).val();
|
325 |
-
if ( value.length > 0 ) {
|
326 |
-
jQuery(this).css('border-color', '');
|
327 |
-
jQuery('label#error_message').text('');
|
328 |
-
}
|
329 |
-
});
|
330 |
-
|
331 |
-
});
|
332 |
-
</script>
|
333 |
-
<table id="<?php echo $this->prefix; ?>_post_query_table">
|
334 |
-
<tr>
|
335 |
-
<td><label for="client_name"><?php _e('Name', $this->text_domain); ?>*</label></td>
|
336 |
-
<td><input type="text" class="regular-text <?php echo $this->sku; ?>_text_field" id="client_name" name="client_name" value="<?php echo $customer_name; ?>" autocomplete="off" oncopy="return false;" onpaste="return false;" oncut="return false;"/></td>
|
337 |
-
</tr>
|
338 |
-
<tr>
|
339 |
-
<td><label for="client_email"><?php _e('E-mail', $this->text_domain); ?>*</label></td>
|
340 |
-
<td><input type="email" class="regular-text <?php echo $this->sku; ?>_text_field" id="client_email" name="client_email" value="<?php echo $customer_email; ?>" autocomplete="off" oncopy="return false;" onpaste="return false;" oncut="return false;"/></td>
|
341 |
-
</tr>
|
342 |
-
<tr>
|
343 |
-
<td><label for="current_plugin"><?php _e('Product', $this->text_domain); ?></label></td>
|
344 |
-
<td><input type="text" class="regular-text <?php echo $this->sku; ?>_text_field" id="current_plugin" name="current_plugin" value="<?php echo $this_plugins_version; ?>" readonly autocomplete="off" oncopy="return false;" onpaste="return false;" oncut="return false;"/><input type="text" name="name" value="" style="display: none;" /></td>
|
345 |
-
</tr>
|
346 |
-
<tr>
|
347 |
-
<td><label for="subject"><?php _e('Subject', $this->text_domain); ?>*</label></td>
|
348 |
-
<td><input type="text" class="regular-text <?php echo $this->sku; ?>_text_field" id="subject" name="subject" value="<?php echo ( !empty( $subject ) ) ? $subject : ''; ?>" autocomplete="off" oncopy="return false;" onpaste="return false;" oncut="return false;"/></td>
|
349 |
-
</tr>
|
350 |
-
<tr>
|
351 |
-
<td style="vertical-align: top; padding-top: 12px;"><label for="message"><?php _e('Message', $this->text_domain); ?>*</label></td>
|
352 |
-
<td><textarea id="message" name="message" rows="10" cols="60" autocomplete="off" oncopy="return false;" onpaste="return false;" oncut="return false;"><?php echo ( !empty( $message ) ) ? $message : ''; ?></textarea></td>
|
353 |
-
</tr>
|
354 |
-
<tr>
|
355 |
-
<td></td>
|
356 |
-
<td><label id="error_message" style="color: red;"></label></td>
|
357 |
-
</tr>
|
358 |
-
<tr>
|
359 |
-
<td></td>
|
360 |
-
<td><button type="submit" class="button" id="<?php echo $this->prefix; ?>_submit_query" name="icegram_submit_query" value="Send" ><?php _e( 'Send', $this->text_domain ) ?></button></td>
|
361 |
-
</tr>
|
362 |
-
</table>
|
363 |
-
<?php wp_nonce_field( 'icegram-submit-query_' . $this->sku ); ?>
|
364 |
-
<input type="hidden" name="sku" value="<?php echo $this->sku; ?>" />
|
365 |
-
<input type="hidden" class="hidden_field" name="wp_version" value="<?php echo $wp_version; ?>" />
|
366 |
-
<input type="hidden" class="hidden_field" name="admin_url" value="<?php echo $admin_url; ?>" />
|
367 |
-
<input type="hidden" class="hidden_field" name="php_version" value="<?php echo $php_version; ?>" />
|
368 |
-
<input type="hidden" class="hidden_field" name="wp_max_upload_size" value="<?php echo $wp_max_upload_size; ?>" />
|
369 |
-
<input type="hidden" class="hidden_field" name="server_max_upload_size" value="<?php echo $server_max_upload_size; ?>" />
|
370 |
-
<input type="hidden" class="hidden_field" name="server_post_max_size" value="<?php echo $server_post_max_size; ?>" />
|
371 |
-
<input type="hidden" class="hidden_field" name="wp_memory_limit" value="<?php echo $wp_memory_limit; ?>" />
|
372 |
-
<input type="hidden" class="hidden_field" name="wp_debug" value="<?php echo $wp_debug; ?>" />
|
373 |
-
<input type="hidden" class="hidden_field" name="current_plugin" value="<?php echo $this_plugins_version; ?>" />
|
374 |
-
<input type="hidden" class="hidden_field" name="ip_address" value="<?php echo $ip_address; ?>" />
|
375 |
-
<input type="hidden" class="hidden_field" name="additional_information" value='<?php echo $additional_information; ?>' />
|
376 |
-
</form>
|
377 |
-
</div>
|
378 |
-
<?php
|
379 |
-
}
|
380 |
-
|
381 |
-
function add_support_link( $plugin_meta, $plugin_file, $plugin_data, $status ) {
|
382 |
-
|
383 |
-
if ( $this->base_name == $plugin_file ) {
|
384 |
-
$query_char = ( strpos( $_SERVER['REQUEST_URI'], '?' ) !== false ) ? '&' : '?';
|
385 |
-
$plugin_meta[] = '<a href="#TB_inline'.$query_char.'inlineId='.$this->prefix.'_post_query_form" class="thickbox '.$this->prefix.'_support_link" title="' . __( 'Submit your query', $this->text_domain ) . '">' . __( 'Support', $this->text_domain ) . '</a>';
|
386 |
-
if ( !empty( $this->documentation_link ) ) {
|
387 |
-
$plugin_meta[] = '<a href="'.$this->documentation_link.'" target="_blank" title="' . __( 'Documentation', $this->text_domain ) . '">' . __( 'Docs', $this->text_domain ) . '</a>';
|
388 |
-
}
|
389 |
-
}
|
390 |
-
|
391 |
-
return $plugin_meta;
|
392 |
-
|
393 |
-
}
|
394 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
icegram.php
CHANGED
@@ -3,10 +3,13 @@
|
|
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.1.
|
7 |
* Author: Icegram
|
8 |
* Author URI: http://www.icegram.com/
|
9 |
-
*
|
|
|
|
|
|
|
10 |
*
|
11 |
* Text Domain: icegram
|
12 |
* Domain Path: /lang/
|
@@ -109,7 +112,7 @@ class Icegram {
|
|
109 |
}
|
110 |
|
111 |
public function about_screen() {
|
112 |
-
global $icegram
|
113 |
|
114 |
// Import data if not done already
|
115 |
if( false === get_option( 'icegram_sample_data_imported' ) ) {
|
@@ -179,8 +182,8 @@ class Icegram {
|
|
179 |
|
180 |
$icegram_default = apply_filters( 'icegram_branding_data',
|
181 |
array ( 'default_promo_image' => $this->plugin_url . '/assets/images/icegram-logo-branding-64-grey.png',
|
182 |
-
'powered_by_logo' =>
|
183 |
-
'powered_by_text' =>
|
184 |
) );
|
185 |
$icegram = array ( 'messages' => array_values( $messages ),
|
186 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
@@ -826,25 +829,13 @@ class Icegram {
|
|
826 |
}
|
827 |
|
828 |
function initialize_icegram() {
|
829 |
-
global $icegram
|
830 |
|
831 |
// i18n / l10n - load translations
|
832 |
load_plugin_textdomain( 'icegram', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
|
833 |
|
834 |
$icegram = new Icegram();
|
835 |
-
|
836 |
-
if ( ! class_exists( 'IceGram_Upgrade' ) ) {
|
837 |
-
require_once 'icegram-includes/class-icegram-upgrade.php';
|
838 |
-
}
|
839 |
-
|
840 |
-
$sku = 'icegram';
|
841 |
-
$prefix = 'icegram';
|
842 |
-
$plugin_name = 'Icegram ';
|
843 |
-
$text_domain = 'icegram';
|
844 |
-
$documentation_link = '';
|
845 |
-
$icegram_upgrader = new IceGram_Upgrade( __FILE__, $sku, $prefix, $plugin_name, $text_domain, $documentation_link );
|
846 |
-
|
847 |
}
|
848 |
|
849 |
add_action( 'plugins_loaded', 'initialize_icegram' );
|
850 |
-
register_activation_hook( __FILE__, array( 'Icegram', 'install' ) );
|
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.1.2
|
7 |
* Author: Icegram
|
8 |
* Author URI: http://www.icegram.com/
|
9 |
+
*
|
10 |
+
* Copyright (c) 2014 Icegram
|
11 |
+
* License: GPLv3
|
12 |
+
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
13 |
*
|
14 |
* Text Domain: icegram
|
15 |
* Domain Path: /lang/
|
112 |
}
|
113 |
|
114 |
public function about_screen() {
|
115 |
+
global $icegram;
|
116 |
|
117 |
// Import data if not done already
|
118 |
if( false === get_option( 'icegram_sample_data_imported' ) ) {
|
182 |
|
183 |
$icegram_default = apply_filters( 'icegram_branding_data',
|
184 |
array ( 'default_promo_image' => $this->plugin_url . '/assets/images/icegram-logo-branding-64-grey.png',
|
185 |
+
'powered_by_logo' => '',
|
186 |
+
'powered_by_text' => ''
|
187 |
) );
|
188 |
$icegram = array ( 'messages' => array_values( $messages ),
|
189 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
829 |
}
|
830 |
|
831 |
function initialize_icegram() {
|
832 |
+
global $icegram;
|
833 |
|
834 |
// i18n / l10n - load translations
|
835 |
load_plugin_textdomain( 'icegram', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
|
836 |
|
837 |
$icegram = new Icegram();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
838 |
}
|
839 |
|
840 |
add_action( 'plugins_loaded', 'initialize_icegram' );
|
841 |
+
register_activation_hook( __FILE__, array( 'Icegram', 'install' ) );
|
readme.txt
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
=== Icegram ===
|
2 |
-
Contributors: storeapps, nareshvachhani, niravmehta, putler
|
3 |
Donate link:http://www.icegram.com/
|
4 |
Tags: popup, window, hellobar, action bar, header bar, footer bar, notification, messenger, targeting, rules, auto responder, icegram, responsive, slide
|
5 |
-
Requires at least: 3.
|
6 |
Tested up to: 3.9.1
|
7 |
-
Stable tag: 1.1.
|
8 |
-
License:
|
9 |
-
License URI: http://www.gnu.org/licenses/gpl-
|
10 |
|
11 |
All in one solution to inspire, convert and engage your audiences. Action bars, Popup windows, Messengers, Toast notifications and more.
|
12 |
|
@@ -86,25 +86,30 @@ Contact Us, provide as much detail of the problem as you can. We will try to sol
|
|
86 |
|
87 |
== Upgrade Notice ==
|
88 |
|
89 |
-
= 1.
|
90 |
-
|
|
|
|
|
|
|
91 |
|
92 |
= 1.1 =
|
93 |
First release on WordPress.org
|
94 |
|
95 |
-
= 1.
|
96 |
-
|
97 |
|
98 |
|
99 |
== Changelog ==
|
100 |
|
101 |
-
= 1.
|
102 |
-
*
|
103 |
-
|
104 |
-
= 1.1 =
|
105 |
-
* Loading CSS from own domain instead of Google
|
106 |
|
107 |
= 1.1.1 =
|
108 |
* Fix for crash on activation with W3 Total Cache
|
109 |
* Added localization / translation ability
|
110 |
|
|
|
|
|
|
|
|
|
|
1 |
=== Icegram ===
|
2 |
+
Contributors: storeapps, nareshvachhani, niravmehta, ratnakardubey, putler
|
3 |
Donate link:http://www.icegram.com/
|
4 |
Tags: popup, window, hellobar, action bar, header bar, footer bar, notification, messenger, targeting, rules, auto responder, icegram, responsive, slide
|
5 |
+
Requires at least: 3.9
|
6 |
Tested up to: 3.9.1
|
7 |
+
Stable tag: 1.1.2
|
8 |
+
License: GPLv3
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
11 |
All in one solution to inspire, convert and engage your audiences. Action bars, Popup windows, Messengers, Toast notifications and more.
|
12 |
|
86 |
|
87 |
== Upgrade Notice ==
|
88 |
|
89 |
+
= 1.1.2 =
|
90 |
+
Recommended. Code cleanup for better WP repo compatibility
|
91 |
+
|
92 |
+
= 1.1.1 =
|
93 |
+
Compatibility with W3TC and Localization
|
94 |
|
95 |
= 1.1 =
|
96 |
First release on WordPress.org
|
97 |
|
98 |
+
= 1.0 =
|
99 |
+
Initial Release
|
100 |
|
101 |
|
102 |
== Changelog ==
|
103 |
|
104 |
+
= 1.1.2 =
|
105 |
+
* Code cleanup for better WP repo compatibility
|
|
|
|
|
|
|
106 |
|
107 |
= 1.1.1 =
|
108 |
* Fix for crash on activation with W3 Total Cache
|
109 |
* Added localization / translation ability
|
110 |
|
111 |
+
= 1.1 =
|
112 |
+
* Loading CSS from own domain instead of Google
|
113 |
+
|
114 |
+
= 1.0 =
|
115 |
+
* Initial Release
|