Version Description
Download this release
Release Info
Developer | Icegram |
Plugin | Email Subscribers & Newsletters |
Version | 4.5.4 |
Comparing to | |
See all releases |
Code changes from version 4.5.3 to 4.5.4
- email-subscribers.php +43 -32
- lite/admin/class-email-subscribers-admin.php +101 -66
- lite/admin/css/email-subscribers-admin.css +876 -876
- lite/admin/css/jquery.timepicker.css +48 -48
- lite/admin/dist/main.css +1 -1
- lite/admin/js/email-subscribers-admin.js +55 -49
- lite/admin/js/es-onboarding.js +57 -57
- lite/admin/js/ig-es-workflows.js +71 -66
- lite/admin/partials/admin-header.php +7 -7
- lite/admin/partials/dashboard.php +173 -159
- lite/admin/partials/help.php +147 -126
- lite/admin/partials/onboarding.php +165 -109
- lite/includes/class-email-subscribers-activator.php +15 -15
- lite/includes/class-email-subscribers-loader.php +0 -3
- lite/includes/class-email-subscribers.php +62 -24
- lite/includes/class-es-common.php +92 -84
- lite/includes/class-es-install.php +64 -57
- lite/includes/class-ig-logger.php +3 -4
- lite/includes/classes/class-es-actions.php +68 -63
- lite/includes/classes/class-es-admin-settings.php +432 -430
- lite/includes/classes/class-es-browser.php +1825 -1824
- lite/includes/classes/class-es-cache.php +37 -13
- lite/includes/classes/class-es-campaigns-table.php +156 -140
- lite/includes/classes/class-es-compatibility.php +1 -1
- lite/includes/classes/class-es-contacts-table.php +182 -150
- lite/includes/classes/class-es-cron.php +15 -16
- lite/includes/classes/class-es-export-subscribers.php +80 -60
- lite/includes/classes/class-es-form-widget.php +19 -15
- lite/includes/classes/class-es-forms-table.php +318 -280
- lite/includes/classes/class-es-geolocation.php +8 -4
- lite/includes/classes/class-es-handle-post-notification.php +41 -26
- lite/includes/classes/class-es-handle-subscription.php +50 -16
- lite/includes/classes/class-es-handle-sync-wp-user.php +88 -104
- lite/includes/classes/class-es-ig-redirect.php +107 -100
- lite/includes/classes/class-es-import-subscribers.php +86 -61
- lite/includes/classes/class-es-info.php +6 -6
- lite/includes/classes/class-es-lists-table.php +115 -115
- lite/includes/classes/class-es-mailer.php +112 -100
- lite/includes/classes/class-es-message.php +27 -9
- lite/includes/classes/class-es-newsletters.php +231 -219
- lite/includes/classes/class-es-old-widget.php +43 -36
- lite/includes/classes/class-es-post-notifications.php +202 -180
- lite/includes/classes/class-es-queue.php +74 -75
- lite/includes/classes/class-es-reports-data.php +7 -7
- lite/includes/classes/class-es-reports-table.php +155 -143
- lite/includes/classes/class-es-subscription-throttling.php +28 -10
- lite/includes/classes/class-es-templates-table.php +64 -49
- lite/includes/classes/class-es-tools.php +7 -8
- lite/includes/classes/class-es-widget.php +33 -26
- lite/includes/db/class-es-db-actions.php +187 -64
- lite/includes/db/class-es-db-blocked-emails.php +9 -1
- lite/includes/db/class-es-db-campaigns.php +53 -53
- lite/includes/db/class-es-db-contacts.php +134 -85
- lite/includes/db/class-es-db-forms.php +22 -17
- lite/includes/db/class-es-db-links.php +2 -2
- lite/includes/db/class-es-db-lists-contacts.php +72 -47
- lite/includes/db/class-es-db-lists.php +15 -4
- lite/includes/db/class-es-db-mailing-queue.php +136 -68
- lite/includes/db/class-es-db-notifications.php +13 -7
- lite/includes/db/class-es-db-queue.php +14 -4
- lite/includes/db/class-es-db-sending-queue.php +155 -96
- lite/includes/db/class-es-db.php +52 -41
- lite/includes/es-backward.php +5 -5
- lite/includes/es-core-functions.php +225 -47
- lite/includes/feedback.php +2 -2
- lite/includes/feedback/class-ig-feedback.php +349 -341
email-subscribers.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Plugin Name: Email Subscribers & Newsletters
|
4 |
* Plugin URI: https://www.icegram.com/
|
5 |
* Description: Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published.
|
6 |
-
* Version: 4.5.
|
7 |
* Author: Icegram
|
8 |
* Author URI: https://www.icegram.com/
|
9 |
* Requires at least: 3.9
|
10 |
-
* Tested up to: 5.
|
11 |
* Requires PHP: 5.6
|
12 |
* Text Domain: email-subscribers
|
13 |
* Domain Path: /lite/languages/
|
@@ -28,7 +28,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
28 |
*
|
29 |
* @since 4.4.3 Added if not already defined() check.
|
30 |
*/
|
31 |
-
if( ! defined( 'IG_ES_MIN_PHP_VER' ) ) {
|
32 |
define( 'IG_ES_MIN_PHP_VER', '5.6' );
|
33 |
}
|
34 |
|
@@ -74,6 +74,8 @@ if ( ! defined( 'IG_ES_FEEDBACK_TRACKER_VERSION' ) ) {
|
|
74 |
global $ig_es_tracker;
|
75 |
|
76 |
/**
|
|
|
|
|
77 |
* @since 4.4.2
|
78 |
*/
|
79 |
global $wp_version;
|
@@ -97,12 +99,17 @@ if ( ! function_exists( 'ig_es_show_upgrade_pro_notice' ) ) {
|
|
97 |
* @since 4.3.0
|
98 |
*/
|
99 |
function ig_es_show_upgrade_pro_notice() {
|
100 |
-
$url = admin_url(
|
101 |
?>
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
|
|
|
|
|
|
|
|
|
|
106 |
<?php
|
107 |
}
|
108 |
}
|
@@ -156,7 +163,7 @@ if ( $is_premium ) {
|
|
156 |
/* ***************************** Initial Compatibility Work (End) ******************* */
|
157 |
|
158 |
if ( ! defined( 'ES_PLUGIN_VERSION' ) ) {
|
159 |
-
define( 'ES_PLUGIN_VERSION', '4.5.
|
160 |
}
|
161 |
|
162 |
// Plugin Folder Path.
|
@@ -190,16 +197,16 @@ if ( ! function_exists( 'activate_email_subscribers' ) ) {
|
|
190 |
require_once ES_PLUGIN_DIR . 'lite/includes/class-email-subscribers-activator.php';
|
191 |
|
192 |
if ( is_multisite() && $network_wide ) {
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
add_option( 'email_subscribers_do_activation_redirect', true );
|
202 |
-
|
203 |
}
|
204 |
}
|
205 |
|
@@ -220,11 +227,11 @@ if ( ! function_exists( 'deactivate_email_subscribers' ) ) {
|
|
220 |
global $wpdb;
|
221 |
|
222 |
// Get all active blogs in the network.
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
} else {
|
229 |
Email_Subscribers_Deactivator::deactivate();
|
230 |
}
|
@@ -250,7 +257,7 @@ if ( ! function_exists( 'ig_es_may_activate_on_blog' ) ) {
|
|
250 |
$blog_id = (int) $blog_id->blog_id;
|
251 |
}
|
252 |
|
253 |
-
if( empty( $blog_id ) || ! is_numeric( $blog_id ) ) {
|
254 |
return;
|
255 |
}
|
256 |
|
@@ -275,9 +282,9 @@ if ( ! function_exists( 'ig_es_activate_on_blog' ) ) {
|
|
275 |
*/
|
276 |
function ig_es_activate_on_blog( $blog_id ) {
|
277 |
switch_to_blog( $blog_id );
|
278 |
-
|
279 |
add_option( 'email_subscribers_do_activation_redirect', true );
|
280 |
-
|
281 |
}
|
282 |
}
|
283 |
|
@@ -292,12 +299,12 @@ if ( ! function_exists( 'ig_es_trigger_deactivation_in_multisite' ) ) {
|
|
292 |
*/
|
293 |
function ig_es_trigger_deactivation_in_multisite( $blog_id ) {
|
294 |
switch_to_blog( $blog_id );
|
295 |
-
|
296 |
-
|
297 |
}
|
298 |
}
|
299 |
|
300 |
-
if( version_compare( $wp_version, '5.1.0', '>' ) ) {
|
301 |
/**
|
302 |
* New action when a new site/blog created in WP Multisite > 5.1.0. Priority is lower to allow other options of site to be set before we initiate our activation process.
|
303 |
*/
|
@@ -318,7 +325,7 @@ if ( ! function_exists( 'email_subscribers_redirect' ) ) {
|
|
318 |
function email_subscribers_redirect() {
|
319 |
|
320 |
// Check if it is multisite and the current user is in the network administrative interface. e.g. `/wp-admin/network/`
|
321 |
-
if( is_multisite() && is_network_admin() ) {
|
322 |
return;
|
323 |
}
|
324 |
|
@@ -339,13 +346,14 @@ if ( ! function_exists( 'es_subbox' ) ) {
|
|
339 |
*/
|
340 |
function es_subbox( $namefield = null, $desc = null, $group = null ) {
|
341 |
|
|
|
342 |
$atts = array(
|
343 |
'namefield' => $namefield,
|
344 |
'desc' => $desc,
|
345 |
'group' => $group
|
346 |
);
|
347 |
-
|
348 |
-
echo
|
349 |
}
|
350 |
}
|
351 |
|
@@ -356,7 +364,10 @@ if ( ! function_exists( 'es_subbox' ) ) {
|
|
356 |
require ES_PLUGIN_DIR . 'lite/includes/class-email-subscribers.php';
|
357 |
|
358 |
if ( ! function_exists( 'ES' ) ) {
|
|
|
359 |
/**
|
|
|
|
|
360 |
* @return Email_Subscribers
|
361 |
*
|
362 |
* @since 4.2.1
|
3 |
* Plugin Name: Email Subscribers & Newsletters
|
4 |
* Plugin URI: https://www.icegram.com/
|
5 |
* Description: Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published.
|
6 |
+
* Version: 4.5.4
|
7 |
* Author: Icegram
|
8 |
* Author URI: https://www.icegram.com/
|
9 |
* Requires at least: 3.9
|
10 |
+
* Tested up to: 5.5
|
11 |
* Requires PHP: 5.6
|
12 |
* Text Domain: email-subscribers
|
13 |
* Domain Path: /lite/languages/
|
28 |
*
|
29 |
* @since 4.4.3 Added if not already defined() check.
|
30 |
*/
|
31 |
+
if ( ! defined( 'IG_ES_MIN_PHP_VER' ) ) {
|
32 |
define( 'IG_ES_MIN_PHP_VER', '5.6' );
|
33 |
}
|
34 |
|
74 |
global $ig_es_tracker;
|
75 |
|
76 |
/**
|
77 |
+
* Wordpress version
|
78 |
+
*
|
79 |
* @since 4.4.2
|
80 |
*/
|
81 |
global $wp_version;
|
99 |
* @since 4.3.0
|
100 |
*/
|
101 |
function ig_es_show_upgrade_pro_notice() {
|
102 |
+
$url = admin_url( 'plugins.php?plugin_status=upgrade' );
|
103 |
?>
|
104 |
+
<div class="notice notice-error">
|
105 |
+
<p>
|
106 |
+
<?php
|
107 |
+
/* translators: %s: Anchor tag with href attribute */
|
108 |
+
echo wp_kses_post( sprintf( __( 'You are using older version of <strong>Email Subscribers Premium</strong> plugin. It won\'t work because it needs plugin to be updated. Please update %s plugin.', 'email-subscribers' ),
|
109 |
+
'<a href="' . esc_url( $url ) . '" target="_blank">' . __( 'Email Subscribers Premium', 'email-subscribers' ) . '</a>' ) );
|
110 |
+
?>
|
111 |
+
</p>
|
112 |
+
</div>
|
113 |
<?php
|
114 |
}
|
115 |
}
|
163 |
/* ***************************** Initial Compatibility Work (End) ******************* */
|
164 |
|
165 |
if ( ! defined( 'ES_PLUGIN_VERSION' ) ) {
|
166 |
+
define( 'ES_PLUGIN_VERSION', '4.5.4' );
|
167 |
}
|
168 |
|
169 |
// Plugin Folder Path.
|
197 |
require_once ES_PLUGIN_DIR . 'lite/includes/class-email-subscribers-activator.php';
|
198 |
|
199 |
if ( is_multisite() && $network_wide ) {
|
200 |
+
|
201 |
+
// Get all active blogs in the network and activate plugin on each one
|
202 |
+
$blog_ids = $wpdb->get_col( sprintf( "SELECT blog_id FROM $wpdb->blogs WHERE deleted = %d", 0 ) );
|
203 |
+
foreach ( $blog_ids as $blog_id ) {
|
204 |
+
ig_es_activate_on_blog( $blog_id );
|
205 |
+
}
|
206 |
+
} else {
|
207 |
+
Email_Subscribers_Activator::activate();
|
208 |
add_option( 'email_subscribers_do_activation_redirect', true );
|
209 |
+
}
|
210 |
}
|
211 |
}
|
212 |
|
227 |
global $wpdb;
|
228 |
|
229 |
// Get all active blogs in the network.
|
230 |
+
$blog_ids = $wpdb->get_col( sprintf( "SELECT blog_id FROM $wpdb->blogs WHERE deleted = %d", 0 ) );
|
231 |
+
foreach ( $blog_ids as $blog_id ) {
|
232 |
+
// Run deactivation code on each one
|
233 |
+
ig_es_trigger_deactivation_in_multisite( $blog_id );
|
234 |
+
}
|
235 |
} else {
|
236 |
Email_Subscribers_Deactivator::deactivate();
|
237 |
}
|
257 |
$blog_id = (int) $blog_id->blog_id;
|
258 |
}
|
259 |
|
260 |
+
if ( empty( $blog_id ) || ! is_numeric( $blog_id ) ) {
|
261 |
return;
|
262 |
}
|
263 |
|
282 |
*/
|
283 |
function ig_es_activate_on_blog( $blog_id ) {
|
284 |
switch_to_blog( $blog_id );
|
285 |
+
Email_Subscribers_Activator::activate();
|
286 |
add_option( 'email_subscribers_do_activation_redirect', true );
|
287 |
+
restore_current_blog();
|
288 |
}
|
289 |
}
|
290 |
|
299 |
*/
|
300 |
function ig_es_trigger_deactivation_in_multisite( $blog_id ) {
|
301 |
switch_to_blog( $blog_id );
|
302 |
+
Email_Subscribers_Deactivator::deactivate();
|
303 |
+
restore_current_blog();
|
304 |
}
|
305 |
}
|
306 |
|
307 |
+
if ( version_compare( $wp_version, '5.1.0', '>' ) ) {
|
308 |
/**
|
309 |
* New action when a new site/blog created in WP Multisite > 5.1.0. Priority is lower to allow other options of site to be set before we initiate our activation process.
|
310 |
*/
|
325 |
function email_subscribers_redirect() {
|
326 |
|
327 |
// Check if it is multisite and the current user is in the network administrative interface. e.g. `/wp-admin/network/`
|
328 |
+
if ( is_multisite() && is_network_admin() ) {
|
329 |
return;
|
330 |
}
|
331 |
|
346 |
*/
|
347 |
function es_subbox( $namefield = null, $desc = null, $group = null ) {
|
348 |
|
349 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
350 |
$atts = array(
|
351 |
'namefield' => $namefield,
|
352 |
'desc' => $desc,
|
353 |
'group' => $group
|
354 |
);
|
355 |
+
$subscription_shortcode = ES_Shortcode::render_es_subscription_shortcode( $atts );
|
356 |
+
echo wp_kses( $subscription_shortcode , $allowedtags );
|
357 |
}
|
358 |
}
|
359 |
|
364 |
require ES_PLUGIN_DIR . 'lite/includes/class-email-subscribers.php';
|
365 |
|
366 |
if ( ! function_exists( 'ES' ) ) {
|
367 |
+
|
368 |
/**
|
369 |
+
* Email Subscribers instance
|
370 |
+
*
|
371 |
* @return Email_Subscribers
|
372 |
*
|
373 |
* @since 4.2.1
|
lite/admin/class-email-subscribers-admin.php
CHANGED
@@ -32,7 +32,6 @@ class Email_Subscribers_Admin {
|
|
32 |
* The ID of this plugin.
|
33 |
*
|
34 |
* @since 4.0
|
35 |
-
* @access private
|
36 |
* @var string $email_subscribers The ID of this plugin.
|
37 |
*/
|
38 |
private $email_subscribers;
|
@@ -41,7 +40,6 @@ class Email_Subscribers_Admin {
|
|
41 |
* The version of this plugin.
|
42 |
*
|
43 |
* @since 4.0
|
44 |
-
* @access private
|
45 |
* @var string $version The current version of this plugin.
|
46 |
*/
|
47 |
private $version;
|
@@ -62,7 +60,8 @@ class Email_Subscribers_Admin {
|
|
62 |
|
63 |
// Reorder ES Submenu
|
64 |
|
65 |
-
|
|
|
66 |
|
67 |
add_action( 'admin_menu', array( $this, 'email_subscribers_admin_menu' ) );
|
68 |
add_action( 'wp_ajax_es_klawoo_subscribe', array( $this, 'klawoo_subscribe' ) );
|
@@ -74,6 +73,8 @@ class Email_Subscribers_Admin {
|
|
74 |
add_action( 'wp_ajax_ig_es_toggle_campaign_status', array( $this, 'toggle_campaign_status' ) );
|
75 |
|
76 |
add_action( 'admin_init', array( $this, 'ob_start' ) );
|
|
|
|
|
77 |
}
|
78 |
|
79 |
/**
|
@@ -101,7 +102,7 @@ class Email_Subscribers_Admin {
|
|
101 |
|
102 |
wp_enqueue_style( $this->email_subscribers, plugin_dir_url( __FILE__ ) . 'css/email-subscribers-admin.css', array(), $this->version, 'all' );
|
103 |
|
104 |
-
wp_register_style( $this->email_subscribers . '-timepicker', plugin_dir_url( __FILE__ ) . 'css/jquery.timepicker.css' );
|
105 |
wp_enqueue_style( $this->email_subscribers . '-timepicker' );
|
106 |
|
107 |
wp_enqueue_style( 'ig-es-style', plugin_dir_url( __FILE__ ) . 'dist/main.css', array(), $this->version, 'all' );
|
@@ -148,15 +149,16 @@ class Email_Subscribers_Admin {
|
|
148 |
wp_enqueue_script( $this->email_subscribers . '-workflows', plugin_dir_url( __FILE__ ) . 'js/ig-es-workflows.js', array( 'jquery', 'jquery-ui-datepicker' ), $this->version, false );
|
149 |
|
150 |
$workflows_data = array(
|
151 |
-
'security'
|
152 |
-
'no_trigger_message'
|
153 |
-
'no_actions_message'
|
154 |
-
'
|
|
|
155 |
);
|
156 |
|
157 |
wp_localize_script( $this->email_subscribers . '-workflows', 'ig_es_workflows_data', $workflows_data );
|
158 |
|
159 |
-
if( ! function_exists( 'ig_es_wp_js_editor_admin_scripts' ) ) {
|
160 |
/**
|
161 |
* Include WP JS Editor library's main file. This file contains required functions to enqueue required js file which being used to create WordPress editor dynamcially.
|
162 |
*/
|
@@ -182,67 +184,65 @@ class Email_Subscribers_Admin {
|
|
182 |
public function remove_submenu() {
|
183 |
//remove submenues
|
184 |
?>
|
185 |
-
|
186 |
jQuery(document).ready(function () {
|
187 |
var removeSubmenu = ['ig-es-broadcast', 'ig-es-lists', 'ig-es-post-notifications', 'ig-es-sequence'];
|
188 |
jQuery.each(removeSubmenu, function (key, id) {
|
189 |
jQuery("#" + id).parent('a').parent('li').hide();
|
190 |
});
|
191 |
})
|
192 |
-
|
193 |
<?php
|
194 |
}
|
195 |
-
|
196 |
public function email_subscribers_admin_menu() {
|
197 |
-
|
198 |
$accessible_sub_menus = ES_Common::ig_es_get_accessible_sub_menus();
|
199 |
-
|
200 |
if ( count( $accessible_sub_menus ) > 0 ) {
|
201 |
// This adds the main menu page
|
202 |
add_menu_page( __( 'Email Subscribers', 'email-subscribers' ), __( 'Email Subscribers', 'email-subscribers' ), 'edit_posts', 'es_dashboard', array( $this, 'es_dashboard_callback' ), 'dashicons-email', 30 );
|
203 |
-
|
204 |
// Submenu
|
205 |
add_submenu_page( 'es_dashboard', __( 'Dashboard', 'email-subscribers' ), __( 'Dashboard', 'email-subscribers' ), 'edit_posts', 'es_dashboard', array( $this, 'es_dashboard_callback' ) );
|
206 |
}
|
207 |
-
|
208 |
-
if ( in_array( '
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
add_action( "load-$hook", array( '
|
216 |
-
add_action( "admin_footer-$hook", array( 'ES_Workflow_Admin_Edit', 'print_script_in_footer' ) );
|
217 |
-
add_action( 'admin_init', array( 'ES_Workflow_Admin_Edit', 'maybe_save' ) );
|
218 |
}
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
if ( in_array( 'campaigns', $accessible_sub_menus ) ) {
|
221 |
// Add Campaigns Submenu
|
222 |
$hook = add_submenu_page( 'es_dashboard', __( 'Campaigns', 'email-subscribers' ), __( 'Campaigns', 'email-subscribers' ), 'edit_posts', 'es_campaigns', array( $this, 'render_campaigns' ) );
|
223 |
add_action( "load-$hook", array( 'ES_Campaigns_Table', 'screen_options' ) );
|
224 |
-
|
225 |
add_submenu_page( 'es_dashboard', __( 'Post Notifications', 'email-subscribers' ), '<span id="ig-es-post-notifications">' . __( 'Post Notifications', 'email-subscribers' ) . '</span>', 'edit_posts', 'es_notifications', array( $this, 'load_post_notifications' ) );
|
226 |
add_submenu_page( 'es_dashboard', __( 'Broadcast', 'email-subscribers' ), '<span id="ig-es-broadcast">' . __( 'Broadcast', 'email-subscribers' ) . '</span>', 'edit_posts', 'es_newsletters', array( $this, 'load_newsletters' ) );
|
227 |
add_submenu_page( null, __( 'Template Preview', 'email-subscribers' ), __( 'Template Preview', 'email-subscribers' ), 'edit_posts', 'es_template_preview', array( $this, 'load_preview' ) );
|
228 |
-
|
229 |
-
}
|
230 |
-
|
231 |
-
|
232 |
-
if ( in_array( 'forms', $accessible_sub_menus ) ) {
|
233 |
-
// Add Forms Submenu
|
234 |
-
$hook = add_submenu_page( 'es_dashboard', __( 'Forms', 'email-subscribers' ), __( 'Forms', 'email-subscribers' ), 'edit_posts', 'es_forms', array( $this, 'render_forms' ) );
|
235 |
-
add_action( "load-$hook", array( 'ES_Forms_Table', 'screen_options' ) );
|
236 |
}
|
|
|
|
|
237 |
|
238 |
-
|
239 |
-
|
240 |
-
$hook = add_submenu_page( 'es_dashboard', __( 'Audience', 'email-subscribers' ), __( 'Audience', 'email-subscribers' ), 'edit_posts', 'es_subscribers', array( $this, 'render_contacts' ) );
|
241 |
-
add_action( "load-$hook", array( 'ES_Contacts_Table', 'screen_options' ) );
|
242 |
|
243 |
-
|
244 |
-
|
245 |
-
add_action( "
|
|
|
246 |
}
|
247 |
|
248 |
if ( in_array( 'reports', $accessible_sub_menus ) ) {
|
@@ -281,6 +281,9 @@ class Email_Subscribers_Admin {
|
|
281 |
|
282 |
// Function for Klawoo's Subscribe form on Help & Info page
|
283 |
public static function klawoo_subscribe() {
|
|
|
|
|
|
|
284 |
$url = 'http://app.klawoo.com/subscribe';
|
285 |
|
286 |
$form_source = ig_es_get_request_data( 'from_source' );
|
@@ -301,7 +304,7 @@ class Email_Subscribers_Admin {
|
|
301 |
'method' => $method
|
302 |
);
|
303 |
|
304 |
-
if (
|
305 |
$options['body'] = $qs;
|
306 |
} else {
|
307 |
if ( strpos( $url, '?' ) !== false ) {
|
@@ -313,14 +316,14 @@ class Email_Subscribers_Admin {
|
|
313 |
|
314 |
$response = wp_remote_request( $url, $options );
|
315 |
|
316 |
-
if ( wp_remote_retrieve_response_code( $response )
|
317 |
$data = $response['body'];
|
318 |
-
if (
|
319 |
|
320 |
$message_start = substr( $data, strpos( $data, '<body>' ) + 6 );
|
321 |
$remove = substr( $message_start, strpos( $message_start, '</body>' ) );
|
322 |
$message = trim( str_replace( $remove, '', $message_start ) );
|
323 |
-
echo( $message );
|
324 |
exit();
|
325 |
}
|
326 |
}
|
@@ -379,6 +382,7 @@ class Email_Subscribers_Admin {
|
|
379 |
|
380 |
/**
|
381 |
* Render Post Notifications
|
|
|
382 |
* @since 4.2.1
|
383 |
*/
|
384 |
public function load_post_notifications() {
|
@@ -436,7 +440,7 @@ class Email_Subscribers_Admin {
|
|
436 |
}
|
437 |
|
438 |
|
439 |
-
function submenu_order( $menu_order ) {
|
440 |
global $submenu;
|
441 |
|
442 |
$es_menus = isset( $submenu['es_dashboard'] ) ? $submenu['es_dashboard'] : array();
|
@@ -460,8 +464,6 @@ class Email_Subscribers_Admin {
|
|
460 |
'es_settings',
|
461 |
'es_general_information',
|
462 |
'es_pricing',
|
463 |
-
|
464 |
-
|
465 |
);
|
466 |
|
467 |
$order = array_flip( $es_menu_order );
|
@@ -473,8 +475,7 @@ class Email_Subscribers_Admin {
|
|
473 |
|
474 |
ksort( $reorder_es_menu );
|
475 |
|
476 |
-
|
477 |
-
|
478 |
}
|
479 |
|
480 |
# Return the new submenu order
|
@@ -493,12 +494,13 @@ class Email_Subscribers_Admin {
|
|
493 |
if ( ! $is_sa_option_exists && ! $ig_es_4015_db_updated_at && 'yes' !== $onboarding_status ) {
|
494 |
include plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/onboarding.php';
|
495 |
} else {
|
|
|
496 |
include plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/dashboard.php';
|
497 |
}
|
498 |
|
499 |
}
|
500 |
|
501 |
-
function send_test_email() {
|
502 |
|
503 |
check_ajax_referer( 'ig-es-admin-ajax-nonce', 'security' );
|
504 |
|
@@ -563,13 +565,13 @@ class Email_Subscribers_Admin {
|
|
563 |
}
|
564 |
|
565 |
//save skip signup option
|
566 |
-
function es_save_onboarding_skip() {
|
567 |
|
568 |
$es_skip = ig_es_get_request_data( 'es_skip' );
|
569 |
$option_name = ig_es_get_request_data( 'option_name' );
|
570 |
|
571 |
|
572 |
-
if (
|
573 |
/**
|
574 |
* If user logged in then only save option.
|
575 |
*/
|
@@ -590,7 +592,7 @@ class Email_Subscribers_Admin {
|
|
590 |
$list_id = ig_es_get_request_data( 'list_id', 0 );
|
591 |
$status = ig_es_get_request_data( 'status', 'all' );
|
592 |
|
593 |
-
if (
|
594 |
return 0;
|
595 |
}
|
596 |
|
@@ -603,7 +605,7 @@ class Email_Subscribers_Admin {
|
|
603 |
global $ig_es_tracker;
|
604 |
|
605 |
$template_id = (int) ig_es_get_request_data( 'template_id', 0 );
|
606 |
-
if (
|
607 |
return 0;
|
608 |
}
|
609 |
$post_temp_arr = get_post( $template_id );
|
@@ -619,6 +621,26 @@ class Email_Subscribers_Admin {
|
|
619 |
die( json_encode( $result ) );
|
620 |
}
|
621 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
622 |
/**
|
623 |
* Hooked to 'set-screen-options' filter
|
624 |
*
|
@@ -632,23 +654,35 @@ class Email_Subscribers_Admin {
|
|
632 |
*/
|
633 |
public function save_screen_options( $status, $option, $value ) {
|
634 |
|
635 |
-
$
|
636 |
-
|
637 |
-
|
638 |
-
'es_lists_per_page',
|
639 |
-
'es_forms_per_page',
|
640 |
-
'es_workflows_per_page'
|
641 |
-
);
|
642 |
|
643 |
-
if ( in_array( $option, $ig_es_options ) ) {
|
644 |
return $value;
|
645 |
}
|
646 |
|
647 |
return $status;
|
648 |
}
|
649 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
650 |
/**
|
651 |
* Remove all admin notices
|
|
|
652 |
* @since 4.4.0
|
653 |
*/
|
654 |
public function remove_other_admin_notices() {
|
@@ -662,7 +696,7 @@ class Email_Subscribers_Admin {
|
|
662 |
|
663 |
if ( ! empty( $get_page ) && 'es_dashboard' == $get_page ) {
|
664 |
|
665 |
-
|
666 |
$es_display_notices = array(
|
667 |
'connect_icegram_notification',
|
668 |
);
|
@@ -783,7 +817,8 @@ class Email_Subscribers_Admin {
|
|
783 |
$wordpress_url = 'https://www.wordpress.org';
|
784 |
$icegram_url = 'https://www.icegram.com';
|
785 |
|
786 |
-
|
|
|
787 |
}
|
788 |
|
789 |
return $footer_text;
|
32 |
* The ID of this plugin.
|
33 |
*
|
34 |
* @since 4.0
|
|
|
35 |
* @var string $email_subscribers The ID of this plugin.
|
36 |
*/
|
37 |
private $email_subscribers;
|
40 |
* The version of this plugin.
|
41 |
*
|
42 |
* @since 4.0
|
|
|
43 |
* @var string $version The current version of this plugin.
|
44 |
*/
|
45 |
private $version;
|
60 |
|
61 |
// Reorder ES Submenu
|
62 |
|
63 |
+
// Commenting out since we are now registering the submenus in the order required. Therefore no need to change the submenu order later on.
|
64 |
+
//add_filter( 'custom_menu_order', array( $this, 'submenu_order' ) );
|
65 |
|
66 |
add_action( 'admin_menu', array( $this, 'email_subscribers_admin_menu' ) );
|
67 |
add_action( 'wp_ajax_es_klawoo_subscribe', array( $this, 'klawoo_subscribe' ) );
|
73 |
add_action( 'wp_ajax_ig_es_toggle_campaign_status', array( $this, 'toggle_campaign_status' ) );
|
74 |
|
75 |
add_action( 'admin_init', array( $this, 'ob_start' ) );
|
76 |
+
|
77 |
+
add_action( 'init', array( $this, 'save_screen_option' ) );
|
78 |
}
|
79 |
|
80 |
/**
|
102 |
|
103 |
wp_enqueue_style( $this->email_subscribers, plugin_dir_url( __FILE__ ) . 'css/email-subscribers-admin.css', array(), $this->version, 'all' );
|
104 |
|
105 |
+
wp_register_style( $this->email_subscribers . '-timepicker', plugin_dir_url( __FILE__ ) . 'css/jquery.timepicker.css', array(), $this->version, 'all' );
|
106 |
wp_enqueue_style( $this->email_subscribers . '-timepicker' );
|
107 |
|
108 |
wp_enqueue_style( 'ig-es-style', plugin_dir_url( __FILE__ ) . 'dist/main.css', array(), $this->version, 'all' );
|
149 |
wp_enqueue_script( $this->email_subscribers . '-workflows', plugin_dir_url( __FILE__ ) . 'js/ig-es-workflows.js', array( 'jquery', 'jquery-ui-datepicker' ), $this->version, false );
|
150 |
|
151 |
$workflows_data = array(
|
152 |
+
'security' => wp_create_nonce( 'ig-es-workflow-nonce' ),
|
153 |
+
'no_trigger_message' => __( 'Please select a trigger before saving the workflow.', 'email-subscribers' ),
|
154 |
+
'no_actions_message' => __( 'Please add some actions before saving the workflow.', 'email-subscribers' ),
|
155 |
+
'no_action_selected_message' => __( 'Please select an action that this workflow should perform before saving the workflow.', 'email-subscribers' ),
|
156 |
+
'trigger_change_message' => __( 'Changing the trigger will remove existing actions. Do you want to proceed anyway?.', 'email-subscribers' ),
|
157 |
);
|
158 |
|
159 |
wp_localize_script( $this->email_subscribers . '-workflows', 'ig_es_workflows_data', $workflows_data );
|
160 |
|
161 |
+
if ( ! function_exists( 'ig_es_wp_js_editor_admin_scripts' ) ) {
|
162 |
/**
|
163 |
* Include WP JS Editor library's main file. This file contains required functions to enqueue required js file which being used to create WordPress editor dynamcially.
|
164 |
*/
|
184 |
public function remove_submenu() {
|
185 |
//remove submenues
|
186 |
?>
|
187 |
+
<script type="text/javascript">
|
188 |
jQuery(document).ready(function () {
|
189 |
var removeSubmenu = ['ig-es-broadcast', 'ig-es-lists', 'ig-es-post-notifications', 'ig-es-sequence'];
|
190 |
jQuery.each(removeSubmenu, function (key, id) {
|
191 |
jQuery("#" + id).parent('a').parent('li').hide();
|
192 |
});
|
193 |
})
|
194 |
+
</script>
|
195 |
<?php
|
196 |
}
|
197 |
+
|
198 |
public function email_subscribers_admin_menu() {
|
199 |
+
|
200 |
$accessible_sub_menus = ES_Common::ig_es_get_accessible_sub_menus();
|
201 |
+
|
202 |
if ( count( $accessible_sub_menus ) > 0 ) {
|
203 |
// This adds the main menu page
|
204 |
add_menu_page( __( 'Email Subscribers', 'email-subscribers' ), __( 'Email Subscribers', 'email-subscribers' ), 'edit_posts', 'es_dashboard', array( $this, 'es_dashboard_callback' ), 'dashicons-email', 30 );
|
205 |
+
|
206 |
// Submenu
|
207 |
add_submenu_page( 'es_dashboard', __( 'Dashboard', 'email-subscribers' ), __( 'Dashboard', 'email-subscribers' ), 'edit_posts', 'es_dashboard', array( $this, 'es_dashboard_callback' ) );
|
208 |
}
|
209 |
+
|
210 |
+
if ( in_array( 'audience', $accessible_sub_menus ) ) {
|
211 |
+
// Add Contacts Submenu
|
212 |
+
$hook = add_submenu_page( 'es_dashboard', __( 'Audience', 'email-subscribers' ), __( 'Audience', 'email-subscribers' ), 'edit_posts', 'es_subscribers', array( $this, 'render_contacts' ) );
|
213 |
+
add_action( "load-$hook", array( 'ES_Contacts_Table', 'screen_options' ) );
|
214 |
+
|
215 |
+
// Add Lists Submenu
|
216 |
+
$hook = add_submenu_page( 'es_dashboard', __( 'Lists', 'email-subscribers' ), '<span id="ig-es-lists">' . __( 'Lists', 'email-subscribers' ) . '</span>', 'edit_posts', 'es_lists', array( $this, 'render_lists' ) );
|
217 |
+
add_action( "load-$hook", array( 'ES_Lists_Table', 'screen_options' ) );
|
|
|
|
|
218 |
}
|
219 |
|
220 |
+
if ( in_array( 'forms', $accessible_sub_menus ) ) {
|
221 |
+
// Add Forms Submenu
|
222 |
+
$hook = add_submenu_page( 'es_dashboard', __( 'Forms', 'email-subscribers' ), __( 'Forms', 'email-subscribers' ), 'edit_posts', 'es_forms', array( $this, 'render_forms' ) );
|
223 |
+
add_action( "load-$hook", array( 'ES_Forms_Table', 'screen_options' ) );
|
224 |
+
}
|
225 |
+
|
226 |
if ( in_array( 'campaigns', $accessible_sub_menus ) ) {
|
227 |
// Add Campaigns Submenu
|
228 |
$hook = add_submenu_page( 'es_dashboard', __( 'Campaigns', 'email-subscribers' ), __( 'Campaigns', 'email-subscribers' ), 'edit_posts', 'es_campaigns', array( $this, 'render_campaigns' ) );
|
229 |
add_action( "load-$hook", array( 'ES_Campaigns_Table', 'screen_options' ) );
|
230 |
+
|
231 |
add_submenu_page( 'es_dashboard', __( 'Post Notifications', 'email-subscribers' ), '<span id="ig-es-post-notifications">' . __( 'Post Notifications', 'email-subscribers' ) . '</span>', 'edit_posts', 'es_notifications', array( $this, 'load_post_notifications' ) );
|
232 |
add_submenu_page( 'es_dashboard', __( 'Broadcast', 'email-subscribers' ), '<span id="ig-es-broadcast">' . __( 'Broadcast', 'email-subscribers' ) . '</span>', 'edit_posts', 'es_newsletters', array( $this, 'load_newsletters' ) );
|
233 |
add_submenu_page( null, __( 'Template Preview', 'email-subscribers' ), __( 'Template Preview', 'email-subscribers' ), 'edit_posts', 'es_template_preview', array( $this, 'load_preview' ) );
|
234 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
}
|
236 |
+
|
237 |
+
if ( in_array( 'workflows', $accessible_sub_menus ) ) {
|
238 |
|
239 |
+
// Add Workflows Submenu
|
240 |
+
$hook = add_submenu_page( 'es_dashboard', __( 'Workflows', 'email-subscribers' ), __( 'Workflows', 'email-subscribers' ), 'edit_posts', 'es_workflows', array( $this, 'render_workflows' ) );
|
|
|
|
|
241 |
|
242 |
+
add_action( "load-$hook", array( 'ES_Workflows_Table', 'screen_options' ) );
|
243 |
+
add_action( "load-$hook", array( 'ES_Workflow_Admin_Edit', 'register_meta_boxes' ) );
|
244 |
+
add_action( "admin_footer-$hook", array( 'ES_Workflow_Admin_Edit', 'print_script_in_footer' ) );
|
245 |
+
add_action( 'admin_init', array( 'ES_Workflow_Admin_Edit', 'maybe_save' ) );
|
246 |
}
|
247 |
|
248 |
if ( in_array( 'reports', $accessible_sub_menus ) ) {
|
281 |
|
282 |
// Function for Klawoo's Subscribe form on Help & Info page
|
283 |
public static function klawoo_subscribe() {
|
284 |
+
|
285 |
+
check_ajax_referer( 'ig-es-admin-ajax-nonce', 'security' );
|
286 |
+
|
287 |
$url = 'http://app.klawoo.com/subscribe';
|
288 |
|
289 |
$form_source = ig_es_get_request_data( 'from_source' );
|
304 |
'method' => $method
|
305 |
);
|
306 |
|
307 |
+
if ( 'POST' == $method ) {
|
308 |
$options['body'] = $qs;
|
309 |
} else {
|
310 |
if ( strpos( $url, '?' ) !== false ) {
|
316 |
|
317 |
$response = wp_remote_request( $url, $options );
|
318 |
|
319 |
+
if ( 200 == wp_remote_retrieve_response_code( $response ) ) {
|
320 |
$data = $response['body'];
|
321 |
+
if ( 'error' != $data ) {
|
322 |
|
323 |
$message_start = substr( $data, strpos( $data, '<body>' ) + 6 );
|
324 |
$remove = substr( $message_start, strpos( $message_start, '</body>' ) );
|
325 |
$message = trim( str_replace( $remove, '', $message_start ) );
|
326 |
+
echo wp_kses_post( $message );
|
327 |
exit();
|
328 |
}
|
329 |
}
|
382 |
|
383 |
/**
|
384 |
* Render Post Notifications
|
385 |
+
*
|
386 |
* @since 4.2.1
|
387 |
*/
|
388 |
public function load_post_notifications() {
|
440 |
}
|
441 |
|
442 |
|
443 |
+
public function submenu_order( $menu_order ) {
|
444 |
global $submenu;
|
445 |
|
446 |
$es_menus = isset( $submenu['es_dashboard'] ) ? $submenu['es_dashboard'] : array();
|
464 |
'es_settings',
|
465 |
'es_general_information',
|
466 |
'es_pricing',
|
|
|
|
|
467 |
);
|
468 |
|
469 |
$order = array_flip( $es_menu_order );
|
475 |
|
476 |
ksort( $reorder_es_menu );
|
477 |
|
478 |
+
//$submenu['es_dashboard'] = $reorder_es_menu;
|
|
|
479 |
}
|
480 |
|
481 |
# Return the new submenu order
|
494 |
if ( ! $is_sa_option_exists && ! $ig_es_4015_db_updated_at && 'yes' !== $onboarding_status ) {
|
495 |
include plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/onboarding.php';
|
496 |
} else {
|
497 |
+
|
498 |
include plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/dashboard.php';
|
499 |
}
|
500 |
|
501 |
}
|
502 |
|
503 |
+
public function send_test_email() {
|
504 |
|
505 |
check_ajax_referer( 'ig-es-admin-ajax-nonce', 'security' );
|
506 |
|
565 |
}
|
566 |
|
567 |
//save skip signup option
|
568 |
+
public function es_save_onboarding_skip() {
|
569 |
|
570 |
$es_skip = ig_es_get_request_data( 'es_skip' );
|
571 |
$option_name = ig_es_get_request_data( 'option_name' );
|
572 |
|
573 |
|
574 |
+
if ( '1' == $es_skip && ! empty( $option_name ) ) {
|
575 |
/**
|
576 |
* If user logged in then only save option.
|
577 |
*/
|
592 |
$list_id = ig_es_get_request_data( 'list_id', 0 );
|
593 |
$status = ig_es_get_request_data( 'status', 'all' );
|
594 |
|
595 |
+
if ( 0 == $list_id ) {
|
596 |
return 0;
|
597 |
}
|
598 |
|
605 |
global $ig_es_tracker;
|
606 |
|
607 |
$template_id = (int) ig_es_get_request_data( 'template_id', 0 );
|
608 |
+
if ( 0 == $template_id ) {
|
609 |
return 0;
|
610 |
}
|
611 |
$post_temp_arr = get_post( $template_id );
|
621 |
die( json_encode( $result ) );
|
622 |
}
|
623 |
|
624 |
+
/**
|
625 |
+
* Get Email Subscribers' screen options
|
626 |
+
*
|
627 |
+
* @return array
|
628 |
+
*
|
629 |
+
* @since 4.5.4
|
630 |
+
*/
|
631 |
+
public function get_admin_screen_options() {
|
632 |
+
|
633 |
+
$admin_screen_options = array(
|
634 |
+
'es_campaigns_per_page',
|
635 |
+
'es_contacts_per_page',
|
636 |
+
'es_lists_per_page',
|
637 |
+
'es_forms_per_page',
|
638 |
+
'es_workflows_per_page'
|
639 |
+
);
|
640 |
+
|
641 |
+
return apply_filters( 'ig_es_admin_screen_options', $admin_screen_options );
|
642 |
+
}
|
643 |
+
|
644 |
/**
|
645 |
* Hooked to 'set-screen-options' filter
|
646 |
*
|
654 |
*/
|
655 |
public function save_screen_options( $status, $option, $value ) {
|
656 |
|
657 |
+
$admin_screen_options = $this->get_admin_screen_options();
|
658 |
+
|
659 |
+
if ( in_array( $option, $admin_screen_options ) ) {
|
|
|
|
|
|
|
|
|
660 |
|
|
|
661 |
return $value;
|
662 |
}
|
663 |
|
664 |
return $status;
|
665 |
}
|
666 |
|
667 |
+
/**
|
668 |
+
* Hook 'save_screen_options' function to "set_screen_option_{$option}" filter to allow saving of ES custom screen options in WP 5.4.2
|
669 |
+
*
|
670 |
+
* @since 4.5.4
|
671 |
+
*/
|
672 |
+
public function save_screen_option() {
|
673 |
+
|
674 |
+
$admin_screen_options = $this->get_admin_screen_options();
|
675 |
+
|
676 |
+
if ( ! empty( $admin_screen_options ) && is_array( $admin_screen_options ) ) {
|
677 |
+
foreach ( $admin_screen_options as $option ) {
|
678 |
+
add_filter( "set_screen_option_{$option}", array( $this, 'save_screen_options' ), 10, 3 );
|
679 |
+
}
|
680 |
+
}
|
681 |
+
}
|
682 |
+
|
683 |
/**
|
684 |
* Remove all admin notices
|
685 |
+
*
|
686 |
* @since 4.4.0
|
687 |
*/
|
688 |
public function remove_other_admin_notices() {
|
696 |
|
697 |
if ( ! empty( $get_page ) && 'es_dashboard' == $get_page ) {
|
698 |
|
699 |
+
// Allow only Icegram Connection popup on Dashboard
|
700 |
$es_display_notices = array(
|
701 |
'connect_icegram_notification',
|
702 |
);
|
817 |
$wordpress_url = 'https://www.wordpress.org';
|
818 |
$icegram_url = 'https://www.icegram.com';
|
819 |
|
820 |
+
/* translators: 1. WordPress URL 2. Email Subscribers version 3. Icegram site URL */
|
821 |
+
$footer_text = sprintf( __( '<span id="footer-thankyou">Thank you for creating with <a href="%1$s" target="_blank">WordPress</a> | Email Subscribers <b>%2$s</b>. Developed by team <a href="%3$s" target="_blank">Icegram</a></span>', 'email-subscribers' ), $wordpress_url, ES_PLUGIN_VERSION, $icegram_url );
|
822 |
}
|
823 |
|
824 |
return $footer_text;
|
lite/admin/css/email-subscribers-admin.css
CHANGED
@@ -1,1033 +1,1033 @@
|
|
1 |
#menu-content-change:focus {
|
2 |
-
|
3 |
-
|
4 |
}
|
5 |
|
6 |
ul#menu-nav li.active {
|
7 |
-
|
8 |
}
|
9 |
|
10 |
#menu-nav li a.active {
|
11 |
-
|
12 |
}
|
13 |
|
14 |
.es-lists-table .column-created_at{
|
15 |
-
|
16 |
}
|
17 |
|
18 |
.es-lists-table .column-export{
|
19 |
-
|
20 |
}
|
21 |
|
22 |
a:focus {
|
23 |
-
|
24 |
}
|
25 |
|
26 |
#email_tabs_form div#es-settings-tabs {
|
27 |
-
|
28 |
-
|
29 |
}
|
30 |
|
31 |
#email_tabs_form div#es-settings-tabs div#menu-tab-listing {
|
32 |
-
|
33 |
-
|
34 |
}
|
35 |
|
36 |
#email_tabs_form div#es-settings-tabs div#menu-tab-content {
|
37 |
-
|
38 |
-
|
39 |
}
|
40 |
|
41 |
#email_tabs_form div#es-settings-tabs div#menu-tab-listing ul {
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
}
|
51 |
|
52 |
#email_tabs_form div#es-settings-tabs div#menu-tab-listing ul li {
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
}
|
61 |
|
62 |
#email_tabs_form div#es-settings-tabs div#menu-tab-listing ul li a {
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
}
|
67 |
|
68 |
#email_tabs_form div#es-settings-tabs div#menu-tab-content h1 {
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
}
|
74 |
|
75 |
#email_tabs_form div#es-settings-tabs div#menu-tab-content h2 {
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
}
|
81 |
|
82 |
|
83 |
.help-info-content {
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
}
|
92 |
|
93 |
.help-info-content .left-blog {
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
}
|
98 |
|
99 |
.help-info-content .right-blog {
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
}
|
104 |
|
105 |
.help-info-content ul {
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
}
|
110 |
|
111 |
.help-info-content ul li {
|
112 |
-
|
113 |
}
|
114 |
|
115 |
.feature-section {
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
}
|
123 |
|
124 |
.feature-section .feature-blog {
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
}
|
134 |
|
135 |
.feature-section .feature-blog ul {
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
}
|
140 |
|
141 |
.feature-section .feature-blog ul li {
|
142 |
-
|
143 |
-
|
144 |
}
|
145 |
|
146 |
.feature-section .feature-blog ul li a {
|
147 |
-
|
148 |
-
|
149 |
}
|
150 |
|
151 |
.feature-section .feature-blog h3 {
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
}
|
158 |
|
159 |
.feature-blog-wrapper .feature-blog {
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
}
|
164 |
|
165 |
.feature-blog-wrapper {
|
166 |
-
|
167 |
}
|
168 |
|
169 |
.feature-section .feature-header {
|
170 |
-
|
171 |
-
|
172 |
}
|
173 |
|
174 |
.feature-section .feature-header h2 {
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
}
|
181 |
|
182 |
.feature-section.feature-section-last h3 {
|
183 |
-
|
184 |
-
|
185 |
}
|
186 |
|
187 |
.feature-section.feature-section-last img {
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
}
|
194 |
|
195 |
.feature-section.feature-section-last p {
|
196 |
-
|
197 |
-
|
198 |
}
|
199 |
|
200 |
/*.email-subscribers_page_es_settings input[type=text], .email-subscribers_page_es_settings input[type=password], .email-subscribers_page_es_settings input[type=email], .email-subscribers_page_es_settings textarea, #list_description, .email-subscribers_page_es_settings select {
|
201 |
-
|
202 |
}
|
203 |
*/
|
204 |
.tablenav-pages span.paging-input {
|
205 |
-
|
206 |
-
|
207 |
}
|
208 |
|
209 |
div#post-body-content {
|
210 |
-
|
211 |
-
|
212 |
}
|
213 |
|
214 |
div#post-body-content .meta-box-sortables .row-blog {
|
215 |
-
|
216 |
}
|
217 |
|
218 |
div#post-body-content .meta-box-sortables .row-blog label {
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
}
|
224 |
|
225 |
div#post-body-content .meta-box-sortables .row-blog input[type="text"], div#post-body-content .meta-box-sortables .row-blog input[type="email"], div#post-body-content .meta-box-sortables .row-blog select {
|
226 |
-
|
227 |
-
|
228 |
}
|
229 |
|
230 |
|
231 |
div#post-body-content .meta-box-sortables .row-blog p.submit input#submit {
|
232 |
-
|
233 |
-
|
234 |
}
|
235 |
|
236 |
.blog-content {
|
237 |
-
|
238 |
}
|
239 |
|
240 |
.blog-content .blog-row {
|
241 |
-
|
242 |
}
|
243 |
|
244 |
.blog-content .blog-row p {
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
}
|
249 |
|
250 |
.blog-content .blog-row input, .blog-content .blog-row select {
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
}
|
255 |
|
256 |
.blog-content .blog-row.blog-row-submit input#submit {
|
257 |
-
|
258 |
}
|
259 |
|
260 |
.email-subscribers_page_es_newsletters table.form-table td select,
|
261 |
.email-subscribers_page_es_notifications table.form-table td select,
|
262 |
.email-subscribers_page_es_newsletters table.form-table input[type="text"],
|
263 |
.email-subscribers_page_es_notifications table.form-table input[type="text"] {
|
264 |
-
|
265 |
}
|
266 |
|
267 |
/* Customize Admin Settings */
|
268 |
|
269 |
.ig-settings-form .ui-state-active, .ig-settings-form .ui-widget-content .ui-state-active, .ig-settings-form .ui-widget-header .ui-state-active, .ig-settings-form a.ui-button:active, .ig-settings-form .ui-button:active, .ig-settings-form .ui-button.ui-state-active:hover {
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
}
|
274 |
|
275 |
.ig-settings-form .ui-state-active a, .ig-settings-form .ui-state-active a:link, .ig-settings-form .ui-state-active a:visited {
|
276 |
-
|
277 |
}
|
278 |
|
279 |
.content.save {
|
280 |
-
|
281 |
}
|
282 |
|
283 |
.es-settings-submit-btn {
|
284 |
-
|
285 |
}
|
286 |
|
287 |
.email-subscribers_page_es_subscribers .es-settings-submit-btn .button {
|
288 |
-
|
289 |
}
|
290 |
|
291 |
#email_tabs_form div#es-settings-tabs {
|
292 |
-
|
293 |
}
|
294 |
|
295 |
#email_tabs_form div#es-settings-tabs div#menu-tab-content h1 {
|
296 |
-
|
297 |
}
|
298 |
|
299 |
.esbghead {
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
}
|
304 |
|
305 |
.esbghead h1 {
|
306 |
-
|
307 |
-
|
308 |
}
|
309 |
|
310 |
.ui-tabs-panel h2 {
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
}
|
315 |
|
316 |
.essettings input#submit, .email-subscribers_page_es_subscribers input#submit {
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
}
|
324 |
|
325 |
p.search-box.box-ma10 {
|
326 |
-
|
327 |
}
|
328 |
|
329 |
.esbgheader {
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
}
|
337 |
|
338 |
.esbgheader h1 {
|
339 |
-
|
340 |
-
|
341 |
}
|
342 |
|
343 |
.headerpart {
|
344 |
-
|
345 |
}
|
346 |
|
347 |
.select2-container {
|
348 |
-
|
349 |
}
|
350 |
|
351 |
.tablenav.top #doaction, #doaction2, #post-query-submit {
|
352 |
-
|
353 |
}
|
354 |
|
355 |
.leftside, .rightside {
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
}
|
360 |
|
361 |
.leftside p.submit, .rightside p.submit {
|
362 |
-
|
363 |
-
|
364 |
}
|
365 |
|
366 |
/* Admin Settings */
|
367 |
|
368 |
/*.email-subscribers_page_es_settings #wpwrap {
|
369 |
-
|
370 |
-
|
371 |
|
372 |
.form-table .helper {
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
}
|
378 |
|
379 |
.form-table .es_sub_headline {
|
380 |
-
|
381 |
-
|
382 |
}
|
383 |
|
384 |
#menu-tab-listing .ig-menu-tab.ui-tabs-active.ui-state-active.ui-tabs-active {
|
385 |
-
|
386 |
}
|
387 |
|
388 |
#menu-tab-listing .ui-state-default {
|
389 |
-
|
390 |
}
|
391 |
|
392 |
.es-settings-submit-btn {
|
393 |
-
|
394 |
}
|
395 |
|
396 |
.es-cta {
|
397 |
-
|
398 |
-
|
399 |
}
|
400 |
|
401 |
.wrap .page-title-action.es-imp-button:hover {
|
402 |
-
|
403 |
-
|
404 |
}
|
405 |
|
406 |
.page-title-action.es-imp-button {
|
407 |
-
|
408 |
-
|
409 |
}
|
410 |
|
411 |
.wrap .page-title-action.es-main-button:hover {
|
412 |
-
|
413 |
-
|
414 |
}
|
415 |
|
416 |
.page-title-action.es-main-button {
|
417 |
-
|
418 |
-
|
419 |
}
|
420 |
|
421 |
.es-contact-form {
|
422 |
-
|
423 |
}
|
424 |
|
425 |
.es-contact-form .form-table td {
|
426 |
-
|
427 |
}
|
428 |
|
429 |
.es-note-child-category td {
|
430 |
-
|
431 |
}
|
432 |
|
433 |
/**** Dashboard : start ***/
|
434 |
.toplevel_page_es_dashboard .about-header {
|
435 |
-
|
436 |
}
|
437 |
|
438 |
.wrap.about-wrap {
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
}
|
445 |
|
446 |
.about-wrap.es {
|
447 |
-
|
448 |
}
|
449 |
|
450 |
.about-header .wrap .button-hero, .button-main {
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
}
|
459 |
|
460 |
.about-header .wrap .button-hero:hover, .button-main {
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
}
|
465 |
|
466 |
.about-header {
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
}
|
472 |
|
473 |
/*.form-table th {
|
474 |
-
|
475 |
-
|
476 |
|
477 |
.es-ltr {
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
}
|
483 |
|
484 |
.es-about-text {
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
}
|
489 |
|
490 |
.es-notify-about-new-post-1 {
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
}
|
496 |
|
497 |
.es-notify-about-new-post-2 {
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
}
|
502 |
|
503 |
.wrap.about-wrap h1 {
|
504 |
-
|
505 |
-
|
506 |
}
|
507 |
|
508 |
.feature-section.col > div {
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
}
|
514 |
|
515 |
.feature-section.col.two-col > div {
|
516 |
-
|
517 |
}
|
518 |
|
519 |
.feature-section.col img {
|
520 |
-
|
521 |
-
|
522 |
}
|
523 |
|
524 |
.feature-section.col p {
|
525 |
-
|
526 |
}
|
527 |
|
528 |
.about-wrap .feature-section h4 {
|
529 |
-
|
530 |
}
|
531 |
|
532 |
.about-wrap.es .feature-section {
|
533 |
-
|
534 |
}
|
535 |
|
536 |
|
537 |
.about-wrap [class$=col] .last-feature {
|
538 |
-
|
539 |
}
|
540 |
|
541 |
.es-support {
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
}
|
552 |
|
553 |
.es-contact-us {
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
}
|
559 |
|
560 |
.es-contact-us a {
|
561 |
-
|
562 |
}
|
563 |
|
564 |
.es-donate-link {
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
}
|
569 |
|
570 |
.es-esaf-integration {
|
571 |
-
|
572 |
}
|
573 |
|
574 |
.es-ig-integration {
|
575 |
-
|
576 |
}
|
577 |
|
578 |
.es-rm-integration {
|
579 |
-
|
580 |
}
|
581 |
|
582 |
.es-integration-guide {
|
583 |
-
|
584 |
}
|
585 |
|
586 |
.es_feature, .es_summary {
|
587 |
-
|
588 |
}
|
589 |
|
590 |
.es_summary {
|
591 |
-
|
592 |
}
|
593 |
|
594 |
.es_feature_list, .es_faq_list {
|
595 |
-
|
596 |
-
|
597 |
}
|
598 |
|
599 |
.es_faq {
|
600 |
-
|
601 |
-
|
602 |
}
|
603 |
|
604 |
.form-table td.es-optin-headline {
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
}
|
610 |
|
611 |
.form-table td.es-emm-image {
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
}
|
616 |
|
617 |
.form-table td.es-emm-text {
|
618 |
-
|
619 |
-
|
620 |
}
|
621 |
|
622 |
.form-table td.es-emm-optin {
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
}
|
627 |
|
628 |
.form-table td.es-emm-optin form[name="klawoo_subscribe"] {
|
629 |
-
|
630 |
}
|
631 |
|
632 |
#klawoo_response {
|
633 |
-
|
634 |
}
|
635 |
|
636 |
.es-about-line {
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
}
|
641 |
|
642 |
.es-help-wrap {
|
643 |
-
|
644 |
}
|
645 |
|
646 |
.subscribe-form {
|
647 |
-
|
648 |
}
|
649 |
|
650 |
.subscribe-form li {
|
651 |
-
|
652 |
-
|
653 |
}
|
654 |
|
655 |
.es-upper {
|
656 |
-
|
657 |
}
|
658 |
|
659 |
.es-upper .es-info {
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
}
|
665 |
|
666 |
.es-info img {
|
667 |
-
|
668 |
}
|
669 |
|
670 |
.es-lower {
|
671 |
-
|
672 |
|
673 |
}
|
674 |
|
675 |
.es-quick-links-wrapper {
|
676 |
-
|
677 |
-
|
678 |
}
|
679 |
|
680 |
li.es-quick-links {
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
}
|
686 |
|
687 |
.es-quick-links a {
|
688 |
-
|
689 |
}
|
690 |
|
691 |
.button-main {
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
}
|
701 |
|
702 |
.es-right {
|
703 |
-
|
704 |
}
|
705 |
|
706 |
.es-doc-links {
|
707 |
-
|
708 |
-
|
709 |
}
|
710 |
|
711 |
.about-header .es-version {
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
}
|
718 |
|
719 |
h5.es-badge {
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
}
|
726 |
|
727 |
.about-header .es-version h3 {
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
}
|
732 |
|
733 |
.about-header .es-version a {
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
}
|
739 |
|
740 |
.about-header {
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
}
|
748 |
|
749 |
.about-header h2 {
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
}
|
755 |
|
756 |
.about-header .es-about-text {
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
}
|
762 |
|
763 |
.about-header .es-notify-about-new-post-1 {
|
764 |
-
|
765 |
-
|
766 |
}
|
767 |
|
768 |
.about-header ul {
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
}
|
775 |
|
776 |
.about-header ul li {
|
777 |
-
|
778 |
}
|
779 |
|
780 |
.about-header .wrap.klawoo-form {
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
}
|
787 |
|
788 |
.about-header .wrap.klawoo-form td.es-optin-headline, .es-right-headline {
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
}
|
795 |
|
796 |
.about-header .wrap.klawoo-form td.es-emm-text {
|
797 |
-
|
798 |
-
|
799 |
}
|
800 |
|
801 |
.about-header .wrap.klawoo-form td.es-emm-image img {
|
802 |
-
|
803 |
}
|
804 |
|
805 |
@media only screen and (max-width: 1362px) {
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
}
|
827 |
|
828 |
.es-facebook.column {
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
}
|
837 |
|
838 |
.es-facebook.column strong {
|
839 |
-
|
840 |
-
|
841 |
}
|
842 |
|
843 |
.es-facebook.column i.dashicons-facebook {
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
}
|
849 |
|
850 |
|
851 |
/**** Dashboard : end ***/
|
852 |
|
853 |
.es_list_contact_status:before {
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
}
|
858 |
|
859 |
.subscribed.es_list_contact_status:before {
|
860 |
-
|
861 |
}
|
862 |
|
863 |
.unsubscribed.es_list_contact_status:before {
|
864 |
-
|
865 |
}
|
866 |
|
867 |
.unconfirmed.es_list_contact_status:before {
|
868 |
-
|
869 |
}
|
870 |
|
871 |
.ig-es-process-queue {
|
872 |
-
|
873 |
-
|
874 |
}
|
875 |
|
876 |
.ig-es-process-queue .page-title-action {
|
877 |
-
|
878 |
}
|
879 |
|
880 |
.ig-es-process-queue .es-helper {
|
881 |
-
|
882 |
}
|
883 |
|
884 |
.email-subscribers_page_es_settings .ui-widget {
|
885 |
-
|
886 |
-
|
887 |
}
|
888 |
|
889 |
.email-subscribers_page_es_settings .ui-widget input,
|
890 |
.email-subscribers_page_es_settings .ui-widget select,
|
891 |
.email-subscribers_page_es_settings .ui-widget textarea,
|
892 |
.email-subscribers_page_es_settings .ui-widget button {
|
893 |
-
|
894 |
-
|
895 |
}
|
896 |
|
897 |
.es-icon {
|
898 |
-
|
899 |
}
|
900 |
|
901 |
.es-send-success:before {
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
}
|
907 |
|
908 |
.es-send-error:before {
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
}
|
914 |
|
915 |
|
916 |
@media only screen and (max-width: 1362px) {
|
917 |
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
|
922 |
}
|
923 |
|
924 |
.es-fire-sale {
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
}
|
931 |
|
932 |
@keyframes beat {
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
}
|
937 |
|
938 |
#es-test-email {
|
939 |
-
|
940 |
-
|
941 |
}
|
942 |
|
943 |
.es_spinner_image_admin img {
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
}
|
948 |
|
949 |
.es-upsale-image img {
|
950 |
-
|
951 |
}
|
952 |
|
953 |
.es-smtp-image img {
|
954 |
-
|
955 |
-
|
956 |
}
|
957 |
|
958 |
.es-smtp-label {
|
959 |
-
|
960 |
}
|
961 |
|
962 |
/*onboarding css */
|
963 |
#slider-wrapper {
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
}
|
983 |
|
984 |
.sp {
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
}
|
992 |
|
993 |
.es-footer {
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
}
|
1001 |
|
1002 |
a.button-send, .es-error-actions .es-dashboard-btn {
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
}
|
1012 |
|
1013 |
a.button-send:hover, .es-error-actions .es-dashboard-btn:hover {
|
1014 |
-
|
1015 |
-
|
1016 |
}
|
1017 |
|
1018 |
/*.es-send-email-screen img.es-loader {
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
}*/
|
1023 |
|
1024 |
.sp input[type="email"].error {
|
1025 |
-
|
1026 |
}
|
1027 |
|
1028 |
.es-error-actions {
|
1029 |
-
|
1030 |
-
|
1031 |
}
|
1032 |
|
1033 |
.es-error-actions .es-dashboard-btn {
|
@@ -1035,827 +1035,827 @@ a.button-send:hover, .es-error-actions .es-dashboard-btn:hover {
|
|
1035 |
}
|
1036 |
|
1037 |
.es-error-actions .button-hero {
|
1038 |
-
|
1039 |
}
|
1040 |
|
1041 |
.sp h1 {
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
}
|
1046 |
|
1047 |
.sp .es-ltr {
|
1048 |
-
|
1049 |
}
|
1050 |
|
1051 |
.sp .button-hero {
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
|
1060 |
}
|
1061 |
|
1062 |
.sp .es-actions {
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
}
|
1069 |
|
1070 |
.sp form[name=klawoo_subscribe] {
|
1071 |
-
|
1072 |
}
|
1073 |
|
1074 |
.sp .dashicons {
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
}
|
1079 |
|
1080 |
.sp form[name=klawoo_subscribe] input[type="email"], .sp form[name=klawoo_subscribe] input[type="text"] {
|
1081 |
-
|
1082 |
-
|
1083 |
}
|
1084 |
|
1085 |
|
1086 |
#es-send-email-form input[type="email"] {
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
}
|
1093 |
|
1094 |
.es-form-wrapper {
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
}
|
1099 |
|
1100 |
.es-send-email-screen .es-form-wrapper form {
|
1101 |
-
|
1102 |
}
|
1103 |
|
1104 |
.sp.es-receive-error li {
|
1105 |
-
|
1106 |
}
|
1107 |
|
1108 |
.es-email-sending-error {
|
1109 |
-
|
1110 |
-
|
1111 |
}
|
1112 |
|
1113 |
.es-error form.es-onboarding {
|
1114 |
-
|
1115 |
}
|
1116 |
|
1117 |
.sp .es-gray {
|
1118 |
-
|
1119 |
-
|
1120 |
}
|
1121 |
|
1122 |
.sp .es-skip {
|
1123 |
-
|
1124 |
}
|
1125 |
|
1126 |
/* onboarding :end */
|
1127 |
|
1128 |
.ig-es-indicator {
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
}
|
1138 |
|
1139 |
.ig-es-success-indicator {
|
1140 |
-
|
1141 |
}
|
1142 |
|
1143 |
.ig-es-indicator-new {
|
1144 |
-
|
1145 |
}
|
1146 |
|
1147 |
/* Information Box CSS */
|
1148 |
div.ig-es-information-box {
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
}
|
1154 |
|
1155 |
div.ig-es-center {
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
}
|
1160 |
|
1161 |
div.ig-es-box-shadow {
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
}
|
1168 |
|
1169 |
.ig-es-success {
|
1170 |
-
|
1171 |
-
|
1172 |
}
|
1173 |
|
1174 |
.ig-es-danger {
|
1175 |
-
|
1176 |
-
|
1177 |
}
|
1178 |
|
1179 |
.ig-es-info {
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
}
|
1184 |
|
1185 |
.ig-es-warning {
|
1186 |
-
|
1187 |
-
|
1188 |
}
|
1189 |
|
1190 |
.ig-vertical-align {
|
1191 |
-
|
1192 |
-
|
1193 |
}
|
1194 |
|
1195 |
.ig-es-icon {
|
1196 |
-
|
1197 |
}
|
1198 |
|
1199 |
.ig-es-icon-success:before {
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
}
|
1204 |
|
1205 |
.ig-es-icon-danger:before {
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
}
|
1210 |
|
1211 |
.ig-es-icon-info:before {
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
}
|
1216 |
|
1217 |
.ig-es-icon-warning:before {
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
}
|
1222 |
|
1223 |
/* Structure */
|
1224 |
div.es .column {
|
1225 |
-
|
1226 |
-
|
1227 |
}
|
1228 |
|
1229 |
div.es .row {
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
}
|
1234 |
|
1235 |
div.es .one-half {
|
1236 |
-
|
1237 |
-
|
1238 |
}
|
1239 |
|
1240 |
div.es .one-third {
|
1241 |
-
|
1242 |
-
|
1243 |
}
|
1244 |
|
1245 |
div.es .last {
|
1246 |
-
|
1247 |
}
|
1248 |
|
1249 |
.ig-es-pricing-img {
|
1250 |
-
|
1251 |
}
|
1252 |
|
1253 |
.email-subscribers_page_es_pricing #wpwrap #wpcontent {
|
1254 |
-
|
1255 |
}
|
1256 |
|
1257 |
.es-floting-button {
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
}
|
1269 |
|
1270 |
.es-floting-button a {
|
1271 |
-
|
1272 |
-
|
1273 |
}
|
1274 |
|
1275 |
.es-floting-button:hover {
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
}
|
1281 |
|
1282 |
.es_mailer:not(:first-of-type) {
|
1283 |
-
|
1284 |
}
|
1285 |
|
1286 |
.es-mailer-logo {
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
}
|
1291 |
|
1292 |
.es-mailer-logo img {
|
1293 |
-
|
1294 |
-
|
1295 |
}
|
1296 |
|
1297 |
.es-mailer-logo.es_recommended .es-logo-wrapper {
|
1298 |
-
|
1299 |
}
|
1300 |
|
1301 |
.es-logo-wrapper {
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
}
|
1312 |
|
1313 |
.ig_es_docblock {
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
}
|
1321 |
|
1322 |
#post_digest {
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
}
|
1327 |
|
1328 |
.post_digest_block {
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
}
|
1334 |
|
1335 |
/* Email Subscribers new css : Start*/
|
1336 |
.es_settings_field {
|
1337 |
-
|
1338 |
}
|
1339 |
|
1340 |
.es_settings_left_pan {
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
}
|
1345 |
|
1346 |
.es_settings_field input[type="text"], .es_settings_field input[type="email"] {
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
}
|
1353 |
|
1354 |
.es_settings_field label {
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
}
|
1360 |
|
1361 |
.es_settings_right_pan {
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
}
|
1372 |
|
1373 |
.es_settings_field select {
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
}
|
1381 |
|
1382 |
.es_campaign_name_wrapper {
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
}
|
1387 |
|
1388 |
.es_campaign_name_wrapper .es_newsletter_name {
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
}
|
1402 |
|
1403 |
.es_primary_btn {
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
|
1419 |
}
|
1420 |
|
1421 |
.es_primary_btn:hover {
|
1422 |
-
|
1423 |
-
|
1424 |
}
|
1425 |
|
1426 |
.es_secondary_btn {
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
}
|
1435 |
|
1436 |
.es_secondary_btn:hover {
|
1437 |
-
|
1438 |
-
|
1439 |
}
|
1440 |
|
1441 |
|
1442 |
/* Email Subscribers new css : End*/
|
1443 |
|
1444 |
table.ig_es_form_table td {
|
1445 |
-
|
1446 |
}
|
1447 |
|
1448 |
|
1449 |
/* Workflow CSS Start */
|
1450 |
.ig-es-table {
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
}
|
1459 |
|
1460 |
.ig-es-table--bordered {
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
}
|
1465 |
|
1466 |
.ig-es-table a {
|
1467 |
-
|
1468 |
}
|
1469 |
|
1470 |
.ig-es-table .ig-es-table__col {
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
}
|
1477 |
|
1478 |
.ig-es-table .ig-es-table__col--label {
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
}
|
1487 |
|
1488 |
.ig-es-table .ig-es-table__col--label .ig-es-help-tip {
|
1489 |
-
|
1490 |
-
|
1491 |
}
|
1492 |
|
1493 |
.ig-es-table .ig-es-table__col--field {
|
1494 |
-
|
1495 |
-
|
1496 |
}
|
1497 |
|
1498 |
.ig-es-table .ig-es-table__row:first-child .ig-es-table__col {
|
1499 |
-
|
1500 |
}
|
1501 |
|
1502 |
#post-body .postbox h3.hndle {
|
1503 |
-
|
1504 |
-
|
1505 |
}
|
1506 |
|
1507 |
#post-body .postbox.no-drag .hndle {
|
1508 |
-
|
1509 |
}
|
1510 |
|
1511 |
.postbox .ig-es-metabox-footer {
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
}
|
1517 |
|
1518 |
.postbox .ig-es-metabox-pad {
|
1519 |
-
|
1520 |
}
|
1521 |
|
1522 |
.postbox h2.hndle small {
|
1523 |
-
|
1524 |
-
|
1525 |
}
|
1526 |
|
1527 |
.postbox h2.hndle .ig-es-help-link {
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
}
|
1532 |
|
1533 |
.ig-es-field {
|
1534 |
-
|
1535 |
-
|
1536 |
}
|
1537 |
|
1538 |
.ig-es-field--invalid {
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
}
|
1543 |
|
1544 |
.ig-es-field--type-text,
|
1545 |
.ig-es-field--type-number {
|
1546 |
-
|
1547 |
}
|
1548 |
|
1549 |
.ig-es-field--monospace {
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
}
|
1554 |
|
1555 |
.wp-admin select.ig-es-field {
|
1556 |
-
|
1557 |
}
|
1558 |
|
1559 |
.ig-es-field-errors {
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
}
|
1565 |
|
1566 |
.ig-es-field-errors__error {
|
1567 |
-
|
1568 |
}
|
1569 |
|
1570 |
.ig-es-action__fields {
|
1571 |
-
|
1572 |
-
|
1573 |
}
|
1574 |
|
1575 |
.es-actions-container {
|
1576 |
-
|
1577 |
}
|
1578 |
|
1579 |
.es-rules-container {
|
1580 |
-
|
1581 |
}
|
1582 |
|
1583 |
body.email-subscribers_page_es_workflows #post-body .postbox .inside {
|
1584 |
-
|
1585 |
-
|
1586 |
}
|
1587 |
|
1588 |
.field-gap {
|
1589 |
-
|
1590 |
}
|
1591 |
|
1592 |
.field-cols .col-1, .field-cols .col-2 {
|
1593 |
-
|
1594 |
-
|
1595 |
}
|
1596 |
|
1597 |
.field-cols .col-2 {
|
1598 |
-
|
1599 |
}
|
1600 |
|
1601 |
.ig-es-field-description {
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
}
|
1607 |
|
1608 |
.ig-es-time-field-group {
|
1609 |
-
|
1610 |
}
|
1611 |
|
1612 |
.ig-es-time-field-group:before,
|
1613 |
.ig-es-time-field-group:after {
|
1614 |
-
|
1615 |
-
|
1616 |
}
|
1617 |
|
1618 |
.ig-es-time-field-group:after {
|
1619 |
-
|
1620 |
}
|
1621 |
|
1622 |
.ig-es-time-field-group__fields {
|
1623 |
-
|
1624 |
}
|
1625 |
|
1626 |
.ig-es-time-field-group .ig-es-field {
|
1627 |
-
|
1628 |
-
|
1629 |
}
|
1630 |
|
1631 |
.ig-es-time-field-group__sep {
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
}
|
1637 |
|
1638 |
.ig-es-time-field-group__24hr-note {
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
}
|
1645 |
|
1646 |
.ig-es-label {
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
}
|
1652 |
|
1653 |
.ig-es-action-template {
|
1654 |
-
|
1655 |
}
|
1656 |
|
1657 |
.ig-es-actions-container {
|
1658 |
-
|
1659 |
}
|
1660 |
|
1661 |
.ig-es-action {
|
1662 |
-
|
1663 |
}
|
1664 |
|
1665 |
.ig-es-action .wp-editor-container iframe {
|
1666 |
-
|
1667 |
}
|
1668 |
|
1669 |
.ig-es-action.js-open .ig-es-action__header h4,
|
1670 |
.ig-es-action.js-open .ig-es-action__header a {
|
1671 |
-
|
1672 |
}
|
1673 |
|
1674 |
.ig-es-action__header {
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
}
|
1680 |
|
1681 |
.ig-es-action__header h4 {
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
}
|
1686 |
|
1687 |
.ig-es-action__header .row-options {
|
1688 |
-
|
1689 |
-
|
1690 |
}
|
1691 |
|
1692 |
.ig-es-action__header .row-options a {
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
}
|
1697 |
|
1698 |
.ig-es-action .ig-es-action__fields:not([style*='display']) {
|
1699 |
-
|
1700 |
}
|
1701 |
|
1702 |
.ig-es-switch {
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
}
|
1718 |
|
1719 |
.ig-es-switch:focus {
|
1720 |
-
|
1721 |
}
|
1722 |
|
1723 |
.ig-es-switch:before {
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
}
|
1738 |
|
1739 |
.ig-es-switch[data-ig-es-switch="active"] {
|
1740 |
-
|
1741 |
-
|
1742 |
}
|
1743 |
|
1744 |
.ig-es-switch[data-ig-es-switch="active"]:before {
|
1745 |
-
|
1746 |
-
|
1747 |
}
|
1748 |
|
1749 |
.ig-es-switch[data-ig-es-switch="inactive"] {
|
1750 |
-
|
1751 |
}
|
1752 |
|
1753 |
.ig-es-switch.ig-es-loading {
|
1754 |
-
|
1755 |
-
|
1756 |
}
|
1757 |
|
1758 |
.es-items-lists table.fixed,
|
1759 |
.post-type-es_template table.fixed {
|
1760 |
-
|
1761 |
}
|
1762 |
|
1763 |
/** Workflow CSS END */
|
1764 |
|
1765 |
.frappe-chart .x.axis .line-vertical,
|
1766 |
.frappe-chart .x.axis text {
|
1767 |
-
|
1768 |
}
|
1769 |
|
1770 |
/*
|
1771 |
.frappe-chart .y.axis .line-horizontal,
|
1772 |
.frappe-chart .y.axis text {
|
1773 |
-
|
1774 |
}
|
1775 |
*/
|
1776 |
|
1777 |
|
1778 |
li.menu-top div.wp-menu-image img {
|
1779 |
-
|
1780 |
-
|
1781 |
}
|
1782 |
|
1783 |
/** Broadcast New UI CSS */
|
1784 |
/* input[type="date"]::-webkit-inner-spin-button,
|
1785 |
input[type="date"]::-webkit-clear-button {
|
1786 |
-
|
1787 |
-
|
1788 |
} */
|
1789 |
|
1790 |
/*#progressbar {
|
1791 |
-
|
1792 |
}*/
|
1793 |
#progressbar li:before {
|
1794 |
/* content: counter(step);
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
}
|
1805 |
/* color change after active */
|
1806 |
#progressbar li.active{
|
1807 |
-
|
1808 |
}
|
1809 |
#progressbar li:hover {
|
1810 |
border-bottom: 2px solid rgb(90, 103,216, 0.5);
|
1811 |
}
|
1812 |
|
1813 |
#progressbar li.active span{
|
1814 |
-
|
1815 |
}
|
1816 |
|
1817 |
#preview_template, #spam_score_modal{
|
1818 |
-
|
1819 |
}
|
1820 |
|
1821 |
.broadcast_preview_container {
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
}
|
1826 |
|
1827 |
/* Broadcast status icons CSS */
|
1828 |
body.email-subscribers_page_es_campaigns .column-status .dashicons {
|
1829 |
-
|
1830 |
-
|
1831 |
}
|
1832 |
|
1833 |
body.email-subscribers_page_es_campaigns .column-status .dashicons[title="Finished"] {
|
1834 |
-
|
1835 |
}
|
1836 |
div.broadcast_main_content{
|
1837 |
-
|
1838 |
}
|
1839 |
|
1840 |
div.broadcast_side_content{
|
1841 |
-
|
1842 |
}
|
1843 |
#ig_es_post_notification_list_ids+.select2-container{
|
1844 |
-
|
1845 |
-
|
1846 |
}
|
1847 |
.es-preview.broadcast-preview p {
|
1848 |
-
|
1849 |
}
|
1850 |
|
1851 |
.es-preview.broadcast-preview img.aligncenter {
|
1852 |
-
|
1853 |
-
|
1854 |
}
|
1855 |
#es-shortcode{
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
}
|
1860 |
|
1861 |
/* Campaign report */
|
@@ -1868,12 +1868,12 @@ div.broadcast_side_content{
|
|
1868 |
filter: blur(0);
|
1869 |
}
|
1870 |
.campaign_open_blur{
|
1871 |
-
|
1872 |
-
|
1873 |
}
|
1874 |
|
1875 |
#browser_open_graph .chart-legend, #os_info_graph .chart-legend{
|
1876 |
-
|
1877 |
}
|
1878 |
|
1879 |
/* Campaign Report : end */
|
1 |
#menu-content-change:focus {
|
2 |
+
box-shadow: none;
|
3 |
+
color: #FFFFFF;
|
4 |
}
|
5 |
|
6 |
ul#menu-nav li.active {
|
7 |
+
background-color: #5a67d8;
|
8 |
}
|
9 |
|
10 |
#menu-nav li a.active {
|
11 |
+
color: #FFF;
|
12 |
}
|
13 |
|
14 |
.es-lists-table .column-created_at{
|
15 |
+
width:20%;
|
16 |
}
|
17 |
|
18 |
.es-lists-table .column-export{
|
19 |
+
width: 8%;
|
20 |
}
|
21 |
|
22 |
a:focus {
|
23 |
+
box-shadow: none;
|
24 |
}
|
25 |
|
26 |
#email_tabs_form div#es-settings-tabs {
|
27 |
+
margin-top: 20px;
|
28 |
+
padding: 0;
|
29 |
}
|
30 |
|
31 |
#email_tabs_form div#es-settings-tabs div#menu-tab-listing {
|
32 |
+
width: 20%;
|
33 |
+
float: left;
|
34 |
}
|
35 |
|
36 |
#email_tabs_form div#es-settings-tabs div#menu-tab-content {
|
37 |
+
width: 75%;
|
38 |
+
float: left;
|
39 |
}
|
40 |
|
41 |
#email_tabs_form div#es-settings-tabs div#menu-tab-listing ul {
|
42 |
+
width: 100%;
|
43 |
+
display: block;
|
44 |
+
background: #f3f6ff;
|
45 |
+
border: 0px;
|
46 |
+
padding: 0; /*min-height: 500px;*/
|
47 |
+
border-right: 1px solid #CCC;
|
48 |
+
border-left: 1px solid #CCC;
|
49 |
+
border-bottom: 1px solid #CCC;
|
50 |
}
|
51 |
|
52 |
#email_tabs_form div#es-settings-tabs div#menu-tab-listing ul li {
|
53 |
+
width: 100%;
|
54 |
+
display: block;
|
55 |
+
border-radius: 0px;
|
56 |
+
cursor: pointer;
|
57 |
+
margin: 0px;
|
58 |
+
border: 0px;
|
59 |
+
border-bottom: 1px solid #CCC;
|
60 |
}
|
61 |
|
62 |
#email_tabs_form div#es-settings-tabs div#menu-tab-listing ul li a {
|
63 |
+
padding: 20px 10px;
|
64 |
+
width: 90%;
|
65 |
+
font-size: 16px;
|
66 |
}
|
67 |
|
68 |
#email_tabs_form div#es-settings-tabs div#menu-tab-content h1 {
|
69 |
+
width: auto;
|
70 |
+
display: block;
|
71 |
+
border-bottom: 1px solid #CCC;
|
72 |
+
padding: 15px 20px;
|
73 |
}
|
74 |
|
75 |
#email_tabs_form div#es-settings-tabs div#menu-tab-content h2 {
|
76 |
+
border-bottom: 1px solid #CCC;
|
77 |
+
margin: 0px;
|
78 |
+
padding: 10px 0;
|
79 |
+
text-align: center;
|
80 |
}
|
81 |
|
82 |
|
83 |
.help-info-content {
|
84 |
+
background: #FFF;
|
85 |
+
padding: 10px;
|
86 |
+
width: 98%;
|
87 |
+
float: left;
|
88 |
+
margin-top: 10px;
|
89 |
+
/*border-radius: 10px;*/
|
90 |
+
box-shadow: 0 0 10px #CCC;
|
91 |
}
|
92 |
|
93 |
.help-info-content .left-blog {
|
94 |
+
width: 48%;
|
95 |
+
float: left;
|
96 |
+
padding: 10px;
|
97 |
}
|
98 |
|
99 |
.help-info-content .right-blog {
|
100 |
+
width: 48%;
|
101 |
+
float: right;
|
102 |
+
padding: 10px;
|
103 |
}
|
104 |
|
105 |
.help-info-content ul {
|
106 |
+
width: 90%;
|
107 |
+
margin-left: 20px;
|
108 |
+
list-style: unset;
|
109 |
}
|
110 |
|
111 |
.help-info-content ul li {
|
112 |
+
line-height: 22px;
|
113 |
}
|
114 |
|
115 |
.feature-section {
|
116 |
+
width: 98%;
|
117 |
+
padding: 10px;
|
118 |
+
background: #FFF;
|
119 |
+
float: left;
|
120 |
+
margin: 20px auto;
|
121 |
+
/*border-radius: 10px;*/
|
122 |
}
|
123 |
|
124 |
.feature-section .feature-blog {
|
125 |
+
width: 29%;
|
126 |
+
float: left;
|
127 |
+
vertical-align: top;
|
128 |
+
min-height: 200px;
|
129 |
+
padding: 10px;
|
130 |
+
background: #f1f1f1;
|
131 |
+
margin: 10px;
|
132 |
+
/*border-radius: 10px;*/
|
133 |
}
|
134 |
|
135 |
.feature-section .feature-blog ul {
|
136 |
+
list-style: unset;
|
137 |
+
width: 90%;
|
138 |
+
margin-left: 20px;
|
139 |
}
|
140 |
|
141 |
.feature-section .feature-blog ul li {
|
142 |
+
line-height: 20px;
|
143 |
+
margin: 10px 0;
|
144 |
}
|
145 |
|
146 |
.feature-section .feature-blog ul li a {
|
147 |
+
font-size: 14px;
|
148 |
+
font-weight: bold;
|
149 |
}
|
150 |
|
151 |
.feature-section .feature-blog h3 {
|
152 |
+
font-size: 18px;
|
153 |
+
font-weight: bold;
|
154 |
+
border-bottom: 1px solid #CCC;
|
155 |
+
padding: 10px;
|
156 |
+
margin: 0px;
|
157 |
}
|
158 |
|
159 |
.feature-blog-wrapper .feature-blog {
|
160 |
+
float: inherit;
|
161 |
+
display: inline-block;
|
162 |
+
width: 35%;
|
163 |
}
|
164 |
|
165 |
.feature-blog-wrapper {
|
166 |
+
text-align: center;
|
167 |
}
|
168 |
|
169 |
.feature-section .feature-header {
|
170 |
+
width: 100%;
|
171 |
+
text-align: center;
|
172 |
}
|
173 |
|
174 |
.feature-section .feature-header h2 {
|
175 |
+
font-size: 28px;
|
176 |
+
border-bottom: 1px solid #CCC;
|
177 |
+
margin: 0px;
|
178 |
+
padding: 20px 0;
|
179 |
+
margin-bottom: 10px;
|
180 |
}
|
181 |
|
182 |
.feature-section.feature-section-last h3 {
|
183 |
+
line-height: 20px;
|
184 |
+
text-align: center;
|
185 |
}
|
186 |
|
187 |
.feature-section.feature-section-last img {
|
188 |
+
width: 90%;
|
189 |
+
padding: 10px;
|
190 |
+
border: 1px solid #CCC;
|
191 |
+
margin: 10px 0;
|
192 |
+
background: #000;
|
193 |
}
|
194 |
|
195 |
.feature-section.feature-section-last p {
|
196 |
+
font-size: 14px;
|
197 |
+
line-height: 22px;
|
198 |
}
|
199 |
|
200 |
/*.email-subscribers_page_es_settings input[type=text], .email-subscribers_page_es_settings input[type=password], .email-subscribers_page_es_settings input[type=email], .email-subscribers_page_es_settings textarea, #list_description, .email-subscribers_page_es_settings select {
|
201 |
+
width: 70%;
|
202 |
}
|
203 |
*/
|
204 |
.tablenav-pages span.paging-input {
|
205 |
+
width: auto;
|
206 |
+
display: inline-block;
|
207 |
}
|
208 |
|
209 |
div#post-body-content {
|
210 |
+
width: 100%;
|
211 |
+
float: left;
|
212 |
}
|
213 |
|
214 |
div#post-body-content .meta-box-sortables .row-blog {
|
215 |
+
padding: 10px 0;
|
216 |
}
|
217 |
|
218 |
div#post-body-content .meta-box-sortables .row-blog label {
|
219 |
+
margin-right: 10px;
|
220 |
+
display: inline-block;
|
221 |
+
width: 10%;
|
222 |
+
font-weight: bold;
|
223 |
}
|
224 |
|
225 |
div#post-body-content .meta-box-sortables .row-blog input[type="text"], div#post-body-content .meta-box-sortables .row-blog input[type="email"], div#post-body-content .meta-box-sortables .row-blog select {
|
226 |
+
width: 30%;
|
227 |
+
height: 35px;
|
228 |
}
|
229 |
|
230 |
|
231 |
div#post-body-content .meta-box-sortables .row-blog p.submit input#submit {
|
232 |
+
width: auto;
|
233 |
+
height: auto;
|
234 |
}
|
235 |
|
236 |
.blog-content {
|
237 |
+
width: 100%;
|
238 |
}
|
239 |
|
240 |
.blog-content .blog-row {
|
241 |
+
padding: 10px 0;
|
242 |
}
|
243 |
|
244 |
.blog-content .blog-row p {
|
245 |
+
width: 10%;
|
246 |
+
display: inline-block;
|
247 |
+
margin: 0px;
|
248 |
}
|
249 |
|
250 |
.blog-content .blog-row input, .blog-content .blog-row select {
|
251 |
+
height: 35px;
|
252 |
+
line-height: 35px;
|
253 |
+
width: 35%;
|
254 |
}
|
255 |
|
256 |
.blog-content .blog-row.blog-row-submit input#submit {
|
257 |
+
width: 100%;
|
258 |
}
|
259 |
|
260 |
.email-subscribers_page_es_newsletters table.form-table td select,
|
261 |
.email-subscribers_page_es_notifications table.form-table td select,
|
262 |
.email-subscribers_page_es_newsletters table.form-table input[type="text"],
|
263 |
.email-subscribers_page_es_notifications table.form-table input[type="text"] {
|
264 |
+
width: 35%;
|
265 |
}
|
266 |
|
267 |
/* Customize Admin Settings */
|
268 |
|
269 |
.ig-settings-form .ui-state-active, .ig-settings-form .ui-widget-content .ui-state-active, .ig-settings-form .ui-widget-header .ui-state-active, .ig-settings-form a.ui-button:active, .ig-settings-form .ui-button:active, .ig-settings-form .ui-button.ui-state-active:hover {
|
270 |
+
background: #ffffff !important;
|
271 |
+
font-weight: normal;
|
272 |
+
color: #000 !important;
|
273 |
}
|
274 |
|
275 |
.ig-settings-form .ui-state-active a, .ig-settings-form .ui-state-active a:link, .ig-settings-form .ui-state-active a:visited {
|
276 |
+
color: #000 !important;
|
277 |
}
|
278 |
|
279 |
.content.save {
|
280 |
+
float: right;
|
281 |
}
|
282 |
|
283 |
.es-settings-submit-btn {
|
284 |
+
float: left;
|
285 |
}
|
286 |
|
287 |
.email-subscribers_page_es_subscribers .es-settings-submit-btn .button {
|
288 |
+
background-color: #3ad01e;
|
289 |
}
|
290 |
|
291 |
#email_tabs_form div#es-settings-tabs {
|
292 |
+
clear: both;
|
293 |
}
|
294 |
|
295 |
#email_tabs_form div#es-settings-tabs div#menu-tab-content h1 {
|
296 |
+
padding: 14px;
|
297 |
}
|
298 |
|
299 |
.esbghead {
|
300 |
+
/*background-image: url(https://multiratingpro.com/wp-content/uploads/2016/05/bg-9-full.jpg);*/
|
301 |
+
background: #4f85a1;
|
302 |
+
padding: 50px;
|
303 |
}
|
304 |
|
305 |
.esbghead h1 {
|
306 |
+
color: #fff !important;
|
307 |
+
font-weight: bold;
|
308 |
}
|
309 |
|
310 |
.ui-tabs-panel h2 {
|
311 |
+
background: white;
|
312 |
+
color: black;
|
313 |
+
font-size: 20px;
|
314 |
}
|
315 |
|
316 |
.essettings input#submit, .email-subscribers_page_es_subscribers input#submit {
|
317 |
+
background: #0085ba;
|
318 |
+
border-color: #0085ba;
|
319 |
+
box-shadow: 0 1px 0 #0085ba;
|
320 |
+
color: #fff;
|
321 |
+
text-decoration: none;
|
322 |
+
text-shadow: 0 -1px 1px #0085ba, 1px 0 1px #0085ba, 0 1px 1px #0085ba, -1px 0 1px #0085ba;
|
323 |
}
|
324 |
|
325 |
p.search-box.box-ma10 {
|
326 |
+
margin: 0 5px;
|
327 |
}
|
328 |
|
329 |
.esbgheader {
|
330 |
+
background-image: url('../images/bg3.png');
|
331 |
+
/*background: #008cdd;*/
|
332 |
+
padding: 50px;
|
333 |
+
background-repeat: no-repeat;
|
334 |
+
background-size: cover;
|
335 |
+
background-position: center center;
|
336 |
}
|
337 |
|
338 |
.esbgheader h1 {
|
339 |
+
color: #fff !important;
|
340 |
+
font-weight: bold;
|
341 |
}
|
342 |
|
343 |
.headerpart {
|
344 |
+
margin: 10px 20px 0 2px;
|
345 |
}
|
346 |
|
347 |
.select2-container {
|
348 |
+
margin: 0 2px 0 2px;
|
349 |
}
|
350 |
|
351 |
.tablenav.top #doaction, #doaction2, #post-query-submit {
|
352 |
+
margin: 0px 4px 0 4px;
|
353 |
}
|
354 |
|
355 |
.leftside, .rightside {
|
356 |
+
float: left;
|
357 |
+
width: 10%;
|
358 |
+
margin: 20px 0;
|
359 |
}
|
360 |
|
361 |
.leftside p.submit, .rightside p.submit {
|
362 |
+
padding: 0 !important;
|
363 |
+
margin: 0 !important;
|
364 |
}
|
365 |
|
366 |
/* Admin Settings */
|
367 |
|
368 |
/*.email-subscribers_page_es_settings #wpwrap {
|
369 |
+
background-color: white;
|
370 |
+
}*/
|
371 |
|
372 |
.form-table .helper {
|
373 |
+
font-style: italic;
|
374 |
+
font-weight: 100;
|
375 |
+
font-size: 12px;
|
376 |
+
color: #9398a7;
|
377 |
}
|
378 |
|
379 |
.form-table .es_sub_headline {
|
380 |
+
margin-bottom: 0.5em;
|
381 |
+
font-size: 12px;
|
382 |
}
|
383 |
|
384 |
#menu-tab-listing .ig-menu-tab.ui-tabs-active.ui-state-active.ui-tabs-active {
|
385 |
+
background-color: white;
|
386 |
}
|
387 |
|
388 |
#menu-tab-listing .ui-state-default {
|
389 |
+
background: #f3f6ff;
|
390 |
}
|
391 |
|
392 |
.es-settings-submit-btn {
|
393 |
+
float: left;
|
394 |
}
|
395 |
|
396 |
.es-cta {
|
397 |
+
font-size: 1.2em;
|
398 |
+
font-weight: bold;
|
399 |
}
|
400 |
|
401 |
.wrap .page-title-action.es-imp-button:hover {
|
402 |
+
color: #FFFFFF;
|
403 |
+
background-color: #03a025;
|
404 |
}
|
405 |
|
406 |
.page-title-action.es-imp-button {
|
407 |
+
background-color: #03a025;
|
408 |
+
color: #FFFFFF;
|
409 |
}
|
410 |
|
411 |
.wrap .page-title-action.es-main-button:hover {
|
412 |
+
color: #FFFFFF;
|
413 |
+
background-color: #5850ec;
|
414 |
}
|
415 |
|
416 |
.page-title-action.es-main-button {
|
417 |
+
background-color: #5850ec;
|
418 |
+
color: #FFFFFF;
|
419 |
}
|
420 |
|
421 |
.es-contact-form {
|
422 |
+
width: 70%;
|
423 |
}
|
424 |
|
425 |
.es-contact-form .form-table td {
|
426 |
+
line-height: 1.3em;
|
427 |
}
|
428 |
|
429 |
.es-note-child-category td {
|
430 |
+
padding-left: 2em;
|
431 |
}
|
432 |
|
433 |
/**** Dashboard : start ***/
|
434 |
.toplevel_page_es_dashboard .about-header {
|
435 |
+
margin-top: 2em;
|
436 |
}
|
437 |
|
438 |
.wrap.about-wrap {
|
439 |
+
background-color: transparent;
|
440 |
+
position: relative;
|
441 |
+
margin: 25px 40px 0 20px;
|
442 |
+
box-shadow: none;
|
443 |
+
-webkit-box-shadow: none;
|
444 |
}
|
445 |
|
446 |
.about-wrap.es {
|
447 |
+
max-width: 100%
|
448 |
}
|
449 |
|
450 |
.about-header .wrap .button-hero, .button-main {
|
451 |
+
color: #FFFFFF !important;
|
452 |
+
border-color: #03a025 !important;
|
453 |
+
background: #03a025 !important;
|
454 |
+
box-shadow: 0 1px 0 #03a025;
|
455 |
+
font-weight: bold;
|
456 |
+
height: 3em;
|
457 |
+
line-height: 1em;
|
458 |
}
|
459 |
|
460 |
.about-header .wrap .button-hero:hover, .button-main {
|
461 |
+
color: #FFF !important;
|
462 |
+
background: #0AAB2E !important;
|
463 |
+
border-color: #0AAB2E !important;
|
464 |
}
|
465 |
|
466 |
.about-header {
|
467 |
+
background-color: #FFF;
|
468 |
+
padding: 2em 1.5em;
|
469 |
+
-webkit-box-shadow: 0 0 7px 0 rgba(0, 0, 0, .2);
|
470 |
+
box-shadow: 0 0 7px 0 rgba(0, 0, 0, .2);
|
471 |
}
|
472 |
|
473 |
/*.form-table th {
|
474 |
+
width: 350px !important;
|
475 |
+
}*/
|
476 |
|
477 |
.es-ltr {
|
478 |
+
width: 20em;
|
479 |
+
height: 2em;
|
480 |
+
margin-bottom: 10px;
|
481 |
+
padding: 1.4em;
|
482 |
}
|
483 |
|
484 |
.es-about-text {
|
485 |
+
/*margin-bottom: 2em;*/
|
486 |
+
font-size: 1em;
|
487 |
+
/*padding-top: 0.5em;*/
|
488 |
}
|
489 |
|
490 |
.es-notify-about-new-post-1 {
|
491 |
+
margin-top: 1em;
|
492 |
+
margin-right: 13em;
|
493 |
+
margin-bottom: 0.3em;
|
494 |
+
font-size: 1.1em;
|
495 |
}
|
496 |
|
497 |
.es-notify-about-new-post-2 {
|
498 |
+
margin-right: 13em;
|
499 |
+
font-size: 1em;
|
500 |
+
color: gray;
|
501 |
}
|
502 |
|
503 |
.wrap.about-wrap h1 {
|
504 |
+
font-size: 2.5em;
|
505 |
+
line-height: 0.9em;
|
506 |
}
|
507 |
|
508 |
.feature-section.col > div {
|
509 |
+
position: relative;
|
510 |
+
width: 29.95%;
|
511 |
+
margin-right: 4.999999999%;
|
512 |
+
float: left
|
513 |
}
|
514 |
|
515 |
.feature-section.col.two-col > div {
|
516 |
+
width: 45.95%
|
517 |
}
|
518 |
|
519 |
.feature-section.col img {
|
520 |
+
width: 150px;
|
521 |
+
border: none;
|
522 |
}
|
523 |
|
524 |
.feature-section.col p {
|
525 |
+
margin-bottom: 1.5em
|
526 |
}
|
527 |
|
528 |
.about-wrap .feature-section h4 {
|
529 |
+
margin-top: .4em
|
530 |
}
|
531 |
|
532 |
.about-wrap.es .feature-section {
|
533 |
+
display: block !important
|
534 |
}
|
535 |
|
536 |
|
537 |
.about-wrap [class$=col] .last-feature {
|
538 |
+
margin-right: 0
|
539 |
}
|
540 |
|
541 |
.es-support {
|
542 |
+
color: #000;
|
543 |
+
margin: 178px 0 0;
|
544 |
+
height: 10px;
|
545 |
+
width: 180px;
|
546 |
+
text-rendering: optimizeLegibility;
|
547 |
+
text-align: right;
|
548 |
+
right: 0;
|
549 |
+
margin-top: 9em;
|
550 |
+
padding-right: 1em;
|
551 |
}
|
552 |
|
553 |
.es-contact-us {
|
554 |
+
font-size: 20px;
|
555 |
+
line-height: 1.5em;
|
556 |
+
font-weight: 800;
|
557 |
+
margin-right: 20px;
|
558 |
}
|
559 |
|
560 |
.es-contact-us a {
|
561 |
+
color: #E1564B;
|
562 |
}
|
563 |
|
564 |
.es-donate-link {
|
565 |
+
text-align: right;
|
566 |
+
font-size: 0.8em;
|
567 |
+
margin-top: 1em;
|
568 |
}
|
569 |
|
570 |
.es-esaf-integration {
|
571 |
+
width: 75% !important;
|
572 |
}
|
573 |
|
574 |
.es-ig-integration {
|
575 |
+
width: 100% !important;
|
576 |
}
|
577 |
|
578 |
.es-rm-integration {
|
579 |
+
width: 79% !important;
|
580 |
}
|
581 |
|
582 |
.es-integration-guide {
|
583 |
+
text-align: justify;
|
584 |
}
|
585 |
|
586 |
.es_feature, .es_summary {
|
587 |
+
line-height: 1.7em !important;
|
588 |
}
|
589 |
|
590 |
.es_summary {
|
591 |
+
margin-left: 0em !important;
|
592 |
}
|
593 |
|
594 |
.es_feature_list, .es_faq_list {
|
595 |
+
list-style-type: disc;
|
596 |
+
margin-left: 1.5em !important;
|
597 |
}
|
598 |
|
599 |
.es_faq {
|
600 |
+
margin-bottom: 1em;
|
601 |
+
font-weight: 700;
|
602 |
}
|
603 |
|
604 |
.form-table td.es-optin-headline {
|
605 |
+
color: red;
|
606 |
+
/*text-align: center;*/
|
607 |
+
font-weight: bold;
|
608 |
+
font-size: 24px;
|
609 |
}
|
610 |
|
611 |
.form-table td.es-emm-image {
|
612 |
+
padding: 15px 10px;
|
613 |
+
width: 30%;
|
614 |
+
text-align: center;
|
615 |
}
|
616 |
|
617 |
.form-table td.es-emm-text {
|
618 |
+
padding: 15px 10px;
|
619 |
+
width: 50%;
|
620 |
}
|
621 |
|
622 |
.form-table td.es-emm-optin {
|
623 |
+
/*padding: 15px 10px;*/
|
624 |
+
/*width: 20%;*/
|
625 |
+
padding: 1em;
|
626 |
}
|
627 |
|
628 |
.form-table td.es-emm-optin form[name="klawoo_subscribe"] {
|
629 |
+
margin-right: 1px;
|
630 |
}
|
631 |
|
632 |
#klawoo_response {
|
633 |
+
/*background-color: yellow;*/
|
634 |
}
|
635 |
|
636 |
.es-about-line {
|
637 |
+
width: 85%;
|
638 |
+
font-size: 14px;
|
639 |
+
line-height: 1.8em;
|
640 |
}
|
641 |
|
642 |
.es-help-wrap {
|
643 |
+
border-top: 1px dotted #CCC;
|
644 |
}
|
645 |
|
646 |
.subscribe-form {
|
647 |
+
margin-top: 2em;
|
648 |
}
|
649 |
|
650 |
.subscribe-form li {
|
651 |
+
list-style: disc;
|
652 |
+
list-style-position: inside;
|
653 |
}
|
654 |
|
655 |
.es-upper {
|
656 |
+
display: flex;
|
657 |
}
|
658 |
|
659 |
.es-upper .es-info {
|
660 |
+
width: 66%;
|
661 |
+
padding-right: 3em;
|
662 |
+
border-right: 1px solid #f7f7f7;
|
663 |
+
margin-left: 1.2em;
|
664 |
}
|
665 |
|
666 |
.es-info img {
|
667 |
+
vertical-align: bottom;
|
668 |
}
|
669 |
|
670 |
.es-lower {
|
671 |
+
margin-top: 1.5em;
|
672 |
|
673 |
}
|
674 |
|
675 |
.es-quick-links-wrapper {
|
676 |
+
margin-top: 2em;
|
677 |
+
margin-bottom: 1em;
|
678 |
}
|
679 |
|
680 |
li.es-quick-links {
|
681 |
+
margin: 0.5em 1em;
|
682 |
+
font-size: 1.3em;
|
683 |
+
/* font-weight: 800; */
|
684 |
+
list-style: none;
|
685 |
}
|
686 |
|
687 |
.es-quick-links a {
|
688 |
+
color: #008cdd;
|
689 |
}
|
690 |
|
691 |
.button-main {
|
692 |
+
color: #FFFFFF !important;
|
693 |
+
border-color: #03a025 !important;
|
694 |
+
background: #03a025 !important;
|
695 |
+
box-shadow: 0 1px 0 #03a025;
|
696 |
+
font-weight: bold;
|
697 |
+
height: 3em !important;
|
698 |
+
line-height: 3em !important;
|
699 |
+
margin: 1em auto !important;
|
700 |
}
|
701 |
|
702 |
.es-right {
|
703 |
+
margin-left: 2em;
|
704 |
}
|
705 |
|
706 |
.es-doc-links {
|
707 |
+
font-size: 1.2em;
|
708 |
+
/*font-weight: bold;*/
|
709 |
}
|
710 |
|
711 |
.about-header .es-version {
|
712 |
+
/*position: absolute;*/
|
713 |
+
top: 0;
|
714 |
+
right: 0;
|
715 |
+
/*text-align: center;*/
|
716 |
+
padding: 10px;
|
717 |
}
|
718 |
|
719 |
h5.es-badge {
|
720 |
+
margin: 0px;
|
721 |
+
/*color: #E1564B;*/
|
722 |
+
font-size: 12px;
|
723 |
+
/*text-align: right;*/
|
724 |
+
font-weight: 600;
|
725 |
}
|
726 |
|
727 |
.about-header .es-version h3 {
|
728 |
+
margin: 10px 0;
|
729 |
+
color: #333;
|
730 |
+
display: inline;
|
731 |
}
|
732 |
|
733 |
.about-header .es-version a {
|
734 |
+
color: #E1564B;
|
735 |
+
text-decoration: none;
|
736 |
+
font-size: 20px;
|
737 |
+
font-weight: bold;
|
738 |
}
|
739 |
|
740 |
.about-header {
|
741 |
+
background: #FFF;
|
742 |
+
border-radius: 5px;
|
743 |
+
padding: 10px;
|
744 |
+
width: 98%;
|
745 |
+
position: relative;
|
746 |
+
box-shadow: 0 0 10px #CCC;
|
747 |
}
|
748 |
|
749 |
.about-header h2 {
|
750 |
+
font-size: 1.9em;
|
751 |
+
margin: 20px 0 10px 0;
|
752 |
+
display: inline-block;
|
753 |
+
color: #008cdd;
|
754 |
}
|
755 |
|
756 |
.about-header .es-about-text {
|
757 |
+
font-size: 1.5em;
|
758 |
+
line-height: 1.6em;
|
759 |
+
margin-top: 0.5em;
|
760 |
+
color: #008cdd;
|
761 |
}
|
762 |
|
763 |
.about-header .es-notify-about-new-post-1 {
|
764 |
+
margin: 10px 0;
|
765 |
+
font-size: 18px;
|
766 |
}
|
767 |
|
768 |
.about-header ul {
|
769 |
+
width: 100%;
|
770 |
+
font-size: 14px;
|
771 |
+
margin: 10px 0;
|
772 |
+
/*color: #808080;*/
|
773 |
+
font-weight: normal;
|
774 |
}
|
775 |
|
776 |
.about-header ul li {
|
777 |
+
margin: 15px 0;
|
778 |
}
|
779 |
|
780 |
.about-header .wrap.klawoo-form {
|
781 |
+
border-top: 1px dotted #CCC;
|
782 |
+
/*width: 40%;*/
|
783 |
+
/*margin-left: 2.5em;*/
|
784 |
+
padding: 1em;
|
785 |
+
background: #daecfb;
|
786 |
}
|
787 |
|
788 |
.about-header .wrap.klawoo-form td.es-optin-headline, .es-right-headline {
|
789 |
+
color: #008cdd;
|
790 |
+
/*text-align: center;*/
|
791 |
+
font-weight: bold;
|
792 |
+
font-size: 24px;
|
793 |
+
padding: 0;
|
794 |
}
|
795 |
|
796 |
.about-header .wrap.klawoo-form td.es-emm-text {
|
797 |
+
margin: 0px;
|
798 |
+
padding-left: 0.5em;
|
799 |
}
|
800 |
|
801 |
.about-header .wrap.klawoo-form td.es-emm-image img {
|
802 |
+
width: 100%;
|
803 |
}
|
804 |
|
805 |
@media only screen and (max-width: 1362px) {
|
806 |
+
.es-info h2 {
|
807 |
+
font-size: 1.5em;
|
808 |
+
}
|
809 |
|
810 |
+
.es-info .es-about-line {
|
811 |
+
line-height: 1.4em;
|
812 |
+
}
|
813 |
|
814 |
+
.es-info .es-about-text {
|
815 |
+
font-size: 1.5em;
|
816 |
+
}
|
817 |
|
818 |
+
/* Force table to not be like tables anymore */
|
819 |
+
.klawoo-form table.form-table, .klawoo-form .form-table thead, .klawoo-form .form-table tbody, .klawoo-form .form-table th, .klawoo-form .form-table td, .klawoo-form .form-table tr {
|
820 |
+
display: block;
|
821 |
+
}
|
822 |
|
823 |
+
.klawoo-form .form-table td.es-emm-text {
|
824 |
+
width: 100%;
|
825 |
+
}
|
826 |
}
|
827 |
|
828 |
.es-facebook.column {
|
829 |
+
padding: 0.5em;
|
830 |
+
/*border: 1px solid rgba(0, 0, 0, 0.1);*/
|
831 |
+
/*text-align: center;*/
|
832 |
+
color: rgba(0, 0, 0, 0.75);
|
833 |
+
margin: 2em auto;
|
834 |
+
/*border: 5px double #e0e0e0;*/
|
835 |
+
background: rgba(255, 249, 233, 0.75);
|
836 |
}
|
837 |
|
838 |
.es-facebook.column strong {
|
839 |
+
font-size: 1.2em;
|
840 |
+
color: #008cdd;
|
841 |
}
|
842 |
|
843 |
.es-facebook.column i.dashicons-facebook {
|
844 |
+
font-size: 5em;
|
845 |
+
line-height: 0.6em;
|
846 |
+
color: #28487D;
|
847 |
+
margin: 0.2em 0;
|
848 |
}
|
849 |
|
850 |
|
851 |
/**** Dashboard : end ***/
|
852 |
|
853 |
.es_list_contact_status:before {
|
854 |
+
content: " \2219 ";
|
855 |
+
font-size: 4em;
|
856 |
+
vertical-align: text-bottom;
|
857 |
}
|
858 |
|
859 |
.subscribed.es_list_contact_status:before {
|
860 |
+
color: #009e00;
|
861 |
}
|
862 |
|
863 |
.unsubscribed.es_list_contact_status:before {
|
864 |
+
color: #d40303;
|
865 |
}
|
866 |
|
867 |
.unconfirmed.es_list_contact_status:before {
|
868 |
+
color: #e6cc14;
|
869 |
}
|
870 |
|
871 |
.ig-es-process-queue {
|
872 |
+
float: right;
|
873 |
+
margin: 18px 0 3px;
|
874 |
}
|
875 |
|
876 |
.ig-es-process-queue .page-title-action {
|
877 |
+
font-size: 16px;
|
878 |
}
|
879 |
|
880 |
.ig-es-process-queue .es-helper {
|
881 |
+
margin: 3em;
|
882 |
}
|
883 |
|
884 |
.email-subscribers_page_es_settings .ui-widget {
|
885 |
+
font-family: Roboto, Arial, Helvetica, sans-serif;
|
886 |
+
font-size: 1em;
|
887 |
}
|
888 |
|
889 |
.email-subscribers_page_es_settings .ui-widget input,
|
890 |
.email-subscribers_page_es_settings .ui-widget select,
|
891 |
.email-subscribers_page_es_settings .ui-widget textarea,
|
892 |
.email-subscribers_page_es_settings .ui-widget button {
|
893 |
+
font-family: Roboto, Arial, Helvetica, sans-serif;
|
894 |
+
font-size: 1em;
|
895 |
}
|
896 |
|
897 |
.es-icon {
|
898 |
+
font-family: "dashicons";
|
899 |
}
|
900 |
|
901 |
.es-send-success:before {
|
902 |
+
content: "\f147";
|
903 |
+
color: green;
|
904 |
+
font-size: 2em;
|
905 |
+
vertical-align: middle;
|
906 |
}
|
907 |
|
908 |
.es-send-error:before {
|
909 |
+
content: "\f158";
|
910 |
+
color: #ff3535;
|
911 |
+
font-size: 2em;
|
912 |
+
vertical-align: middle;
|
913 |
}
|
914 |
|
915 |
|
916 |
@media only screen and (max-width: 1362px) {
|
917 |
|
918 |
+
.es_list_contact_status:before {
|
919 |
+
font-size: 20px;
|
920 |
+
}
|
921 |
|
922 |
}
|
923 |
|
924 |
.es-fire-sale {
|
925 |
+
animation: beat .25s infinite alternate;
|
926 |
+
transform-origin: center;
|
927 |
+
color: #ea7b00;
|
928 |
+
display: inline-block;
|
929 |
+
font-size: 1.5em;
|
930 |
}
|
931 |
|
932 |
@keyframes beat {
|
933 |
+
to {
|
934 |
+
transform: scale(1.1);
|
935 |
+
}
|
936 |
}
|
937 |
|
938 |
#es-test-email {
|
939 |
+
width: 60%;
|
940 |
+
margin-right: 0.7em;
|
941 |
}
|
942 |
|
943 |
.es_spinner_image_admin img {
|
944 |
+
height: 20px;
|
945 |
+
margin-left: 0.3em;
|
946 |
+
vertical-align: middle;
|
947 |
}
|
948 |
|
949 |
.es-upsale-image img {
|
950 |
+
/*margin-left: -16em;*/
|
951 |
}
|
952 |
|
953 |
.es-smtp-image img {
|
954 |
+
margin-left: -1em;
|
955 |
+
margin-top: 0.8em;
|
956 |
}
|
957 |
|
958 |
.es-smtp-label {
|
959 |
+
margin-left: -0.6em;
|
960 |
}
|
961 |
|
962 |
/*onboarding css */
|
963 |
#slider-wrapper {
|
964 |
+
background: #fff;
|
965 |
+
border-radius: 7px;
|
966 |
+
-webkit-box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
|
967 |
+
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
|
968 |
+
-webkit-box-sizing: border-box;
|
969 |
+
box-sizing: border-box;
|
970 |
+
color: #444;
|
971 |
+
display: block;
|
972 |
+
margin: 1.5em auto 0;
|
973 |
+
max-width: 50em;
|
974 |
+
overflow: hidden;
|
975 |
+
padding: 2em 3em;
|
976 |
+
height: 50em;
|
977 |
+
/*-webkit-transform: translate(0%,45%);*/
|
978 |
+
-webkit-transform: translate(0%, 7vw);
|
979 |
+
transform: translate(0%, 7vw);
|
980 |
+
/*top: 50%;
|
981 |
+
left: 50%;*/
|
982 |
}
|
983 |
|
984 |
.sp {
|
985 |
+
background: #FFF;
|
986 |
+
height: 22em;
|
987 |
+
position: absolute;
|
988 |
+
font-size: 1.1em;
|
989 |
+
line-height: 2em;
|
990 |
+
width: 40em;
|
991 |
}
|
992 |
|
993 |
.es-footer {
|
994 |
+
float: right;
|
995 |
+
margin-top: 75%;
|
996 |
+
/*font-weight: bold;*/
|
997 |
+
font-size: 1.2em;
|
998 |
+
cursor: pointer;
|
999 |
+
/*text-decoration: underline;*/
|
1000 |
}
|
1001 |
|
1002 |
a.button-send, .es-error-actions .es-dashboard-btn {
|
1003 |
+
text-decoration: none !important;
|
1004 |
+
color: #387bff;
|
1005 |
+
/* font-size: 1.1em; */
|
1006 |
+
font-weight: 500;
|
1007 |
+
padding: 0.50em 0.55em;
|
1008 |
+
border-radius: 3px;
|
1009 |
+
transition: background-color 0.5s;
|
1010 |
+
cursor: pointer;
|
1011 |
}
|
1012 |
|
1013 |
a.button-send:hover, .es-error-actions .es-dashboard-btn:hover {
|
1014 |
+
background-color: #387bff !important;
|
1015 |
+
color: white !important;
|
1016 |
}
|
1017 |
|
1018 |
/*.es-send-email-screen img.es-loader {
|
1019 |
+
display: inline-block;
|
1020 |
+
vertical-align: middle;
|
1021 |
+
margin-right: 1em;
|
1022 |
}*/
|
1023 |
|
1024 |
.sp input[type="email"].error {
|
1025 |
+
border: 1px solid red;
|
1026 |
}
|
1027 |
|
1028 |
.es-error-actions {
|
1029 |
+
text-align: center;
|
1030 |
+
margin-top: 3em;
|
1031 |
}
|
1032 |
|
1033 |
.es-error-actions .es-dashboard-btn {
|
1035 |
}
|
1036 |
|
1037 |
.es-error-actions .button-hero {
|
1038 |
+
width: 46% !important;
|
1039 |
}
|
1040 |
|
1041 |
.sp h1 {
|
1042 |
+
text-align: center;
|
1043 |
+
color: #387bff;
|
1044 |
+
line-height: 1.3em;
|
1045 |
}
|
1046 |
|
1047 |
.sp .es-ltr {
|
1048 |
+
padding: 1em;
|
1049 |
}
|
1050 |
|
1051 |
.sp .button-hero {
|
1052 |
+
color: #FFFFFF !important;
|
1053 |
+
border-color: #03a025 !important;
|
1054 |
+
background: #03a025 !important;
|
1055 |
+
box-shadow: 0 1px 0 #03a025;
|
1056 |
+
font-weight: bold;
|
1057 |
+
height: 3em;
|
1058 |
+
line-height: 1em;
|
1059 |
|
1060 |
}
|
1061 |
|
1062 |
.sp .es-actions {
|
1063 |
+
margin: 30px auto;
|
1064 |
+
display: block;
|
1065 |
+
text-align: center;
|
1066 |
+
width: 45%;
|
1067 |
+
padding-top: 2em;
|
1068 |
}
|
1069 |
|
1070 |
.sp form[name=klawoo_subscribe] {
|
1071 |
+
margin-right: 2em;
|
1072 |
}
|
1073 |
|
1074 |
.sp .dashicons {
|
1075 |
+
vertical-align: middle;
|
1076 |
+
color: #44ad69;
|
1077 |
+
margin-right: 0.3em;
|
1078 |
}
|
1079 |
|
1080 |
.sp form[name=klawoo_subscribe] input[type="email"], .sp form[name=klawoo_subscribe] input[type="text"] {
|
1081 |
+
width: 320px;
|
1082 |
+
padding: 1.25em 1em;
|
1083 |
}
|
1084 |
|
1085 |
|
1086 |
#es-send-email-form input[type="email"] {
|
1087 |
+
width: 18em;
|
1088 |
+
padding: 0.4em 0.5em;
|
1089 |
+
border: none;
|
1090 |
+
box-shadow: none;
|
1091 |
+
border-bottom: 1px solid gray;
|
1092 |
}
|
1093 |
|
1094 |
.es-form-wrapper {
|
1095 |
+
padding: 0.5em 0.8em;
|
1096 |
+
background-color: #f9f9f9;
|
1097 |
+
border-radius: 3px;
|
1098 |
}
|
1099 |
|
1100 |
.es-send-email-screen .es-form-wrapper form {
|
1101 |
+
margin-top: 0.8em;
|
1102 |
}
|
1103 |
|
1104 |
.sp.es-receive-error li {
|
1105 |
+
margin-bottom: 0;
|
1106 |
}
|
1107 |
|
1108 |
.es-email-sending-error {
|
1109 |
+
line-height: 1em;
|
1110 |
+
padding: 1em;
|
1111 |
}
|
1112 |
|
1113 |
.es-error form.es-onboarding {
|
1114 |
+
margin-top: 1em;
|
1115 |
}
|
1116 |
|
1117 |
.sp .es-gray {
|
1118 |
+
color: #737373;
|
1119 |
+
line-height: 1.75;
|
1120 |
}
|
1121 |
|
1122 |
.sp .es-skip {
|
1123 |
+
cursor: pointer;
|
1124 |
}
|
1125 |
|
1126 |
/* onboarding :end */
|
1127 |
|
1128 |
.ig-es-indicator {
|
1129 |
+
text-align: center;
|
1130 |
+
z-index: 26;
|
1131 |
+
font-size: 0.8em;
|
1132 |
+
margin-left: 0.3em;
|
1133 |
+
padding: 2px;
|
1134 |
+
background: #e66060;
|
1135 |
+
color: #fff;
|
1136 |
+
border-radius: 2px;
|
1137 |
}
|
1138 |
|
1139 |
.ig-es-success-indicator {
|
1140 |
+
background-color: #008000;
|
1141 |
}
|
1142 |
|
1143 |
.ig-es-indicator-new {
|
1144 |
+
background-color: #e66060;
|
1145 |
}
|
1146 |
|
1147 |
/* Information Box CSS */
|
1148 |
div.ig-es-information-box {
|
1149 |
+
padding: 4px 12px;
|
1150 |
+
margin-top: 25px;
|
1151 |
+
margin-bottom: 25px;
|
1152 |
+
border-radius: 10px;
|
1153 |
}
|
1154 |
|
1155 |
div.ig-es-center {
|
1156 |
+
margin-left: auto;
|
1157 |
+
margin-right: auto;
|
1158 |
+
width: 50%;
|
1159 |
}
|
1160 |
|
1161 |
div.ig-es-box-shadow {
|
1162 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
|
1163 |
+
-moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
|
1164 |
+
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
|
1165 |
+
-o-box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
|
1166 |
+
border-left: 0px;
|
1167 |
}
|
1168 |
|
1169 |
.ig-es-success {
|
1170 |
+
background-color: #ddffdd;
|
1171 |
+
border-left: 6px solid #4CAF50;
|
1172 |
}
|
1173 |
|
1174 |
.ig-es-danger {
|
1175 |
+
background-color: #ffdddd;
|
1176 |
+
border-left: 6px solid #f44336;
|
1177 |
}
|
1178 |
|
1179 |
.ig-es-info {
|
1180 |
+
background-color: #e7f3fe;
|
1181 |
+
border-left: 6px solid #2196F3;
|
1182 |
+
content: "\f348";
|
1183 |
}
|
1184 |
|
1185 |
.ig-es-warning {
|
1186 |
+
background-color: #ffffcc;
|
1187 |
+
border-left: 6px solid #ffeb3b;
|
1188 |
}
|
1189 |
|
1190 |
.ig-vertical-align {
|
1191 |
+
display: flex;
|
1192 |
+
align-items: center;
|
1193 |
}
|
1194 |
|
1195 |
.ig-es-icon {
|
1196 |
+
margin-right: 2em;
|
1197 |
}
|
1198 |
|
1199 |
.ig-es-icon-success:before {
|
1200 |
+
content: "\f147";
|
1201 |
+
color: #3c763d;
|
1202 |
+
font-size: 36px;
|
1203 |
}
|
1204 |
|
1205 |
.ig-es-icon-danger:before {
|
1206 |
+
content: "\f153";
|
1207 |
+
color: #a94442;
|
1208 |
+
font-size: 36px;
|
1209 |
}
|
1210 |
|
1211 |
.ig-es-icon-info:before {
|
1212 |
+
content: "\f348";
|
1213 |
+
color: #31708f;
|
1214 |
+
font-size: 36px;
|
1215 |
}
|
1216 |
|
1217 |
.ig-es-icon-warning:before {
|
1218 |
+
content: "\f534";
|
1219 |
+
color: #856404;
|
1220 |
+
font-size: 36px;
|
1221 |
}
|
1222 |
|
1223 |
/* Structure */
|
1224 |
div.es .column {
|
1225 |
+
float: left;
|
1226 |
+
margin-right: 4%;
|
1227 |
}
|
1228 |
|
1229 |
div.es .row {
|
1230 |
+
margin-left: auto;
|
1231 |
+
margin-right: auto;
|
1232 |
+
position: relative;
|
1233 |
}
|
1234 |
|
1235 |
div.es .one-half {
|
1236 |
+
width: 48%;
|
1237 |
+
position: relative;
|
1238 |
}
|
1239 |
|
1240 |
div.es .one-third {
|
1241 |
+
width: 33%;
|
1242 |
+
position: relative;
|
1243 |
}
|
1244 |
|
1245 |
div.es .last {
|
1246 |
+
margin-right: 0;
|
1247 |
}
|
1248 |
|
1249 |
.ig-es-pricing-img {
|
1250 |
+
padding-bottom: 2em;
|
1251 |
}
|
1252 |
|
1253 |
.email-subscribers_page_es_pricing #wpwrap #wpcontent {
|
1254 |
+
background-color: #f1f1f1;
|
1255 |
}
|
1256 |
|
1257 |
.es-floting-button {
|
1258 |
+
width: 10em;
|
1259 |
+
padding: 0.5em;
|
1260 |
+
text-align: center;
|
1261 |
+
margin: 0px 1em !important;
|
1262 |
+
float: right;
|
1263 |
+
/*background: #03a025;*/
|
1264 |
+
background: #00a0d2;
|
1265 |
+
color: white;
|
1266 |
+
border: none;
|
1267 |
+
font-size: 1.3em;
|
1268 |
}
|
1269 |
|
1270 |
.es-floting-button a {
|
1271 |
+
text-decoration: none;
|
1272 |
+
color: inherit;
|
1273 |
}
|
1274 |
|
1275 |
.es-floting-button:hover {
|
1276 |
+
background: #FFF;
|
1277 |
+
/*color: #03a025;*/
|
1278 |
+
color: #00a0d2;
|
1279 |
+
font-weight: bold;
|
1280 |
}
|
1281 |
|
1282 |
.es_mailer:not(:first-of-type) {
|
1283 |
+
margin-left: 1em;
|
1284 |
}
|
1285 |
|
1286 |
.es-mailer-logo {
|
1287 |
+
display: inline-block;
|
1288 |
+
padding: 0 1em;
|
1289 |
+
text-align: center;
|
1290 |
}
|
1291 |
|
1292 |
.es-mailer-logo img {
|
1293 |
+
max-height: 40px;
|
1294 |
+
max-width: 90%;
|
1295 |
}
|
1296 |
|
1297 |
.es-mailer-logo.es_recommended .es-logo-wrapper {
|
1298 |
+
border-color: #FF982D;
|
1299 |
}
|
1300 |
|
1301 |
.es-logo-wrapper {
|
1302 |
+
min-width: 120px;
|
1303 |
+
min-height: 50px;
|
1304 |
+
display: flex;
|
1305 |
+
justify-content: center;
|
1306 |
+
border: 1px solid #eaeaea;
|
1307 |
+
align-items: center;
|
1308 |
+
margin-bottom: 0.5em;
|
1309 |
+
margin-top: 1em;
|
1310 |
+
border-radius: 4px;
|
1311 |
}
|
1312 |
|
1313 |
.ig_es_docblock {
|
1314 |
+
border: 1px solid #d2d2d2;
|
1315 |
+
max-width: 68%;
|
1316 |
+
padding: 0.6em;
|
1317 |
+
border-radius: 5px;
|
1318 |
+
font-size: 1em;
|
1319 |
+
color: #737373;
|
1320 |
}
|
1321 |
|
1322 |
#post_digest {
|
1323 |
+
background: #fbf8de;
|
1324 |
+
padding: 5px;
|
1325 |
+
width: 50%;
|
1326 |
}
|
1327 |
|
1328 |
.post_digest_block {
|
1329 |
+
margin: 0.6em;
|
1330 |
+
background: #eaeaea;
|
1331 |
+
width: 40%;
|
1332 |
+
padding: 0.7em;
|
1333 |
}
|
1334 |
|
1335 |
/* Email Subscribers new css : Start*/
|
1336 |
.es_settings_field {
|
1337 |
+
margin-bottom: 0.8em;
|
1338 |
}
|
1339 |
|
1340 |
.es_settings_left_pan {
|
1341 |
+
width: 75%;
|
1342 |
+
display: inline-block;
|
1343 |
+
float: left;
|
1344 |
}
|
1345 |
|
1346 |
.es_settings_field input[type="text"], .es_settings_field input[type="email"] {
|
1347 |
+
width: 100%;
|
1348 |
+
padding: 10px;
|
1349 |
+
font-size: 16px;
|
1350 |
+
height: auto;
|
1351 |
+
line-height: 1;
|
1352 |
}
|
1353 |
|
1354 |
.es_settings_field label {
|
1355 |
+
font-size: 0.9em;
|
1356 |
+
text-transform: uppercase;
|
1357 |
+
letter-spacing: .3px;
|
1358 |
+
line-height: 2.2;
|
1359 |
}
|
1360 |
|
1361 |
.es_settings_right_pan {
|
1362 |
+
/*padding: 1.5em;*/
|
1363 |
+
/*background: #FFF;*/
|
1364 |
+
/*border-left: 1px solid #e6e6e6;*/
|
1365 |
+
/*border-top-left-radius: 5px;*/
|
1366 |
+
/*border-bottom-left-radius: 5px;*/
|
1367 |
+
width: 19%;
|
1368 |
+
display: inline-block;
|
1369 |
+
margin-left: 2em;
|
1370 |
+
/*float: right;*/
|
1371 |
}
|
1372 |
|
1373 |
.es_settings_field select {
|
1374 |
+
height: 3em;
|
1375 |
+
margin-bottom: 7px;
|
1376 |
+
padding-right: 20px;
|
1377 |
+
background-color: #FFF !important;
|
1378 |
+
width: 100%;
|
1379 |
+
max-width: 100%;
|
1380 |
}
|
1381 |
|
1382 |
.es_campaign_name_wrapper {
|
1383 |
+
margin-bottom: 1em;
|
1384 |
+
padding-bottom: 1em;
|
1385 |
+
border-bottom: 1px solid #afafaf;
|
1386 |
}
|
1387 |
|
1388 |
.es_campaign_name_wrapper .es_newsletter_name {
|
1389 |
+
width: 80%;
|
1390 |
+
/* margin-right: 1em; */
|
1391 |
+
/* border: none !important; */
|
1392 |
+
/* background-color: transparent !important; */
|
1393 |
+
box-shadow: none !important;
|
1394 |
+
color: #656565 !important;
|
1395 |
+
font-size: 1.5em;
|
1396 |
+
/* width: 100%; */
|
1397 |
+
padding: 10px;
|
1398 |
+
font-size: 16px;
|
1399 |
+
height: auto;
|
1400 |
+
line-height: 1;
|
1401 |
}
|
1402 |
|
1403 |
.es_primary_btn {
|
1404 |
+
font-size: 1.2em;
|
1405 |
+
color: #FFFFFF;
|
1406 |
+
border-color: #03a025 !important;
|
1407 |
+
background: #03a025;
|
1408 |
+
box-shadow: 0 1px 0 #03a025;
|
1409 |
+
font-weight: bold;
|
1410 |
+
height: 2.6em;
|
1411 |
+
padding: 9px 18px;
|
1412 |
+
/*font-size: 13px;*/
|
1413 |
+
border-radius: 3px;
|
1414 |
+
text-align: center;
|
1415 |
+
border: solid 1px #dce1e5;
|
1416 |
+
cursor: pointer;
|
1417 |
+
/* line-height: 0.6em; */
|
1418 |
|
1419 |
}
|
1420 |
|
1421 |
.es_primary_btn:hover {
|
1422 |
+
color: #03a025;
|
1423 |
+
background: #FFF;
|
1424 |
}
|
1425 |
|
1426 |
.es_secondary_btn {
|
1427 |
+
padding: 9px 18px;
|
1428 |
+
font-size: 13px;
|
1429 |
+
border-radius: 3px;
|
1430 |
+
text-align: center;
|
1431 |
+
border: solid 1px #dce1e5;
|
1432 |
+
cursor: pointer;
|
1433 |
+
margin-top: 1em;
|
1434 |
}
|
1435 |
|
1436 |
.es_secondary_btn:hover {
|
1437 |
+
color: #000;
|
1438 |
+
background: #FFF;
|
1439 |
}
|
1440 |
|
1441 |
|
1442 |
/* Email Subscribers new css : End*/
|
1443 |
|
1444 |
table.ig_es_form_table td {
|
1445 |
+
padding: 15px 10px 15px 0px;
|
1446 |
}
|
1447 |
|
1448 |
|
1449 |
/* Workflow CSS Start */
|
1450 |
.ig-es-table {
|
1451 |
+
line-height: 1.3;
|
1452 |
+
color: #515151;
|
1453 |
+
background: #fff;
|
1454 |
+
border: 0;
|
1455 |
+
border-spacing: 0;
|
1456 |
+
margin: 0;
|
1457 |
+
width: 100%;
|
1458 |
}
|
1459 |
|
1460 |
.ig-es-table--bordered {
|
1461 |
+
border: 1px solid #e5e5e5;
|
1462 |
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
1463 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
1464 |
}
|
1465 |
|
1466 |
.ig-es-table a {
|
1467 |
+
text-decoration: none;
|
1468 |
}
|
1469 |
|
1470 |
.ig-es-table .ig-es-table__col {
|
1471 |
+
vertical-align: top;
|
1472 |
+
border: 0 none;
|
1473 |
+
border-top: 1px solid #f2f2f2;
|
1474 |
+
padding: 18px 20px 18px 20px;
|
1475 |
+
float: none;
|
1476 |
}
|
1477 |
|
1478 |
.ig-es-table .ig-es-table__col--label {
|
1479 |
+
border-top-color: #F0F0F0;
|
1480 |
+
width: 31.5%;
|
1481 |
+
line-height: 1.15;
|
1482 |
+
font-size: 13px;
|
1483 |
+
font-weight: 600;
|
1484 |
+
border-right: 1px solid #e6e6e6;
|
1485 |
+
background: #F9F9F9;
|
1486 |
}
|
1487 |
|
1488 |
.ig-es-table .ig-es-table__col--label .ig-es-help-tip {
|
1489 |
+
margin: 0;
|
1490 |
+
position: relative;
|
1491 |
}
|
1492 |
|
1493 |
.ig-es-table .ig-es-table__col--field {
|
1494 |
+
padding-top: 13px;
|
1495 |
+
padding-bottom: 13px;
|
1496 |
}
|
1497 |
|
1498 |
.ig-es-table .ig-es-table__row:first-child .ig-es-table__col {
|
1499 |
+
border-top: none;
|
1500 |
}
|
1501 |
|
1502 |
#post-body .postbox h3.hndle {
|
1503 |
+
border-bottom: 1px solid #E1E1E1;
|
1504 |
+
padding: 9px 15px;
|
1505 |
}
|
1506 |
|
1507 |
#post-body .postbox.no-drag .hndle {
|
1508 |
+
cursor: default;
|
1509 |
}
|
1510 |
|
1511 |
.postbox .ig-es-metabox-footer {
|
1512 |
+
padding: 9px 15px;
|
1513 |
+
background: #f5f5f5;
|
1514 |
+
border-top: 1px solid #E1E1E1;
|
1515 |
+
text-align: right;
|
1516 |
}
|
1517 |
|
1518 |
.postbox .ig-es-metabox-pad {
|
1519 |
+
padding: 20px;
|
1520 |
}
|
1521 |
|
1522 |
.postbox h2.hndle small {
|
1523 |
+
font-weight: normal;
|
1524 |
+
padding-left: 1px;
|
1525 |
}
|
1526 |
|
1527 |
.postbox h2.hndle .ig-es-help-link {
|
1528 |
+
position: relative;
|
1529 |
+
top: 2px;
|
1530 |
+
left: -11px;
|
1531 |
}
|
1532 |
|
1533 |
.ig-es-field {
|
1534 |
+
margin: 1px;
|
1535 |
+
width: 100%;
|
1536 |
}
|
1537 |
|
1538 |
.ig-es-field--invalid {
|
1539 |
+
border-color: #dc3232 !important;
|
1540 |
+
-webkit-box-shadow: 0 0 2px #F55E4F !important;
|
1541 |
+
box-shadow: 0 0 2px #F55E4F !important;
|
1542 |
}
|
1543 |
|
1544 |
.ig-es-field--type-text,
|
1545 |
.ig-es-field--type-number {
|
1546 |
+
height: 28px;
|
1547 |
}
|
1548 |
|
1549 |
.ig-es-field--monospace {
|
1550 |
+
font-family: Consolas, Monaco, monospace;
|
1551 |
+
font-size: 13px;
|
1552 |
+
word-break: break-all;
|
1553 |
}
|
1554 |
|
1555 |
.wp-admin select.ig-es-field {
|
1556 |
+
max-width: 100%;
|
1557 |
}
|
1558 |
|
1559 |
.ig-es-field-errors {
|
1560 |
+
margin-top: 7px;
|
1561 |
+
color: #dc3232;
|
1562 |
+
font-weight: 500;
|
1563 |
+
line-height: 1.1;
|
1564 |
}
|
1565 |
|
1566 |
.ig-es-field-errors__error {
|
1567 |
+
margin-top: 4px;
|
1568 |
}
|
1569 |
|
1570 |
.ig-es-action__fields {
|
1571 |
+
border: 1px solid #E1E1E1;
|
1572 |
+
border-top: none;
|
1573 |
}
|
1574 |
|
1575 |
.es-actions-container {
|
1576 |
+
padding: 10px 15px;
|
1577 |
}
|
1578 |
|
1579 |
.es-rules-container {
|
1580 |
+
padding: 14px 20px 9px;
|
1581 |
}
|
1582 |
|
1583 |
body.email-subscribers_page_es_workflows #post-body .postbox .inside {
|
1584 |
+
padding: 0;
|
1585 |
+
margin: 0;
|
1586 |
}
|
1587 |
|
1588 |
.field-gap {
|
1589 |
+
margin: 8px 0;
|
1590 |
}
|
1591 |
|
1592 |
.field-cols .col-1, .field-cols .col-2 {
|
1593 |
+
float: left;
|
1594 |
+
width: 48%;
|
1595 |
}
|
1596 |
|
1597 |
.field-cols .col-2 {
|
1598 |
+
float: right;
|
1599 |
}
|
1600 |
|
1601 |
.ig-es-field-description {
|
1602 |
+
color: #8e8e8e;
|
1603 |
+
font-size: 13px;
|
1604 |
+
margin: 7px 1px 0;
|
1605 |
+
font-style: italic;
|
1606 |
}
|
1607 |
|
1608 |
.ig-es-time-field-group {
|
1609 |
+
*zoom: 1;
|
1610 |
}
|
1611 |
|
1612 |
.ig-es-time-field-group:before,
|
1613 |
.ig-es-time-field-group:after {
|
1614 |
+
content: " ";
|
1615 |
+
display: table;
|
1616 |
}
|
1617 |
|
1618 |
.ig-es-time-field-group:after {
|
1619 |
+
clear: both;
|
1620 |
}
|
1621 |
|
1622 |
.ig-es-time-field-group__fields {
|
1623 |
+
max-width: 140px;
|
1624 |
}
|
1625 |
|
1626 |
.ig-es-time-field-group .ig-es-field {
|
1627 |
+
width: 44%;
|
1628 |
+
float: left;
|
1629 |
}
|
1630 |
|
1631 |
.ig-es-time-field-group__sep {
|
1632 |
+
float: left;
|
1633 |
+
text-align: center;
|
1634 |
+
width: 6%;
|
1635 |
+
margin-top: 6px;
|
1636 |
}
|
1637 |
|
1638 |
.ig-es-time-field-group__24hr-note {
|
1639 |
+
font-weight: normal !important;
|
1640 |
+
font-size: 12px;
|
1641 |
+
margin-left: 7px;
|
1642 |
+
display: inline-block;
|
1643 |
+
margin-top: 11px;
|
1644 |
}
|
1645 |
|
1646 |
.ig-es-label {
|
1647 |
+
display: block;
|
1648 |
+
font-weight: 600;
|
1649 |
+
margin: 0 0 7px;
|
1650 |
+
font-size: 13px;
|
1651 |
}
|
1652 |
|
1653 |
.ig-es-action-template {
|
1654 |
+
display: none;
|
1655 |
}
|
1656 |
|
1657 |
.ig-es-actions-container {
|
1658 |
+
padding: 10px 15px;
|
1659 |
}
|
1660 |
|
1661 |
.ig-es-action {
|
1662 |
+
margin: 5px 0 10px;
|
1663 |
}
|
1664 |
|
1665 |
.ig-es-action .wp-editor-container iframe {
|
1666 |
+
min-height: 300px;
|
1667 |
}
|
1668 |
|
1669 |
.ig-es-action.js-open .ig-es-action__header h4,
|
1670 |
.ig-es-action.js-open .ig-es-action__header a {
|
1671 |
+
color: white;
|
1672 |
}
|
1673 |
|
1674 |
.ig-es-action__header {
|
1675 |
+
position: relative;
|
1676 |
+
padding: 14px 17px;
|
1677 |
+
border: 1px solid #E1E1E1;
|
1678 |
+
cursor: pointer;
|
1679 |
}
|
1680 |
|
1681 |
.ig-es-action__header h4 {
|
1682 |
+
font-size: 14px;
|
1683 |
+
margin: 0;
|
1684 |
+
display: inline-block;
|
1685 |
}
|
1686 |
|
1687 |
.ig-es-action__header .row-options {
|
1688 |
+
float: right;
|
1689 |
+
font-size: 12px;
|
1690 |
}
|
1691 |
|
1692 |
.ig-es-action__header .row-options a {
|
1693 |
+
text-decoration: none;
|
1694 |
+
margin: 0 4px;
|
1695 |
+
box-shadow: none;
|
1696 |
}
|
1697 |
|
1698 |
.ig-es-action .ig-es-action__fields:not([style*='display']) {
|
1699 |
+
display: none;
|
1700 |
}
|
1701 |
|
1702 |
.ig-es-switch {
|
1703 |
+
cursor: pointer;
|
1704 |
+
text-indent: -999em;
|
1705 |
+
display: block;
|
1706 |
+
width: 38px;
|
1707 |
+
height: 22px;
|
1708 |
+
border-radius: 30px;
|
1709 |
+
border: none;
|
1710 |
+
position: relative;
|
1711 |
+
-webkit-box-sizing: border-box;
|
1712 |
+
box-sizing: border-box;
|
1713 |
+
-webkit-transition: all .3s ease;
|
1714 |
+
transition: all .3s ease;
|
1715 |
+
-webkit-box-shadow: inset 0 0 0 0 transparent;
|
1716 |
+
box-shadow: inset 0 0 0 0 transparent;
|
1717 |
}
|
1718 |
|
1719 |
.ig-es-switch:focus {
|
1720 |
+
outline: none;
|
1721 |
}
|
1722 |
|
1723 |
.ig-es-switch:before {
|
1724 |
+
border-radius: 50%;
|
1725 |
+
background: #ffffff;
|
1726 |
+
content: '';
|
1727 |
+
position: absolute;
|
1728 |
+
display: block;
|
1729 |
+
width: 18px;
|
1730 |
+
height: 18px;
|
1731 |
+
top: 2px;
|
1732 |
+
left: 2px;
|
1733 |
+
-webkit-transition: all .15s ease;
|
1734 |
+
transition: all .15s ease;
|
1735 |
+
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
1736 |
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
1737 |
}
|
1738 |
|
1739 |
.ig-es-switch[data-ig-es-switch="active"] {
|
1740 |
+
-webkit-box-shadow: inset 0 0 0 11px #5850ec;
|
1741 |
+
box-shadow: inset 0 0 0 11px #5850ec;
|
1742 |
}
|
1743 |
|
1744 |
.ig-es-switch[data-ig-es-switch="active"]:before {
|
1745 |
+
-webkit-transform: translateX(16px);
|
1746 |
+
transform: translateX(16px);
|
1747 |
}
|
1748 |
|
1749 |
.ig-es-switch[data-ig-es-switch="inactive"] {
|
1750 |
+
background: #ccc;
|
1751 |
}
|
1752 |
|
1753 |
.ig-es-switch.ig-es-loading {
|
1754 |
+
cursor: default;
|
1755 |
+
opacity: 0.5;
|
1756 |
}
|
1757 |
|
1758 |
.es-items-lists table.fixed,
|
1759 |
.post-type-es_template table.fixed {
|
1760 |
+
position: static;
|
1761 |
}
|
1762 |
|
1763 |
/** Workflow CSS END */
|
1764 |
|
1765 |
.frappe-chart .x.axis .line-vertical,
|
1766 |
.frappe-chart .x.axis text {
|
1767 |
+
display: none;
|
1768 |
}
|
1769 |
|
1770 |
/*
|
1771 |
.frappe-chart .y.axis .line-horizontal,
|
1772 |
.frappe-chart .y.axis text {
|
1773 |
+
display: none;
|
1774 |
}
|
1775 |
*/
|
1776 |
|
1777 |
|
1778 |
li.menu-top div.wp-menu-image img {
|
1779 |
+
border-style: none !important;
|
1780 |
+
display: inline;
|
1781 |
}
|
1782 |
|
1783 |
/** Broadcast New UI CSS */
|
1784 |
/* input[type="date"]::-webkit-inner-spin-button,
|
1785 |
input[type="date"]::-webkit-clear-button {
|
1786 |
+
display: none;
|
1787 |
+
-webkit-appearance: none;
|
1788 |
} */
|
1789 |
|
1790 |
/*#progressbar {
|
1791 |
+
counter-reset: step;
|
1792 |
}*/
|
1793 |
#progressbar li:before {
|
1794 |
/* content: counter(step);
|
1795 |
+
counter-increment: step;*/
|
1796 |
+
width: 20px;
|
1797 |
+
line-height: 20px;
|
1798 |
+
display: inline-block;
|
1799 |
+
font-size: 10px;
|
1800 |
+
color: #333;
|
1801 |
+
background: white;
|
1802 |
+
border-radius: 3px;
|
1803 |
+
margin: 0 auto 5px auto;
|
1804 |
}
|
1805 |
/* color change after active */
|
1806 |
#progressbar li.active{
|
1807 |
+
border-bottom: 2px solid #5a67d8;
|
1808 |
}
|
1809 |
#progressbar li:hover {
|
1810 |
border-bottom: 2px solid rgb(90, 103,216, 0.5);
|
1811 |
}
|
1812 |
|
1813 |
#progressbar li.active span{
|
1814 |
+
color: #2d3748;
|
1815 |
}
|
1816 |
|
1817 |
#preview_template, #spam_score_modal{
|
1818 |
+
display: none;
|
1819 |
}
|
1820 |
|
1821 |
.broadcast_preview_container {
|
1822 |
+
height: 300px;
|
1823 |
+
overflow: hidden;
|
1824 |
+
overflow-y: auto;
|
1825 |
}
|
1826 |
|
1827 |
/* Broadcast status icons CSS */
|
1828 |
body.email-subscribers_page_es_campaigns .column-status .dashicons {
|
1829 |
+
position: relative;
|
1830 |
+
left: 10px;
|
1831 |
}
|
1832 |
|
1833 |
body.email-subscribers_page_es_campaigns .column-status .dashicons[title="Finished"] {
|
1834 |
+
color: #0e9f6e;
|
1835 |
}
|
1836 |
div.broadcast_main_content{
|
1837 |
+
width: 70% ;
|
1838 |
}
|
1839 |
|
1840 |
div.broadcast_side_content{
|
1841 |
+
width: 30% ;
|
1842 |
}
|
1843 |
#ig_es_post_notification_list_ids+.select2-container{
|
1844 |
+
position: absolute;
|
1845 |
+
width: 75% !important;
|
1846 |
}
|
1847 |
.es-preview.broadcast-preview p {
|
1848 |
+
margin : 1em 0 !important;
|
1849 |
}
|
1850 |
|
1851 |
.es-preview.broadcast-preview img.aligncenter {
|
1852 |
+
margin-left: auto;
|
1853 |
+
margin-right: auto;
|
1854 |
}
|
1855 |
#es-shortcode{
|
1856 |
+
-webkit-user-select: all;
|
1857 |
+
-ms-user-select: all;
|
1858 |
+
user-select: all;
|
1859 |
}
|
1860 |
|
1861 |
/* Campaign report */
|
1868 |
filter: blur(0);
|
1869 |
}
|
1870 |
.campaign_open_blur{
|
1871 |
+
-webkit-filter: blur(1.6px);
|
1872 |
+
filter: blur(1.6px);
|
1873 |
}
|
1874 |
|
1875 |
#browser_open_graph .chart-legend, #os_info_graph .chart-legend{
|
1876 |
+
transform: translate(50px,230px);
|
1877 |
}
|
1878 |
|
1879 |
/* Campaign Report : end */
|
lite/admin/css/jquery.timepicker.css
CHANGED
@@ -8,77 +8,77 @@
|
|
8 |
*/
|
9 |
|
10 |
.ui-timepicker-container {
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
}
|
15 |
|
16 |
.ui-timepicker {
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
}
|
25 |
|
26 |
.ui-timepicker-viewport {
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
}
|
35 |
|
36 |
.ui-timepicker-standard {
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
}
|
48 |
.ui-timepicker-standard a {
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
}
|
55 |
.ui-timepicker-standard .ui-state-hover {
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
}
|
62 |
.ui-timepicker-standard .ui-menu-item {
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
}
|
69 |
|
70 |
.ui-timepicker-corners,
|
71 |
.ui-timepicker-corners .ui-corner-all {
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
}
|
76 |
|
77 |
.ui-timepicker-hidden {
|
78 |
-
|
79 |
-
|
80 |
}
|
81 |
|
82 |
.ui-timepicker-no-scrollbar .ui-timepicker {
|
83 |
-
|
84 |
}
|
8 |
*/
|
9 |
|
10 |
.ui-timepicker-container {
|
11 |
+
position: absolute;
|
12 |
+
overflow: hidden;
|
13 |
+
box-sizing: border-box;
|
14 |
}
|
15 |
|
16 |
.ui-timepicker {
|
17 |
+
box-sizing: content-box;
|
18 |
+
display: block;
|
19 |
+
height: 205px;
|
20 |
+
list-style: none outside none;
|
21 |
+
margin: 0;
|
22 |
+
padding: 0 1px;
|
23 |
+
text-align: center;
|
24 |
}
|
25 |
|
26 |
.ui-timepicker-viewport {
|
27 |
+
box-sizing: content-box;
|
28 |
+
display: block;
|
29 |
+
height: 205px;
|
30 |
+
margin: 0;
|
31 |
+
padding: 0;
|
32 |
+
overflow: auto;
|
33 |
+
overflow-x: hidden; /* IE */
|
34 |
}
|
35 |
|
36 |
.ui-timepicker-standard {
|
37 |
+
/* overwrites .ui-widget */
|
38 |
+
font-family: Verdana,Arial,sans-serif;
|
39 |
+
font-size: 1.1em;
|
40 |
+
/* overwrites .ui-widget-content */
|
41 |
+
background-color: #FFF;
|
42 |
+
border: 1px solid #AAA;
|
43 |
+
color: #222;
|
44 |
+
/* overwrites .ui-menu */
|
45 |
+
margin: 0;
|
46 |
+
padding: 2px;
|
47 |
}
|
48 |
.ui-timepicker-standard a {
|
49 |
+
border: 1px solid transparent;
|
50 |
+
color: #222;
|
51 |
+
display: block;
|
52 |
+
padding: 0.2em 0.4em;
|
53 |
+
text-decoration: none;
|
54 |
}
|
55 |
.ui-timepicker-standard .ui-state-hover {
|
56 |
+
/* overwrites .ui-state-hover */
|
57 |
+
background-color: #DADADA;
|
58 |
+
border: 1px solid #999;
|
59 |
+
font-weight: normal;
|
60 |
+
color: #212121;
|
61 |
}
|
62 |
.ui-timepicker-standard .ui-menu-item {
|
63 |
+
/* overwrites .ui-menu and .ui-menu-item */
|
64 |
+
/*clear: left;
|
65 |
+
float: left;*/
|
66 |
+
margin: 0;
|
67 |
+
padding: 0;
|
68 |
}
|
69 |
|
70 |
.ui-timepicker-corners,
|
71 |
.ui-timepicker-corners .ui-corner-all {
|
72 |
+
-moz-border-radius: 4px;
|
73 |
+
-webkit-border-radius: 4px;
|
74 |
+
border-radius: 4px;
|
75 |
}
|
76 |
|
77 |
.ui-timepicker-hidden {
|
78 |
+
/* overwrites .ui-helper-hidden */
|
79 |
+
display: none;
|
80 |
}
|
81 |
|
82 |
.ui-timepicker-no-scrollbar .ui-timepicker {
|
83 |
+
border: none;
|
84 |
}
|
lite/admin/dist/main.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none;padding:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box;border:0 solid #d2d6dc}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#a0aec0}input::-moz-placeholder,textarea::-moz-placeholder{color:#a0aec0}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:#a0aec0}input::placeholder,textarea::placeholder{color:#a0aec0}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}a{--text-opacity:1;color:#5850ec;color:rgba(88,80,236,var(--text-opacity))}img{border-width:0}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.375rem;padding:.5rem .75rem;font-size:1rem;line-height:1.5}.form-input::-webkit-input-placeholder{color:#9fa6b2;opacity:1}.form-input::-moz-placeholder{color:#9fa6b2;opacity:1}.form-input::-ms-input-placeholder{color:#9fa6b2;opacity:1}.form-input::placeholder{color:#9fa6b2;opacity:1}.form-input:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.375rem;padding:.5rem .75rem;font-size:1rem;line-height:1.5}.form-textarea::-webkit-input-placeholder{color:#9fa6b2;opacity:1}.form-textarea::-moz-placeholder{color:#9fa6b2;opacity:1}.form-textarea::-ms-input-placeholder{color:#9fa6b2;opacity:1}.form-textarea::placeholder{color:#9fa6b2;opacity:1}.form-textarea:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-multiselect{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.375rem;padding:.5rem .75rem;font-size:1rem;line-height:1.5}.form-multiselect:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 7l3-3 3 3m0 6l-3 3-3-3' stroke='%239fa6b2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact;background-repeat:no-repeat;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.375rem;padding:.5rem 2.5rem .5rem .75rem;font-size:1rem;line-height:1.5;background-position:right .5rem center;background-size:1.5em 1.5em}.form-select::-ms-expand{color:#9fa6b2;border:none}@media not print{.form-select::-ms-expand{display:none}}@media print and (-ms-high-contrast:active),print and (-ms-high-contrast:none){.form-select{padding-right:.75rem}}.form-select:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-checkbox{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-negative:0;flex-shrink:0;height:1rem;width:1rem;color:#3f83f8;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.25rem}.form-checkbox:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.707 7.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4a1 1 0 00-1.414-1.414L7 8.586 5.707 7.293z'/%3E%3C/svg%3E");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:50%;background-repeat:no-repeat}@media not print{.form-checkbox::-ms-check{border-width:1px;color:transparent;background:inherit;border-color:inherit;border-radius:inherit}}.form-checkbox:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-checkbox:checked:focus{border-color:transparent}.form-radio{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-negative:0;flex-shrink:0;border-radius:100%;height:1rem;width:1rem;color:#3f83f8;background-color:#fff;border-color:#d2d6dc;border-width:1px}.form-radio:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:50%;background-repeat:no-repeat}@media not print{.form-radio::-ms-check{border-width:1px;color:transparent;background:inherit;border-color:inherit;border-radius:inherit}}.form-radio:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-radio:checked:focus{border-color:transparent}.ig-es-primary-button,.ig-es-send-queue-emails{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:.375rem;border-width:1px;border-color:transparent;padding:.5rem 1rem;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity));font-size:.875rem;line-height:1.25rem;font-weight:500;--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity));--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity));-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.15s;transition-duration:.15s}.ig-es-title-button,.wp-heading-inline+.page-title-action{font-size:.875rem;border-radius:.375rem;border-width:1px;--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity));line-height:1.25rem;font-weight:500}.wp-heading-inline+.page-title-action{--text-opacity:1;color:#1c64f2;color:rgba(28,100,242,var(--text-opacity));padding:.5rem;margin-left:.5rem;margin-right:.5rem}.ig-es-title-button:hover,.wp-heading-inline+.page-title-action:hover{--text-opacity:1;color:#6875f5;color:rgba(104,117,245,var(--text-opacity))}.ig-es-primary-button:hover{--bg-opacity:1;background-color:#6875f5;background-color:rgba(104,117,245,var(--bg-opacity));--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.ig-es-primary-button:focus,.ig-es-title-button:focus,.wp-heading-inline+.page-title-action:focus{outline:0;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45)}.ig-es-imp-button{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important;-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important;border-radius:.375rem!important;border-width:1px!important;border-color:transparent!important;background-color:#fff!important;background-color:rgba(255,255,255,var(--bg-opacity))!important;font-size:.875rem!important;line-height:1.25rem!important;font-weight:500!important;background-color:#0e9f6e!important;background-color:rgba(14,159,110,var(--bg-opacity))!important;-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform!important;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform!important;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;-webkit-transition-duration:.15s!important;transition-duration:.15s!important}.ig-es-imp-button,.ig-es-imp-button:hover{--text-opacity:1!important;color:#fff!important;color:rgba(255,255,255,var(--text-opacity))!important;--bg-opacity:1!important}.ig-es-imp-button:hover{background-color:#31c48d!important;background-color:rgba(49,196,141,var(--bg-opacity))!important}.ig-es-imp-button:focus{outline:0!important;-webkit-box-shadow:0 0 0 3px rgba(132,225,188,.45)!important;box-shadow:0 0 0 3px rgba(132,225,188,.45)!important}.ig-es-link-button{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:.375rem;border-width:1px;border-color:transparent;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity));font-size:.875rem;line-height:1.25rem;font-weight:500;background-color:#ff5a1f;background-color:rgba(255,90,31,var(--bg-opacity));-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.15s;transition-duration:.15s}.ig-es-link-button,.ig-es-link-button:hover{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity));--bg-opacity:1}.ig-es-link-button:hover{background-color:#ff8a4c;background-color:rgba(255,138,76,var(--bg-opacity))}.ig-es-link-button:focus{outline:0;-webkit-box-shadow:0 0 0 3px rgba(253,186,140,.45);box-shadow:0 0 0 3px rgba(253,186,140,.45)}.ig-es-action.js-open .ig-es-action__header{--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity));--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.form-checkbox{content:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.707 7.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4a1 1 0 00-1.414-1.414L7 8.586 5.707 7.293z'/%3E%3C/svg%3E")}.form-radio{content:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}.form-checkbox:checked,.form-radio:checked{--text-opacity:1!important;color:#5850ec!important;color:rgba(88,80,236,var(--text-opacity))!important}.form-select{font-size:.875rem!important;--border-opacity:1!important;border-color:#9fa6b2!important;border-color:rgba(159,166,178,var(--border-opacity))!important;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 7l3-3 3 3m0 6l-3 3-3-3' stroke='%239fa6b2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important}.form-select:focus,input[type=number]:focus{outline:0!important;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45)!important;box-shadow:0 0 0 3px rgba(164,202,254,.45)!important;--border-opacity:1!important;border-color:#a4cafe!important;border-color:rgba(164,202,254,var(--border-opacity))!important}.es-check-toggle:checked~.es-mail-toggle-line{--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity))}.es-check-toggle:checked~.es-mail-toggle-dot{--transform-translate-x:0;--transform-translate-y:0;--transform-rotate:0;--transform-skew-x:0;--transform-skew-y:0;--transform-scale-x:1;--transform-scale-y:1;-webkit-transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));--transform-translate-x:100%}[type=radio]:checked+.es-mailer-logo{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:.1s;transition-duration:.1s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);--transform-translate-x:0;--transform-translate-y:0;--transform-rotate:0;--transform-skew-x:0;--transform-skew-y:0;--transform-scale-x:1;--transform-scale-y:1;-webkit-transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));--transform-scale-x:1.1;--transform-scale-y:1.1;-webkit-box-shadow:0 0 3px 3px #5a67d8;box-shadow:0 0 3px 3px #5a67d8}.wp-core-ui .button,.wp-core-ui .button-secondary{--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity));color:#5850ec;color:rgba(88,80,236,var(--text-opacity))}.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{font-size:.875rem;border-radius:.375rem;border-width:1px;line-height:1.25rem;font-weight:500;--text-opacity:1}.wp-core-ui .button-primary{--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity));color:#fff;color:rgba(255,255,255,var(--text-opacity));-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.15s;transition-duration:.15s}.wp-core-ui .button-primary:hover,.wp-core-ui .button:hover{--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity));--text-opacity:1;color:#6875f5;color:rgba(104,117,245,var(--text-opacity))}.bg-white{--bg-opacity:1;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity))}.bg-gray-100{--bg-opacity:1;background-color:#f4f5f7;background-color:rgba(244,245,247,var(--bg-opacity))}.bg-gray-200{--bg-opacity:1;background-color:#e5e7eb;background-color:rgba(229,231,235,var(--bg-opacity))}.bg-gray-300{--bg-opacity:1;background-color:#d2d6dc;background-color:rgba(210,214,220,var(--bg-opacity))}.bg-red-100{--bg-opacity:1;background-color:#fde8e8;background-color:rgba(253,232,232,var(--bg-opacity))}.bg-green-100{--bg-opacity:1;background-color:#def7ec;background-color:rgba(222,247,236,var(--bg-opacity))}.bg-green-600{--bg-opacity:1;background-color:#057a55;background-color:rgba(5,122,85,var(--bg-opacity))}.bg-teal-50{--bg-opacity:1;background-color:#edfafa;background-color:rgba(237,250,250,var(--bg-opacity))}.bg-teal-100{--bg-opacity:1;background-color:#d5f5f6;background-color:rgba(213,245,246,var(--bg-opacity))}.bg-blue-50{--bg-opacity:1;background-color:#ebf5ff;background-color:rgba(235,245,255,var(--bg-opacity))}.bg-indigo-500{--bg-opacity:1;background-color:#6875f5;background-color:rgba(104,117,245,var(--bg-opacity))}.bg-indigo-600{--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity))}.bg-indigo-800{--bg-opacity:1;background-color:#42389d;background-color:rgba(66,56,157,var(--bg-opacity))}.hover\:bg-gray-50:hover{--bg-opacity:1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--bg-opacity))}.hover\:bg-gray-100:hover{--bg-opacity:1;background-color:#f4f5f7;background-color:rgba(244,245,247,var(--bg-opacity))}.hover\:bg-green-500:hover{--bg-opacity:1;background-color:#0e9f6e;background-color:rgba(14,159,110,var(--bg-opacity))}.hover\:bg-indigo-500:hover{--bg-opacity:1;background-color:#6875f5;background-color:rgba(104,117,245,var(--bg-opacity))}.focus\:bg-gray-50:focus{--bg-opacity:1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--bg-opacity))}.focus\:bg-gray-100:focus{--bg-opacity:1;background-color:#f4f5f7;background-color:rgba(244,245,247,var(--bg-opacity))}.border-collapse{border-collapse:collapse}.border-transparent{border-color:transparent}.border-gray-100{--border-opacity:1;border-color:#f4f5f7;border-color:rgba(244,245,247,var(--border-opacity))}.border-gray-200{--border-opacity:1;border-color:#e5e7eb;border-color:rgba(229,231,235,var(--border-opacity))}.border-gray-300{--border-opacity:1;border-color:#d2d6dc;border-color:rgba(210,214,220,var(--border-opacity))}.border-gray-400{--border-opacity:1;border-color:#9fa6b2;border-color:rgba(159,166,178,var(--border-opacity))}.border-indigo-500{--border-opacity:1;border-color:#6875f5;border-color:rgba(104,117,245,var(--border-opacity))}.border-indigo-600{--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity))}.hover\:border-gray-200:hover{--border-opacity:1;border-color:#e5e7eb;border-color:rgba(229,231,235,var(--border-opacity))}.hover\:border-gray-500:hover{--border-opacity:1;border-color:#6b7280;border-color:rgba(107,114,128,var(--border-opacity))}.hover\:border-red-400:hover{--border-opacity:1;border-color:#f98080;border-color:rgba(249,128,128,var(--border-opacity))}.hover\:border-indigo-500:hover{--border-opacity:1;border-color:#6875f5;border-color:rgba(104,117,245,var(--border-opacity))}.hover\:border-indigo-600:hover{--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity))}.focus\:border-blue-300:focus{--border-opacity:1;border-color:#a4cafe;border-color:rgba(164,202,254,var(--border-opacity))}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.rounded-full{border-radius:9999px}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-0{border-width:0}.border-2{border-width:2px}.border{border-width:1px}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-b{border-bottom-width:1px}.cursor-auto{cursor:auto}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:-webkit-box;display:-ms-flexbox;display:flex}.inline-flex{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.table{display:table}.table-cell{display:table-cell}.grid{display:grid}.hidden{display:none}.flex-row{-webkit-box-orient:horizontal;-ms-flex-direction:row;flex-direction:row}.flex-col,.flex-row{-webkit-box-direction:normal}.flex-col{-webkit-box-orient:vertical;-ms-flex-direction:column;flex-direction:column}.flex-wrap{-ms-flex-wrap:wrap;flex-wrap:wrap}.items-start{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.items-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.self-start{-ms-flex-item-align:start;align-self:flex-start}.justify-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.justify-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.justify-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.flex-1{-webkit-box-flex:1;-ms-flex:1 1 0%;flex:1 1 0%}.flex-auto{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}.flex-none{-webkit-box-flex:0;-ms-flex:none;flex:none}.flex-shrink-0{-ms-flex-negative:0;flex-shrink:0}.float-right{float:right}.float-left{float:left}.font-sans{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-thin{font-weight:200}.font-normal{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.h-0{height:0}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-10{height:2.5rem}.h-15{height:3.75rem}.h-20{height:5rem}.h-48{height:12rem}.h-auto{height:auto}.h-full{height:100%}.text-xs{font-size:.75rem}.text-sm{font-size:.875rem}.text-base{font-size:1rem}.text-lg{font-size:1.125rem}.text-xl{font-size:1.25rem}.text-2xl{font-size:1.5rem}.text-4xl{font-size:2.25rem}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.list-none{list-style-type:none}.list-disc{list-style-type:disc}.list-decimal{list-style-type:decimal}.m-4{margin:1rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.mx-8{margin-left:2rem;margin-right:2rem}.mx-auto{margin-left:auto;margin-right:auto}.mt-0{margin-top:0}.mb-0{margin-bottom:0}.mt-1{margin-top:.25rem}.mr-1{margin-right:.25rem}.mb-1{margin-bottom:.25rem}.ml-1{margin-left:.25rem}.mt-2{margin-top:.5rem}.mr-2{margin-right:.5rem}.mb-2{margin-bottom:.5rem}.ml-2{margin-left:.5rem}.mt-3{margin-top:.75rem}.mr-3{margin-right:.75rem}.mb-3{margin-bottom:.75rem}.ml-3{margin-left:.75rem}.mt-4{margin-top:1rem}.mr-4{margin-right:1rem}.mb-4{margin-bottom:1rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.mt-6{margin-top:1.5rem}.mr-6{margin-right:1.5rem}.mb-6{margin-bottom:1.5rem}.ml-6{margin-left:1.5rem}.mt-8{margin-top:2rem}.mr-8{margin-right:2rem}.mr-10{margin-right:2.5rem}.mt-12{margin-top:3rem}.ml-12{margin-left:3rem}.mt-16{margin-top:4rem}.mr-16{margin-right:4rem}.ml-16{margin-left:4rem}.mt-1\.5{margin-top:.375rem}.mr-1\.5{margin-right:.375rem}.mt-3\.5{margin-top:.875rem}.-mr-1{margin-right:-.25rem}.max-h-full{max-height:100%}.max-w-7xl{max-width:80rem}.max-w-full{max-width:100%}.min-h-screen{min-height:100vh}.min-w-0{min-width:0}.min-w-full{min-width:100%}.opacity-0{opacity:0}.opacity-100{opacity:1}.focus\:outline-none:focus{outline:0}.overflow-hidden{overflow:hidden}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-1{padding-left:.25rem;padding-right:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.px-4{padding-left:1rem;padding-right:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-12{padding-top:3rem;padding-bottom:3rem}.px-12{padding-left:3rem;padding-right:3rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.pt-1{padding-top:.25rem}.pr-1{padding-right:.25rem}.pb-1{padding-bottom:.25rem}.pl-1{padding-left:.25rem}.pt-2{padding-top:.5rem}.pr-2{padding-right:.5rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pt-3{padding-top:.75rem}.pb-3{padding-bottom:.75rem}.pl-3{padding-left:.75rem}.pt-4{padding-top:1rem}.pr-4{padding-right:1rem}.pb-4{padding-bottom:1rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pt-6{padding-top:1.5rem}.pr-6{padding-right:1.5rem}.pb-6{padding-bottom:1.5rem}.pl-6{padding-left:1.5rem}.pt-7{padding-top:1.75rem}.pt-8{padding-top:2rem}.pb-8{padding-bottom:2rem}.pl-8{padding-left:2rem}.pt-10{padding-top:2.5rem}.pl-10{padding-left:2.5rem}.pr-12{padding-right:3rem}.pb-12{padding-bottom:3rem}.pl-16{padding-left:4rem}.pt-1\.5{padding-top:.375rem}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.inset-y-0{top:0;bottom:0}.top-0{top:0}.right-0{right:0}.left-0{left:0}.shadow-xs{-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.05);box-shadow:0 0 0 1px rgba(0,0,0,.05)}.shadow-sm{-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.05);box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.shadow{-webkit-box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06);box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)}.shadow-md{-webkit-box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06)}.shadow-lg{-webkit-box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.shadow-xl{-webkit-box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04)}.shadow-inner{-webkit-box-shadow:inset 0 2px 4px 0 rgba(0,0,0,.06);box-shadow:inset 0 2px 4px 0 rgba(0,0,0,.06)}.hover\:shadow-md:hover{-webkit-box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06)}.focus\:shadow-lg:focus{-webkit-box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.focus\:shadow-outline:focus{-webkit-box-shadow:0 0 0 3px rgba(118,169,250,.45);box-shadow:0 0 0 3px rgba(118,169,250,.45)}.focus\:shadow-outline-blue:focus{-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45)}.focus\:shadow-outline-red:focus{-webkit-box-shadow:0 0 0 3px rgba(248,180,180,.45);box-shadow:0 0 0 3px rgba(248,180,180,.45)}.focus\:shadow-outline-indigo:focus{-webkit-box-shadow:0 0 0 3px rgba(180,198,252,.45);box-shadow:0 0 0 3px rgba(180,198,252,.45)}.table-fixed{table-layout:fixed}.text-left{text-align:left}.text-center{text-align:center}.text-white{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.text-black{--text-opacity:1;color:#000;color:rgba(0,0,0,var(--text-opacity))}.text-gray-400{--text-opacity:1;color:#9fa6b2;color:rgba(159,166,178,var(--text-opacity))}.text-gray-500{--text-opacity:1;color:#6b7280;color:rgba(107,114,128,var(--text-opacity))}.text-gray-600{--text-opacity:1;color:#4b5563;color:rgba(75,85,99,var(--text-opacity))}.text-gray-700{--text-opacity:1;color:#374151;color:rgba(55,65,81,var(--text-opacity))}.text-gray-800{--text-opacity:1;color:#252f3f;color:rgba(37,47,63,var(--text-opacity))}.text-gray-900{--text-opacity:1;color:#161e2e;color:rgba(22,30,46,var(--text-opacity))}.text-red-600{--text-opacity:1;color:#e02424;color:rgba(224,36,36,var(--text-opacity))}.text-red-800{--text-opacity:1;color:#9b1c1c;color:rgba(155,28,28,var(--text-opacity))}.text-orange-400{--text-opacity:1;color:#ff8a4c;color:rgba(255,138,76,var(--text-opacity))}.text-orange-500{--text-opacity:1;color:#ff5a1f;color:rgba(255,90,31,var(--text-opacity))}.text-yellow-400{--text-opacity:1;color:#e3a008;color:rgba(227,160,8,var(--text-opacity))}.text-green-400{--text-opacity:1;color:#31c48d;color:rgba(49,196,141,var(--text-opacity))}.text-green-600{--text-opacity:1;color:#057a55;color:rgba(5,122,85,var(--text-opacity))}.text-green-800{--text-opacity:1;color:#03543f;color:rgba(3,84,63,var(--text-opacity))}.text-teal-400{--text-opacity:1;color:#16bdca;color:rgba(22,189,202,var(--text-opacity))}.text-teal-500{--text-opacity:1;color:#0694a2;color:rgba(6,148,162,var(--text-opacity))}.text-teal-700{--text-opacity:1;color:#036672;color:rgba(3,102,114,var(--text-opacity))}.text-blue-400{--text-opacity:1;color:#76a9fa;color:rgba(118,169,250,var(--text-opacity))}.text-blue-500{--text-opacity:1;color:#3f83f8;color:rgba(63,131,248,var(--text-opacity))}.text-blue-700{--text-opacity:1;color:#1a56db;color:rgba(26,86,219,var(--text-opacity))}.text-blue-800{--text-opacity:1;color:#1e429f;color:rgba(30,66,159,var(--text-opacity))}.text-indigo-100{--text-opacity:1;color:#e5edff;color:rgba(229,237,255,var(--text-opacity))}.text-indigo-400{--text-opacity:1;color:#8da2fb;color:rgba(141,162,251,var(--text-opacity))}.text-indigo-500{--text-opacity:1;color:#6875f5;color:rgba(104,117,245,var(--text-opacity))}.text-indigo-600{--text-opacity:1;color:#5850ec;color:rgba(88,80,236,var(--text-opacity))}.hover\:text-white:hover{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.hover\:text-gray-800:hover{--text-opacity:1;color:#252f3f;color:rgba(37,47,63,var(--text-opacity))}.hover\:text-gray-900:hover{--text-opacity:1;color:#161e2e;color:rgba(22,30,46,var(--text-opacity))}.hover\:text-blue-700:hover{--text-opacity:1;color:#1a56db;color:rgba(26,86,219,var(--text-opacity))}.hover\:text-indigo-500:hover{--text-opacity:1;color:#6875f5;color:rgba(104,117,245,var(--text-opacity))}.focus\:text-white:focus{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.focus\:text-gray-900:focus{--text-opacity:1;color:#161e2e;color:rgba(22,30,46,var(--text-opacity))}.active\:text-indigo-600:active{--text-opacity:1;color:#5850ec;color:rgba(88,80,236,var(--text-opacity))}.italic{font-style:italic}.not-italic{font-style:normal}.uppercase{text-transform:uppercase}.underline{text-decoration:underline}.no-underline{text-decoration:none}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.align-middle{vertical-align:middle}.whitespace-no-wrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.w-0{width:0}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-10{width:2.5rem}.w-40{width:10rem}.w-56{width:14rem}.w-auto{width:auto}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-2\/3{width:66.666667%}.w-1\/4{width:25%}.w-2\/4{width:50%}.w-3\/4{width:75%}.w-1\/5{width:20%}.w-2\/5{width:40%}.w-3\/5{width:60%}.w-4\/5{width:80%}.w-3\/6{width:50%}.w-4\/6{width:66.666667%}.w-5\/6{width:83.333333%}.w-1\/12{width:8.333333%}.w-2\/12{width:16.666667%}.w-3\/12{width:25%}.w-4\/12{width:33.333333%}.w-9\/12{width:75%}.w-11\/12{width:91.666667%}.w-full{width:100%}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.gap-8{grid-gap:2rem;gap:2rem}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.transform{--transform-translate-x:0;--transform-translate-y:0;--transform-rotate:0;--transform-skew-x:0;--transform-skew-y:0;--transform-scale-x:1;--transform-scale-y:1;-webkit-transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y))}.origin-top-right{-webkit-transform-origin:top right;transform-origin:top right}.scale-95{--transform-scale-x:.95;--transform-scale-y:.95}.scale-100{--transform-scale-x:1;--transform-scale-y:1}.transition-all{-webkit-transition-property:all;transition-property:all}.transition{-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform}.ease-in{-webkit-transition-timing-function:cubic-bezier(.4,0,1,1);transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{-webkit-transition-timing-function:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in-out{-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-75{-webkit-transition-duration:75ms;transition-duration:75ms}.duration-100{-webkit-transition-duration:.1s;transition-duration:.1s}.duration-150{-webkit-transition-duration:.15s;transition-duration:.15s}.duration-300{-webkit-transition-duration:.3s;transition-duration:.3s}@media (min-width:640px){.sm\:rounded{border-radius:.25rem}.sm\:rounded-md{border-radius:.375rem}.sm\:rounded-lg{border-radius:.5rem}.sm\:border-r{border-right-width:1px}.sm\:border-l{border-left-width:1px}.sm\:grid{display:grid}.sm\:justify-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.sm\:text-sm{font-size:.875rem}.sm\:text-2xl{font-size:1.5rem}.sm\:text-3xl{font-size:1.875rem}.sm\:leading-5{line-height:1.25rem}.sm\:leading-7{line-height:1.75rem}.sm\:leading-9{line-height:2.25rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-2{padding-left:.5rem;padding-right:.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm\:w-32{width:8rem}.sm\:w-1\/3{width:33.333333%}.sm\:w-2\/3{width:66.666667%}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:768px){.md\:flex{display:-webkit-box;display:-ms-flexbox;display:flex}.md\:items-start{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.md\:items-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.md\:justify-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.md\:justify-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.md\:text-base{font-size:1rem}.md\:mx-0{margin-left:0;margin-right:0}.md\:my-2{margin-top:.5rem;margin-bottom:.5rem}.md\:mt-0{margin-top:0}.md\:ml-2{margin-left:.5rem}.md\:ml-4{margin-left:1rem}.md\:ml-8{margin-left:2rem}.md\:-mr-8{margin-right:-2rem}.md\:max-w-xl{max-width:36rem}.md\:max-w-5xl{max-width:64rem}.md\:p-2{padding:.5rem}.md\:p-6{padding:1.5rem}.md\:py-0{padding-top:0;padding-bottom:0}.md\:px-1{padding-left:.25rem;padding-right:.25rem}.md\:px-2{padding-left:.5rem;padding-right:.5rem}.md\:pb-2{padding-bottom:.5rem}.md\:pr-4{padding-right:1rem}.md\:pt-6{padding-top:1.5rem}.md\:w-3\/5{width:60%}}@media (min-width:1024px){.lg\:bg-transparent{background-color:transparent}.lg\:border-transparent{border-color:transparent}.lg\:rounded-full{border-radius:9999px}.lg\:block{display:block}.lg\:inline-flex{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.lg\:grid{display:grid}.lg\:text-sm{font-size:.875rem}.lg\:text-lg{font-size:1.125rem}.lg\:my-0{margin-top:0;margin-bottom:0}.lg\:mx-5{margin-left:1.25rem;margin-right:1.25rem}.lg\:ml-16{margin-left:4rem}.lg\:-mr-16{margin-right:-4rem}.lg\:p-6{padding:1.5rem}.lg\:p-8{padding:2rem}.lg\:px-3{padding-left:.75rem;padding-right:.75rem}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:pt-2{padding-top:.5rem}.lg\:pb-2{padding-bottom:.5rem}.lg\:pl-2{padding-left:.5rem}.lg\:shadow-none{-webkit-box-shadow:none;box-shadow:none}.lg\:w-40{width:10rem}.lg\:w-1\/2{width:50%}.lg\:w-3\/5{width:60%}.lg\:w-3\/12{width:25%}.lg\:w-7\/12{width:58.333333%}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1280px){.xl\:mx-7{margin-left:1.75rem;margin-right:1.75rem}.xl\:mr-0{margin-right:0}.xl\:ml-3{margin-left:.75rem}.xl\:ml-4{margin-left:1rem}.xl\:ml-20{margin-left:5rem}.xl\:px-4{padding-left:1rem;padding-right:1rem}.xl\:pb-4{padding-bottom:1rem}.xl\:w-1\/4{width:25%}.xl\:w-2\/5{width:40%}.xl\:w-3\/5{width:60%}.xl\:w-2\/12{width:16.666667%}.xl\:w-7\/12{width:58.333333%}}
|
1 |
+
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none;padding:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box;border:0 solid #d2d6dc}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#a0aec0}input::-moz-placeholder,textarea::-moz-placeholder{color:#a0aec0}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:#a0aec0}input::placeholder,textarea::placeholder{color:#a0aec0}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}a{--text-opacity:1;color:#5850ec;color:rgba(88,80,236,var(--text-opacity))}img{border-width:0}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}.form-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.375rem;padding:.5rem .75rem;font-size:1rem;line-height:1.5}.form-input::-webkit-input-placeholder{color:#9fa6b2;opacity:1}.form-input::-moz-placeholder{color:#9fa6b2;opacity:1}.form-input::-ms-input-placeholder{color:#9fa6b2;opacity:1}.form-input::placeholder{color:#9fa6b2;opacity:1}.form-input:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.375rem;padding:.5rem .75rem;font-size:1rem;line-height:1.5}.form-textarea::-webkit-input-placeholder{color:#9fa6b2;opacity:1}.form-textarea::-moz-placeholder{color:#9fa6b2;opacity:1}.form-textarea::-ms-input-placeholder{color:#9fa6b2;opacity:1}.form-textarea::placeholder{color:#9fa6b2;opacity:1}.form-textarea:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-multiselect{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.375rem;padding:.5rem .75rem;font-size:1rem;line-height:1.5}.form-multiselect:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 7l3-3 3 3m0 6l-3 3-3-3' stroke='%239fa6b2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact;background-repeat:no-repeat;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.375rem;padding:.5rem 2.5rem .5rem .75rem;font-size:1rem;line-height:1.5;background-position:right .5rem center;background-size:1.5em 1.5em}.form-select::-ms-expand{color:#9fa6b2;border:none}@media not print{.form-select::-ms-expand{display:none}}@media print and (-ms-high-contrast:active),print and (-ms-high-contrast:none){.form-select{padding-right:.75rem}}.form-select:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-checkbox{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-negative:0;flex-shrink:0;height:1rem;width:1rem;color:#3f83f8;background-color:#fff;border-color:#d2d6dc;border-width:1px;border-radius:.25rem}.form-checkbox:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.707 7.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4a1 1 0 00-1.414-1.414L7 8.586 5.707 7.293z'/%3E%3C/svg%3E");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:50%;background-repeat:no-repeat}@media not print{.form-checkbox::-ms-check{border-width:1px;color:transparent;background:inherit;border-color:inherit;border-radius:inherit}}.form-checkbox:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-checkbox:checked:focus{border-color:transparent}.form-radio{-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-print-color-adjust:exact;color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-negative:0;flex-shrink:0;border-radius:100%;height:1rem;width:1rem;color:#3f83f8;background-color:#fff;border-color:#d2d6dc;border-width:1px}.form-radio:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:50%;background-repeat:no-repeat}@media not print{.form-radio::-ms-check{border-width:1px;color:transparent;background:inherit;border-color:inherit;border-radius:inherit}}.form-radio:focus{outline:none;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45);border-color:#a4cafe}.form-radio:checked:focus{border-color:transparent}.ig-es-primary-button,.ig-es-send-queue-emails{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:.375rem;border-width:1px;border-color:transparent;padding:.5rem 1rem;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity));font-size:.875rem;line-height:1.25rem;font-weight:500;--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity));--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity));-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.15s;transition-duration:.15s}.ig-es-title-button,.wp-heading-inline+.page-title-action{font-size:.875rem;border-radius:.375rem;border-width:1px;--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity));line-height:1.25rem;font-weight:500}.wp-heading-inline+.page-title-action{--text-opacity:1;color:#1c64f2;color:rgba(28,100,242,var(--text-opacity));padding:.5rem;margin-left:.5rem;margin-right:.5rem}.ig-es-title-button:hover,.wp-heading-inline+.page-title-action:hover{--text-opacity:1;color:#6875f5;color:rgba(104,117,245,var(--text-opacity))}.ig-es-primary-button:hover{--bg-opacity:1;background-color:#6875f5;background-color:rgba(104,117,245,var(--bg-opacity));--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.ig-es-primary-button:focus,.ig-es-title-button:focus,.wp-heading-inline+.page-title-action:focus{outline:0;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45)}.ig-es-imp-button{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important;-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important;border-radius:.375rem!important;border-width:1px!important;border-color:transparent!important;background-color:#fff!important;background-color:rgba(255,255,255,var(--bg-opacity))!important;font-size:.875rem!important;line-height:1.25rem!important;font-weight:500!important;background-color:#0e9f6e!important;background-color:rgba(14,159,110,var(--bg-opacity))!important;-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform!important;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform!important;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;-webkit-transition-duration:.15s!important;transition-duration:.15s!important}.ig-es-imp-button,.ig-es-imp-button:hover{--text-opacity:1!important;color:#fff!important;color:rgba(255,255,255,var(--text-opacity))!important;--bg-opacity:1!important}.ig-es-imp-button:hover{background-color:#31c48d!important;background-color:rgba(49,196,141,var(--bg-opacity))!important}.ig-es-imp-button:focus{outline:0!important;-webkit-box-shadow:0 0 0 3px rgba(132,225,188,.45)!important;box-shadow:0 0 0 3px rgba(132,225,188,.45)!important}.ig-es-link-button{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:.375rem;border-width:1px;border-color:transparent;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity));font-size:.875rem;line-height:1.25rem;font-weight:500;background-color:#ff5a1f;background-color:rgba(255,90,31,var(--bg-opacity));-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.15s;transition-duration:.15s}.ig-es-link-button,.ig-es-link-button:hover{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity));--bg-opacity:1}.ig-es-link-button:hover{background-color:#ff8a4c;background-color:rgba(255,138,76,var(--bg-opacity))}.ig-es-link-button:focus{outline:0;-webkit-box-shadow:0 0 0 3px rgba(253,186,140,.45);box-shadow:0 0 0 3px rgba(253,186,140,.45)}.ig-es-action.js-open .ig-es-action__header{--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity));--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.form-checkbox{content:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.707 7.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4a1 1 0 00-1.414-1.414L7 8.586 5.707 7.293z'/%3E%3C/svg%3E")}.form-radio{content:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}.form-checkbox:checked,.form-radio:checked{--text-opacity:1!important;color:#5850ec!important;color:rgba(88,80,236,var(--text-opacity))!important}.form-select{font-size:.875rem!important;--border-opacity:1!important;border-color:#9fa6b2!important;border-color:rgba(159,166,178,var(--border-opacity))!important;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 7l3-3 3 3m0 6l-3 3-3-3' stroke='%239fa6b2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important}.form-select:focus,input[type=number]:focus{outline:0!important;-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45)!important;box-shadow:0 0 0 3px rgba(164,202,254,.45)!important;--border-opacity:1!important;border-color:#a4cafe!important;border-color:rgba(164,202,254,var(--border-opacity))!important}.es-check-toggle:checked~.es-mail-toggle-line{--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity))}.es-check-toggle:checked~.es-mail-toggle-dot{--transform-translate-x:0;--transform-translate-y:0;--transform-rotate:0;--transform-skew-x:0;--transform-skew-y:0;--transform-scale-x:1;--transform-scale-y:1;-webkit-transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));--transform-translate-x:100%}[type=radio]:checked+.es-mailer-logo{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:.1s;transition-duration:.1s;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);--transform-translate-x:0;--transform-translate-y:0;--transform-rotate:0;--transform-skew-x:0;--transform-skew-y:0;--transform-scale-x:1;--transform-scale-y:1;-webkit-transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));--transform-scale-x:1.1;--transform-scale-y:1.1;-webkit-box-shadow:0 0 3px 3px #5a67d8;box-shadow:0 0 3px 3px #5a67d8}.wp-core-ui .button,.wp-core-ui .button-secondary{--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity));color:#5850ec;color:rgba(88,80,236,var(--text-opacity))}.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{font-size:.875rem;border-radius:.375rem;border-width:1px;line-height:1.25rem;font-weight:500;--text-opacity:1}.wp-core-ui .button-primary{--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity));color:#fff;color:rgba(255,255,255,var(--text-opacity));-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.15s;transition-duration:.15s}.wp-core-ui .button-primary:hover,.wp-core-ui .button:hover{--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity));--text-opacity:1;color:#6875f5;color:rgba(104,117,245,var(--text-opacity))}.bg-white{--bg-opacity:1;background-color:#fff;background-color:rgba(255,255,255,var(--bg-opacity))}.bg-gray-100{--bg-opacity:1;background-color:#f4f5f7;background-color:rgba(244,245,247,var(--bg-opacity))}.bg-gray-200{--bg-opacity:1;background-color:#e5e7eb;background-color:rgba(229,231,235,var(--bg-opacity))}.bg-gray-300{--bg-opacity:1;background-color:#d2d6dc;background-color:rgba(210,214,220,var(--bg-opacity))}.bg-red-100{--bg-opacity:1;background-color:#fde8e8;background-color:rgba(253,232,232,var(--bg-opacity))}.bg-green-100{--bg-opacity:1;background-color:#def7ec;background-color:rgba(222,247,236,var(--bg-opacity))}.bg-green-600{--bg-opacity:1;background-color:#057a55;background-color:rgba(5,122,85,var(--bg-opacity))}.bg-teal-50{--bg-opacity:1;background-color:#edfafa;background-color:rgba(237,250,250,var(--bg-opacity))}.bg-teal-100{--bg-opacity:1;background-color:#d5f5f6;background-color:rgba(213,245,246,var(--bg-opacity))}.bg-blue-50{--bg-opacity:1;background-color:#ebf5ff;background-color:rgba(235,245,255,var(--bg-opacity))}.bg-indigo-500{--bg-opacity:1;background-color:#6875f5;background-color:rgba(104,117,245,var(--bg-opacity))}.bg-indigo-600{--bg-opacity:1;background-color:#5850ec;background-color:rgba(88,80,236,var(--bg-opacity))}.bg-indigo-800{--bg-opacity:1;background-color:#42389d;background-color:rgba(66,56,157,var(--bg-opacity))}.hover\:bg-gray-50:hover{--bg-opacity:1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--bg-opacity))}.hover\:bg-gray-100:hover{--bg-opacity:1;background-color:#f4f5f7;background-color:rgba(244,245,247,var(--bg-opacity))}.hover\:bg-green-500:hover{--bg-opacity:1;background-color:#0e9f6e;background-color:rgba(14,159,110,var(--bg-opacity))}.hover\:bg-indigo-500:hover{--bg-opacity:1;background-color:#6875f5;background-color:rgba(104,117,245,var(--bg-opacity))}.focus\:bg-gray-50:focus{--bg-opacity:1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--bg-opacity))}.focus\:bg-gray-100:focus{--bg-opacity:1;background-color:#f4f5f7;background-color:rgba(244,245,247,var(--bg-opacity))}.border-collapse{border-collapse:collapse}.border-transparent{border-color:transparent}.border-gray-100{--border-opacity:1;border-color:#f4f5f7;border-color:rgba(244,245,247,var(--border-opacity))}.border-gray-200{--border-opacity:1;border-color:#e5e7eb;border-color:rgba(229,231,235,var(--border-opacity))}.border-gray-300{--border-opacity:1;border-color:#d2d6dc;border-color:rgba(210,214,220,var(--border-opacity))}.border-gray-400{--border-opacity:1;border-color:#9fa6b2;border-color:rgba(159,166,178,var(--border-opacity))}.border-indigo-500{--border-opacity:1;border-color:#6875f5;border-color:rgba(104,117,245,var(--border-opacity))}.border-indigo-600{--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity))}.hover\:border-gray-200:hover{--border-opacity:1;border-color:#e5e7eb;border-color:rgba(229,231,235,var(--border-opacity))}.hover\:border-gray-500:hover{--border-opacity:1;border-color:#6b7280;border-color:rgba(107,114,128,var(--border-opacity))}.hover\:border-red-400:hover{--border-opacity:1;border-color:#f98080;border-color:rgba(249,128,128,var(--border-opacity))}.hover\:border-indigo-500:hover{--border-opacity:1;border-color:#6875f5;border-color:rgba(104,117,245,var(--border-opacity))}.hover\:border-indigo-600:hover{--border-opacity:1;border-color:#5850ec;border-color:rgba(88,80,236,var(--border-opacity))}.focus\:border-blue-300:focus{--border-opacity:1;border-color:#a4cafe;border-color:rgba(164,202,254,var(--border-opacity))}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.rounded-full{border-radius:9999px}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-0{border-width:0}.border-2{border-width:2px}.border{border-width:1px}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-b{border-bottom-width:1px}.cursor-auto{cursor:auto}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:-webkit-box;display:-ms-flexbox;display:flex}.inline-flex{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.table{display:table}.table-cell{display:table-cell}.grid{display:grid}.hidden{display:none}.flex-row{-webkit-box-orient:horizontal;-ms-flex-direction:row;flex-direction:row}.flex-col,.flex-row{-webkit-box-direction:normal}.flex-col{-webkit-box-orient:vertical;-ms-flex-direction:column;flex-direction:column}.flex-wrap{-ms-flex-wrap:wrap;flex-wrap:wrap}.items-start{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.items-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.self-start{-ms-flex-item-align:start;align-self:flex-start}.justify-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.justify-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.justify-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.flex-1{-webkit-box-flex:1;-ms-flex:1 1 0%;flex:1 1 0%}.flex-auto{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}.flex-none{-webkit-box-flex:0;-ms-flex:none;flex:none}.flex-shrink-0{-ms-flex-negative:0;flex-shrink:0}.float-right{float:right}.float-left{float:left}.font-sans{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.font-thin{font-weight:200}.font-normal{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.h-0{height:0}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-10{height:2.5rem}.h-15{height:3.75rem}.h-20{height:5rem}.h-48{height:12rem}.h-auto{height:auto}.h-full{height:100%}.text-xs{font-size:.75rem}.text-sm{font-size:.875rem}.text-base{font-size:1rem}.text-lg{font-size:1.125rem}.text-xl{font-size:1.25rem}.text-2xl{font-size:1.5rem}.text-4xl{font-size:2.25rem}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.list-none{list-style-type:none}.list-disc{list-style-type:disc}.list-decimal{list-style-type:decimal}.m-4{margin:1rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.my-8{margin-top:2rem;margin-bottom:2rem}.mx-8{margin-left:2rem;margin-right:2rem}.mx-auto{margin-left:auto;margin-right:auto}.mt-0{margin-top:0}.mb-0{margin-bottom:0}.mt-1{margin-top:.25rem}.mr-1{margin-right:.25rem}.mb-1{margin-bottom:.25rem}.ml-1{margin-left:.25rem}.mt-2{margin-top:.5rem}.mr-2{margin-right:.5rem}.mb-2{margin-bottom:.5rem}.ml-2{margin-left:.5rem}.mt-3{margin-top:.75rem}.mr-3{margin-right:.75rem}.mb-3{margin-bottom:.75rem}.ml-3{margin-left:.75rem}.mt-4{margin-top:1rem}.mr-4{margin-right:1rem}.mb-4{margin-bottom:1rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.mt-6{margin-top:1.5rem}.mr-6{margin-right:1.5rem}.mb-6{margin-bottom:1.5rem}.ml-6{margin-left:1.5rem}.mt-8{margin-top:2rem}.mr-8{margin-right:2rem}.mr-10{margin-right:2.5rem}.mt-12{margin-top:3rem}.ml-12{margin-left:3rem}.mt-16{margin-top:4rem}.mr-16{margin-right:4rem}.ml-16{margin-left:4rem}.mt-1\.5{margin-top:.375rem}.mr-1\.5{margin-right:.375rem}.mt-3\.5{margin-top:.875rem}.-mr-1{margin-right:-.25rem}.max-h-full{max-height:100%}.max-w-7xl{max-width:80rem}.max-w-full{max-width:100%}.min-h-screen{min-height:100vh}.min-w-0{min-width:0}.min-w-full{min-width:100%}.opacity-0{opacity:0}.opacity-100{opacity:1}.focus\:outline-none:focus{outline:0}.overflow-hidden{overflow:hidden}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-1{padding-left:.25rem;padding-right:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.px-4{padding-left:1rem;padding-right:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-12{padding-top:3rem;padding-bottom:3rem}.px-12{padding-left:3rem;padding-right:3rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.pt-1{padding-top:.25rem}.pr-1{padding-right:.25rem}.pb-1{padding-bottom:.25rem}.pl-1{padding-left:.25rem}.pt-2{padding-top:.5rem}.pr-2{padding-right:.5rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pt-3{padding-top:.75rem}.pb-3{padding-bottom:.75rem}.pl-3{padding-left:.75rem}.pt-4{padding-top:1rem}.pr-4{padding-right:1rem}.pb-4{padding-bottom:1rem}.pl-4{padding-left:1rem}.pl-5{padding-left:1.25rem}.pt-6{padding-top:1.5rem}.pr-6{padding-right:1.5rem}.pb-6{padding-bottom:1.5rem}.pl-6{padding-left:1.5rem}.pt-7{padding-top:1.75rem}.pt-8{padding-top:2rem}.pb-8{padding-bottom:2rem}.pl-8{padding-left:2rem}.pt-10{padding-top:2.5rem}.pl-10{padding-left:2.5rem}.pr-12{padding-right:3rem}.pb-12{padding-bottom:3rem}.pl-16{padding-left:4rem}.pt-1\.5{padding-top:.375rem}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.inset-y-0{top:0;bottom:0}.top-0{top:0}.right-0{right:0}.left-0{left:0}.shadow-xs{-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.05);box-shadow:0 0 0 1px rgba(0,0,0,.05)}.shadow-sm{-webkit-box-shadow:0 1px 2px 0 rgba(0,0,0,.05);box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.shadow{-webkit-box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06);box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)}.shadow-md{-webkit-box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06)}.shadow-lg{-webkit-box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.shadow-xl{-webkit-box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04)}.shadow-inner{-webkit-box-shadow:inset 0 2px 4px 0 rgba(0,0,0,.06);box-shadow:inset 0 2px 4px 0 rgba(0,0,0,.06)}.hover\:shadow-md:hover{-webkit-box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06)}.focus\:shadow-lg:focus{-webkit-box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.focus\:shadow-outline:focus{-webkit-box-shadow:0 0 0 3px rgba(118,169,250,.45);box-shadow:0 0 0 3px rgba(118,169,250,.45)}.focus\:shadow-outline-blue:focus{-webkit-box-shadow:0 0 0 3px rgba(164,202,254,.45);box-shadow:0 0 0 3px rgba(164,202,254,.45)}.focus\:shadow-outline-red:focus{-webkit-box-shadow:0 0 0 3px rgba(248,180,180,.45);box-shadow:0 0 0 3px rgba(248,180,180,.45)}.focus\:shadow-outline-indigo:focus{-webkit-box-shadow:0 0 0 3px rgba(180,198,252,.45);box-shadow:0 0 0 3px rgba(180,198,252,.45)}.table-fixed{table-layout:fixed}.text-left{text-align:left}.text-center{text-align:center}.text-white{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.text-black{--text-opacity:1;color:#000;color:rgba(0,0,0,var(--text-opacity))}.text-gray-400{--text-opacity:1;color:#9fa6b2;color:rgba(159,166,178,var(--text-opacity))}.text-gray-500{--text-opacity:1;color:#6b7280;color:rgba(107,114,128,var(--text-opacity))}.text-gray-600{--text-opacity:1;color:#4b5563;color:rgba(75,85,99,var(--text-opacity))}.text-gray-700{--text-opacity:1;color:#374151;color:rgba(55,65,81,var(--text-opacity))}.text-gray-800{--text-opacity:1;color:#252f3f;color:rgba(37,47,63,var(--text-opacity))}.text-gray-900{--text-opacity:1;color:#161e2e;color:rgba(22,30,46,var(--text-opacity))}.text-red-600{--text-opacity:1;color:#e02424;color:rgba(224,36,36,var(--text-opacity))}.text-red-800{--text-opacity:1;color:#9b1c1c;color:rgba(155,28,28,var(--text-opacity))}.text-orange-400{--text-opacity:1;color:#ff8a4c;color:rgba(255,138,76,var(--text-opacity))}.text-orange-500{--text-opacity:1;color:#ff5a1f;color:rgba(255,90,31,var(--text-opacity))}.text-yellow-400{--text-opacity:1;color:#e3a008;color:rgba(227,160,8,var(--text-opacity))}.text-green-400{--text-opacity:1;color:#31c48d;color:rgba(49,196,141,var(--text-opacity))}.text-green-600{--text-opacity:1;color:#057a55;color:rgba(5,122,85,var(--text-opacity))}.text-green-800{--text-opacity:1;color:#03543f;color:rgba(3,84,63,var(--text-opacity))}.text-teal-400{--text-opacity:1;color:#16bdca;color:rgba(22,189,202,var(--text-opacity))}.text-teal-500{--text-opacity:1;color:#0694a2;color:rgba(6,148,162,var(--text-opacity))}.text-teal-700{--text-opacity:1;color:#036672;color:rgba(3,102,114,var(--text-opacity))}.text-blue-400{--text-opacity:1;color:#76a9fa;color:rgba(118,169,250,var(--text-opacity))}.text-blue-500{--text-opacity:1;color:#3f83f8;color:rgba(63,131,248,var(--text-opacity))}.text-blue-700{--text-opacity:1;color:#1a56db;color:rgba(26,86,219,var(--text-opacity))}.text-blue-800{--text-opacity:1;color:#1e429f;color:rgba(30,66,159,var(--text-opacity))}.text-indigo-100{--text-opacity:1;color:#e5edff;color:rgba(229,237,255,var(--text-opacity))}.text-indigo-400{--text-opacity:1;color:#8da2fb;color:rgba(141,162,251,var(--text-opacity))}.text-indigo-500{--text-opacity:1;color:#6875f5;color:rgba(104,117,245,var(--text-opacity))}.text-indigo-600{--text-opacity:1;color:#5850ec;color:rgba(88,80,236,var(--text-opacity))}.hover\:text-white:hover{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.hover\:text-gray-800:hover{--text-opacity:1;color:#252f3f;color:rgba(37,47,63,var(--text-opacity))}.hover\:text-gray-900:hover{--text-opacity:1;color:#161e2e;color:rgba(22,30,46,var(--text-opacity))}.hover\:text-blue-700:hover{--text-opacity:1;color:#1a56db;color:rgba(26,86,219,var(--text-opacity))}.hover\:text-indigo-500:hover{--text-opacity:1;color:#6875f5;color:rgba(104,117,245,var(--text-opacity))}.focus\:text-white:focus{--text-opacity:1;color:#fff;color:rgba(255,255,255,var(--text-opacity))}.focus\:text-gray-900:focus{--text-opacity:1;color:#161e2e;color:rgba(22,30,46,var(--text-opacity))}.active\:text-indigo-600:active{--text-opacity:1;color:#5850ec;color:rgba(88,80,236,var(--text-opacity))}.italic{font-style:italic}.not-italic{font-style:normal}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.underline{text-decoration:underline}.no-underline{text-decoration:none}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.align-middle{vertical-align:middle}.whitespace-no-wrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.w-0{width:0}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-10{width:2.5rem}.w-40{width:10rem}.w-56{width:14rem}.w-auto{width:auto}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-2\/3{width:66.666667%}.w-1\/4{width:25%}.w-2\/4{width:50%}.w-3\/4{width:75%}.w-1\/5{width:20%}.w-2\/5{width:40%}.w-3\/5{width:60%}.w-4\/5{width:80%}.w-3\/6{width:50%}.w-4\/6{width:66.666667%}.w-5\/6{width:83.333333%}.w-1\/12{width:8.333333%}.w-2\/12{width:16.666667%}.w-3\/12{width:25%}.w-4\/12{width:33.333333%}.w-9\/12{width:75%}.w-11\/12{width:91.666667%}.w-full{width:100%}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.gap-8{grid-gap:2rem;gap:2rem}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.transform{--transform-translate-x:0;--transform-translate-y:0;--transform-rotate:0;--transform-skew-x:0;--transform-skew-y:0;--transform-scale-x:1;--transform-scale-y:1;-webkit-transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y));transform:translateX(var(--transform-translate-x)) translateY(var(--transform-translate-y)) rotate(var(--transform-rotate)) skewX(var(--transform-skew-x)) skewY(var(--transform-skew-y)) scaleX(var(--transform-scale-x)) scaleY(var(--transform-scale-y))}.origin-top-right{-webkit-transform-origin:top right;transform-origin:top right}.scale-95{--transform-scale-x:.95;--transform-scale-y:.95}.scale-100{--transform-scale-x:1;--transform-scale-y:1}.transition-all{-webkit-transition-property:all;transition-property:all}.transition{-webkit-transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,-webkit-box-shadow,-webkit-transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,-webkit-box-shadow,-webkit-transform}.ease-in{-webkit-transition-timing-function:cubic-bezier(.4,0,1,1);transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{-webkit-transition-timing-function:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in-out{-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-75{-webkit-transition-duration:75ms;transition-duration:75ms}.duration-100{-webkit-transition-duration:.1s;transition-duration:.1s}.duration-150{-webkit-transition-duration:.15s;transition-duration:.15s}.duration-300{-webkit-transition-duration:.3s;transition-duration:.3s}@media (min-width:640px){.sm\:rounded{border-radius:.25rem}.sm\:rounded-md{border-radius:.375rem}.sm\:rounded-lg{border-radius:.5rem}.sm\:border-r{border-right-width:1px}.sm\:border-l{border-left-width:1px}.sm\:grid{display:grid}.sm\:justify-start{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.sm\:text-sm{font-size:.875rem}.sm\:text-2xl{font-size:1.5rem}.sm\:text-3xl{font-size:1.875rem}.sm\:leading-5{line-height:1.25rem}.sm\:leading-7{line-height:1.75rem}.sm\:leading-9{line-height:2.25rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-2{padding-left:.5rem;padding-right:.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sm\:w-32{width:8rem}.sm\:w-1\/3{width:33.333333%}.sm\:w-2\/3{width:66.666667%}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:768px){.md\:flex{display:-webkit-box;display:-ms-flexbox;display:flex}.md\:items-start{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.md\:items-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.md\:justify-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.md\:justify-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.md\:text-base{font-size:1rem}.md\:mx-0{margin-left:0;margin-right:0}.md\:my-2{margin-top:.5rem;margin-bottom:.5rem}.md\:mt-0{margin-top:0}.md\:ml-2{margin-left:.5rem}.md\:ml-4{margin-left:1rem}.md\:ml-8{margin-left:2rem}.md\:-mr-8{margin-right:-2rem}.md\:max-w-xl{max-width:36rem}.md\:max-w-5xl{max-width:64rem}.md\:p-2{padding:.5rem}.md\:p-6{padding:1.5rem}.md\:py-0{padding-top:0;padding-bottom:0}.md\:px-1{padding-left:.25rem;padding-right:.25rem}.md\:px-2{padding-left:.5rem;padding-right:.5rem}.md\:pb-2{padding-bottom:.5rem}.md\:pr-4{padding-right:1rem}.md\:pt-6{padding-top:1.5rem}.md\:w-3\/5{width:60%}}@media (min-width:1024px){.lg\:bg-transparent{background-color:transparent}.lg\:border-transparent{border-color:transparent}.lg\:rounded-full{border-radius:9999px}.lg\:block{display:block}.lg\:inline-flex{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.lg\:grid{display:grid}.lg\:text-sm{font-size:.875rem}.lg\:text-lg{font-size:1.125rem}.lg\:my-0{margin-top:0;margin-bottom:0}.lg\:mx-5{margin-left:1.25rem;margin-right:1.25rem}.lg\:ml-16{margin-left:4rem}.lg\:-mr-16{margin-right:-4rem}.lg\:p-6{padding:1.5rem}.lg\:p-8{padding:2rem}.lg\:px-3{padding-left:.75rem;padding-right:.75rem}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:pt-2{padding-top:.5rem}.lg\:pb-2{padding-bottom:.5rem}.lg\:pl-2{padding-left:.5rem}.lg\:shadow-none{-webkit-box-shadow:none;box-shadow:none}.lg\:w-40{width:10rem}.lg\:w-1\/2{width:50%}.lg\:w-3\/5{width:60%}.lg\:w-3\/12{width:25%}.lg\:w-7\/12{width:58.333333%}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:1280px){.xl\:mx-7{margin-left:1.75rem;margin-right:1.75rem}.xl\:mr-0{margin-right:0}.xl\:ml-3{margin-left:.75rem}.xl\:ml-4{margin-left:1rem}.xl\:ml-20{margin-left:5rem}.xl\:px-4{padding-left:1rem;padding-right:1rem}.xl\:pb-4{padding-bottom:1rem}.xl\:w-1\/4{width:25%}.xl\:w-2\/5{width:40%}.xl\:w-3\/5{width:60%}.xl\:w-2\/12{width:16.666667%}.xl\:w-7\/12{width:58.333333%}}
|
lite/admin/js/email-subscribers-admin.js
CHANGED
@@ -50,7 +50,7 @@
|
|
50 |
$fieldset.find('#broadcast_button').hide();
|
51 |
|
52 |
$('#content_menu').removeClass("active");
|
53 |
-
|
54 |
//$('.active').removeClass('active').next().addClass('active');
|
55 |
|
56 |
// Trigger template content changed event to update email preview.
|
@@ -68,7 +68,7 @@
|
|
68 |
$fieldset.find('#broadcast_button1, #broadcast_button2').hide();
|
69 |
|
70 |
$('#summary_menu').removeClass("active");
|
71 |
-
|
72 |
//$('.active').removeClass('active').prev().addClass('active');
|
73 |
|
74 |
});
|
@@ -76,7 +76,7 @@
|
|
76 |
$("input:radio[name='broadcast_data[scheduling_option]']").click(function() {
|
77 |
|
78 |
let scheduling_option = $(this).val();
|
79 |
-
if( 'schedule_later' === scheduling_option ) {
|
80 |
$('.display_schedule').removeClass('hidden');
|
81 |
} else {
|
82 |
$('.display_schedule').addClass('hidden');
|
@@ -121,8 +121,8 @@
|
|
121 |
jQuery('.es-audience-view .tablenav.bottom #bulk-action-selector-bottom').hide();
|
122 |
jQuery('.es-audience-view .tablenav.bottom #doaction2').hide();
|
123 |
jQuery(document).on('change', "#base_template_id", function () {
|
124 |
-
var img = jQuery('option:selected', this).data('img')
|
125 |
-
jQuery('.es-templ-img').html(img);
|
126 |
});
|
127 |
|
128 |
//send test emails
|
@@ -171,7 +171,13 @@
|
|
171 |
params = jQuery(form).serializeArray();
|
172 |
params.push({
|
173 |
name: 'action',
|
174 |
-
value: 'es_klawoo_subscribe'
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
});
|
176 |
|
177 |
jQuery.ajax({
|
@@ -242,11 +248,11 @@
|
|
242 |
var campaign_type = $(this).val();
|
243 |
$('#ig_es_filter_campaign_status_by_type').val('');
|
244 |
campaign_status(campaign_type);
|
245 |
-
|
246 |
|
247 |
function campaign_status( campaign_type ) {
|
248 |
var $status_id = $('#ig_es_filter_campaign_status_by_type');
|
249 |
-
|
250 |
case 'newsletter':
|
251 |
$status_id.children('option').show();
|
252 |
$('#ig_es_filter_campaign_status_by_type option[value="0"]').html('Draft').show();
|
@@ -272,7 +278,7 @@
|
|
272 |
$('#ig_es_broadcast_list_ids').change(function () {
|
273 |
var selected_list_id = $(this).val();
|
274 |
|
275 |
-
if( ! selected_list_id ) {
|
276 |
jQuery('.ig_es_list_contacts_count').text(0);
|
277 |
return;
|
278 |
}
|
@@ -293,8 +299,8 @@
|
|
293 |
if (response !== '') {
|
294 |
response = JSON.parse(response);
|
295 |
if (response.hasOwnProperty('total')) {
|
296 |
-
var total
|
297 |
-
var total_contacts_text
|
298 |
var total_recipients_text = "<div class='mt-1.5 py-2'><span class='font-medium text-base text-gray-700'><span class='ig_es_list_contacts_count'>" + total + "</span> <span class='text-base font-medium text-gray-700'></span><span class='font-normal text-sm text-gray-500'> recipients </span></div>";
|
299 |
$('#ig_es_total_contacts').html(total_contacts_text);
|
300 |
$('#ig_es_total_recipients').html(total_recipients_text);
|
@@ -344,7 +350,7 @@
|
|
344 |
jQuery('#es_utm_campaign').val(response.es_utm_campaign);
|
345 |
}
|
346 |
|
347 |
-
if( 1 === $('#edit-es-boradcast-body').length ) {
|
348 |
tinyMCE.triggerSave();
|
349 |
$('#edit-es-boradcast-body').trigger('change');
|
350 |
}
|
@@ -401,7 +407,7 @@
|
|
401 |
let checkbox_elem = $(this);
|
402 |
let campaign_id = $(checkbox_elem).val();
|
403 |
let new_campaign_status = $(checkbox_elem).prop('checked') ? 1 : 0;
|
404 |
-
let data
|
405 |
action: 'ig_es_toggle_campaign_status',
|
406 |
campaign_id: campaign_id,
|
407 |
new_campaign_status: new_campaign_status,
|
@@ -431,15 +437,15 @@
|
|
431 |
let is_draft_bttuon = $(trigger_elem).hasClass('ig_es_draft_broadcast');
|
432 |
|
433 |
let broadcast_subject = $('#ig_es_broadcast_subject').val();
|
434 |
-
if( '' === broadcast_subject ) {
|
435 |
-
if( is_draft_bttuon ) {
|
436 |
alert( ig_es_js_data.i18n_data.broadcast_subject_empty_message );
|
437 |
}
|
438 |
return;
|
439 |
}
|
440 |
|
441 |
// If draft button is clicked then change broadcast status to draft..
|
442 |
-
if( is_draft_bttuon ) {
|
443 |
$('#broadcast_status').val(0);
|
444 |
}
|
445 |
|
@@ -460,15 +466,15 @@
|
|
460 |
},
|
461 |
success: function (response) {
|
462 |
if (response.success) {
|
463 |
-
if( 'undefined' !== typeof response.data ) {
|
464 |
let response_data = response.data;
|
465 |
let broadcast_id = response_data.broadcast_id;
|
466 |
$('#broadcast_id').val( broadcast_id );
|
467 |
-
if( is_draft_bttuon ) {
|
468 |
alert( ig_es_js_data.i18n_data.broadcast_draft_success_message );
|
469 |
}
|
470 |
} else {
|
471 |
-
if( is_draft_bttuon ) {
|
472 |
alert( ig_es_js_data.i18n_data.broadcast_draft_error_message );
|
473 |
}
|
474 |
}
|
@@ -499,15 +505,15 @@
|
|
499 |
dataType: 'json',
|
500 |
success: function (response) {
|
501 |
if (response.success) {
|
502 |
-
if( 'undefined' !== typeof response.data ) {
|
503 |
-
let response_data
|
504 |
-
let template_html
|
505 |
let broadcast_subject = response_data.broadcast_subject;
|
506 |
-
let contact_name
|
507 |
-
let contact_email
|
508 |
$('.broadcast_preview_subject').html(broadcast_subject);
|
509 |
$('.broadcast_preview_contact_name').html(contact_name);
|
510 |
-
if( '' !== contact_email ) {
|
511 |
$('.broadcast_preview_contact_email').html( '<' + contact_email + '>');
|
512 |
}
|
513 |
$('.broadcast_preview_content').html(template_html);
|
@@ -528,17 +534,17 @@
|
|
528 |
|
529 |
$(template_button).parent().find('.es-send-success').hide();
|
530 |
$(template_button).parent().find('.es-send-error').hide();
|
531 |
-
if( 'preview_in_popup' === preview_option ) {
|
532 |
ig_es_show_broadcast_preview_in_popup();
|
533 |
-
} else if( 'preview_in_email' === preview_option ) {
|
534 |
ig_es_send_broadcast_preview_email();
|
535 |
}
|
536 |
});
|
537 |
|
538 |
$('#broadcast_form [name="preview_option"]').on('click',function(){
|
539 |
-
let preview_option
|
540 |
|
541 |
-
if( 'preview_in_email' === preview_option ) {
|
542 |
$('#es_test_send_email').show();
|
543 |
} else {
|
544 |
$('#es_test_send_email').hide();
|
@@ -558,14 +564,14 @@ function ig_es_show_broadcast_preview_in_popup() {
|
|
558 |
window.tinyMCE.triggerSave();
|
559 |
|
560 |
let content = jQuery('.wp-editor-boradcast').val();
|
561 |
-
if (jQuery("#wp-edit-es-boradcast-body-wrap").hasClass("tmce-active")){
|
562 |
content = tinyMCE.activeEditor.getContent();
|
563 |
-
}else{
|
564 |
content = jQuery('.wp-editor-boradcast').val();
|
565 |
}
|
566 |
|
567 |
|
568 |
-
if( !content ){
|
569 |
alert( ig_es_js_data.i18n_data.empty_template_message );
|
570 |
return;
|
571 |
}
|
@@ -582,9 +588,9 @@ function ig_es_show_broadcast_preview_in_popup() {
|
|
582 |
dataType: 'json',
|
583 |
success: function (response) {
|
584 |
if (response.success) {
|
585 |
-
if( 'undefined' !== typeof response.data ) {
|
586 |
let response_data = response.data;
|
587 |
-
let template_html
|
588 |
jQuery('.broadcast_preview_container').html(template_html);
|
589 |
jQuery('#preview_template').load().show();
|
590 |
}
|
@@ -602,25 +608,25 @@ function ig_es_show_broadcast_preview_in_popup() {
|
|
602 |
|
603 |
jQuery.fn.extend({
|
604 |
ig_es_select2: function() {
|
605 |
-
|
606 |
-
|
607 |
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
|
612 |
-
|
613 |
|
614 |
-
|
615 |
-
|
616 |
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
|
621 |
-
|
622 |
-
|
|
|
623 |
});
|
624 |
-
});
|
625 |
}
|
626 |
-
});
|
50 |
$fieldset.find('#broadcast_button').hide();
|
51 |
|
52 |
$('#content_menu').removeClass("active");
|
53 |
+
$('#summary_menu').addClass("active");
|
54 |
//$('.active').removeClass('active').next().addClass('active');
|
55 |
|
56 |
// Trigger template content changed event to update email preview.
|
68 |
$fieldset.find('#broadcast_button1, #broadcast_button2').hide();
|
69 |
|
70 |
$('#summary_menu').removeClass("active");
|
71 |
+
$('#content_menu').addClass("active");
|
72 |
//$('.active').removeClass('active').prev().addClass('active');
|
73 |
|
74 |
});
|
76 |
$("input:radio[name='broadcast_data[scheduling_option]']").click(function() {
|
77 |
|
78 |
let scheduling_option = $(this).val();
|
79 |
+
if ( 'schedule_later' === scheduling_option ) {
|
80 |
$('.display_schedule').removeClass('hidden');
|
81 |
} else {
|
82 |
$('.display_schedule').addClass('hidden');
|
121 |
jQuery('.es-audience-view .tablenav.bottom #bulk-action-selector-bottom').hide();
|
122 |
jQuery('.es-audience-view .tablenav.bottom #doaction2').hide();
|
123 |
jQuery(document).on('change', "#base_template_id", function () {
|
124 |
+
var img = jQuery('option:selected', this).data('img-url');
|
125 |
+
jQuery('.es-templ-img').html('<img src="' + img + '"/>');
|
126 |
});
|
127 |
|
128 |
//send test emails
|
171 |
params = jQuery(form).serializeArray();
|
172 |
params.push({
|
173 |
name: 'action',
|
174 |
+
value: 'es_klawoo_subscribe',
|
175 |
+
});
|
176 |
+
|
177 |
+
// Add ajax security nonce.
|
178 |
+
params.push({
|
179 |
+
name: 'security',
|
180 |
+
value: ig_es_js_data.security,
|
181 |
});
|
182 |
|
183 |
jQuery.ajax({
|
248 |
var campaign_type = $(this).val();
|
249 |
$('#ig_es_filter_campaign_status_by_type').val('');
|
250 |
campaign_status(campaign_type);
|
251 |
+
});
|
252 |
|
253 |
function campaign_status( campaign_type ) {
|
254 |
var $status_id = $('#ig_es_filter_campaign_status_by_type');
|
255 |
+
switch (campaign_type) {
|
256 |
case 'newsletter':
|
257 |
$status_id.children('option').show();
|
258 |
$('#ig_es_filter_campaign_status_by_type option[value="0"]').html('Draft').show();
|
278 |
$('#ig_es_broadcast_list_ids').change(function () {
|
279 |
var selected_list_id = $(this).val();
|
280 |
|
281 |
+
if ( ! selected_list_id ) {
|
282 |
jQuery('.ig_es_list_contacts_count').text(0);
|
283 |
return;
|
284 |
}
|
299 |
if (response !== '') {
|
300 |
response = JSON.parse(response);
|
301 |
if (response.hasOwnProperty('total')) {
|
302 |
+
var total = response.total;
|
303 |
+
var total_contacts_text = "<h2 class='text-sm font-normal text-gray-600'>Total Contacts: <span class='text-base font-medium text-gray-700'> <span class='ig_es_list_contacts_count'>" + total + "</span></span></h2>";
|
304 |
var total_recipients_text = "<div class='mt-1.5 py-2'><span class='font-medium text-base text-gray-700'><span class='ig_es_list_contacts_count'>" + total + "</span> <span class='text-base font-medium text-gray-700'></span><span class='font-normal text-sm text-gray-500'> recipients </span></div>";
|
305 |
$('#ig_es_total_contacts').html(total_contacts_text);
|
306 |
$('#ig_es_total_recipients').html(total_recipients_text);
|
350 |
jQuery('#es_utm_campaign').val(response.es_utm_campaign);
|
351 |
}
|
352 |
|
353 |
+
if ( 1 === $('#edit-es-boradcast-body').length ) {
|
354 |
tinyMCE.triggerSave();
|
355 |
$('#edit-es-boradcast-body').trigger('change');
|
356 |
}
|
407 |
let checkbox_elem = $(this);
|
408 |
let campaign_id = $(checkbox_elem).val();
|
409 |
let new_campaign_status = $(checkbox_elem).prop('checked') ? 1 : 0;
|
410 |
+
let data = {
|
411 |
action: 'ig_es_toggle_campaign_status',
|
412 |
campaign_id: campaign_id,
|
413 |
new_campaign_status: new_campaign_status,
|
437 |
let is_draft_bttuon = $(trigger_elem).hasClass('ig_es_draft_broadcast');
|
438 |
|
439 |
let broadcast_subject = $('#ig_es_broadcast_subject').val();
|
440 |
+
if ( '' === broadcast_subject ) {
|
441 |
+
if ( is_draft_bttuon ) {
|
442 |
alert( ig_es_js_data.i18n_data.broadcast_subject_empty_message );
|
443 |
}
|
444 |
return;
|
445 |
}
|
446 |
|
447 |
// If draft button is clicked then change broadcast status to draft..
|
448 |
+
if ( is_draft_bttuon ) {
|
449 |
$('#broadcast_status').val(0);
|
450 |
}
|
451 |
|
466 |
},
|
467 |
success: function (response) {
|
468 |
if (response.success) {
|
469 |
+
if ( 'undefined' !== typeof response.data ) {
|
470 |
let response_data = response.data;
|
471 |
let broadcast_id = response_data.broadcast_id;
|
472 |
$('#broadcast_id').val( broadcast_id );
|
473 |
+
if ( is_draft_bttuon ) {
|
474 |
alert( ig_es_js_data.i18n_data.broadcast_draft_success_message );
|
475 |
}
|
476 |
} else {
|
477 |
+
if ( is_draft_bttuon ) {
|
478 |
alert( ig_es_js_data.i18n_data.broadcast_draft_error_message );
|
479 |
}
|
480 |
}
|
505 |
dataType: 'json',
|
506 |
success: function (response) {
|
507 |
if (response.success) {
|
508 |
+
if ( 'undefined' !== typeof response.data ) {
|
509 |
+
let response_data = response.data;
|
510 |
+
let template_html = response_data.template_html;
|
511 |
let broadcast_subject = response_data.broadcast_subject;
|
512 |
+
let contact_name = response_data.contact_name;
|
513 |
+
let contact_email = response_data.contact_email;
|
514 |
$('.broadcast_preview_subject').html(broadcast_subject);
|
515 |
$('.broadcast_preview_contact_name').html(contact_name);
|
516 |
+
if ( '' !== contact_email ) {
|
517 |
$('.broadcast_preview_contact_email').html( '<' + contact_email + '>');
|
518 |
}
|
519 |
$('.broadcast_preview_content').html(template_html);
|
534 |
|
535 |
$(template_button).parent().find('.es-send-success').hide();
|
536 |
$(template_button).parent().find('.es-send-error').hide();
|
537 |
+
if ( 'preview_in_popup' === preview_option ) {
|
538 |
ig_es_show_broadcast_preview_in_popup();
|
539 |
+
} else if ( 'preview_in_email' === preview_option ) {
|
540 |
ig_es_send_broadcast_preview_email();
|
541 |
}
|
542 |
});
|
543 |
|
544 |
$('#broadcast_form [name="preview_option"]').on('click',function(){
|
545 |
+
let preview_option = $('[name="preview_option"]:checked').val();
|
546 |
|
547 |
+
if ( 'preview_in_email' === preview_option ) {
|
548 |
$('#es_test_send_email').show();
|
549 |
} else {
|
550 |
$('#es_test_send_email').hide();
|
564 |
window.tinyMCE.triggerSave();
|
565 |
|
566 |
let content = jQuery('.wp-editor-boradcast').val();
|
567 |
+
if (jQuery("#wp-edit-es-boradcast-body-wrap").hasClass("tmce-active")) {
|
568 |
content = tinyMCE.activeEditor.getContent();
|
569 |
+
} else {
|
570 |
content = jQuery('.wp-editor-boradcast').val();
|
571 |
}
|
572 |
|
573 |
|
574 |
+
if ( !content ) {
|
575 |
alert( ig_es_js_data.i18n_data.empty_template_message );
|
576 |
return;
|
577 |
}
|
588 |
dataType: 'json',
|
589 |
success: function (response) {
|
590 |
if (response.success) {
|
591 |
+
if ( 'undefined' !== typeof response.data ) {
|
592 |
let response_data = response.data;
|
593 |
+
let template_html = response_data.template_html;
|
594 |
jQuery('.broadcast_preview_container').html(template_html);
|
595 |
jQuery('#preview_template').load().show();
|
596 |
}
|
608 |
|
609 |
jQuery.fn.extend({
|
610 |
ig_es_select2: function() {
|
611 |
+
return this.each(function() {
|
612 |
+
let multiselect_elem = jQuery(this);
|
613 |
|
614 |
+
let first_option_elem = jQuery(multiselect_elem).find('option:first');
|
615 |
+
let first_option_vallue = jQuery(first_option_elem).attr('value');
|
616 |
+
let placeholder_label = '';
|
617 |
|
618 |
+
if ( '' === first_option_vallue || '0' === first_option_vallue ) {
|
619 |
|
620 |
+
// Get placeholder label from the first option.
|
621 |
+
placeholder_label = jQuery(first_option_elem).text();
|
622 |
|
623 |
+
// Remove it from option to avoid being shown and allowing users to select it as an option in Select2's options panel.
|
624 |
+
jQuery(first_option_elem).remove();
|
625 |
+
}
|
626 |
|
627 |
+
jQuery(multiselect_elem).select2({
|
628 |
+
placeholder: placeholder_label, // Add placeholder label using first option's text.
|
629 |
+
});
|
630 |
});
|
|
|
631 |
}
|
632 |
+
});
|
lite/admin/js/es-onboarding.js
CHANGED
@@ -1,67 +1,67 @@
|
|
1 |
jQuery(document).ready(function() {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
|
54 |
-
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
|
60 |
-
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
|
67 |
-
});
|
1 |
jQuery(document).ready(function() {
|
2 |
+
jQuery('.sp').first().addClass('active');
|
3 |
+
jQuery('.sp').hide();
|
4 |
+
jQuery('.active').show();
|
5 |
|
6 |
+
if (jQuery('.es-send-email-screen').hasClass('active')) {
|
7 |
+
jQuery('#button-send').addClass('es-send-email');
|
8 |
+
}
|
9 |
|
10 |
+
jQuery(document).on('click', '.es-send-email', function() {
|
11 |
+
if (jQuery("#es-send-email-form")[0].checkValidity()) {
|
12 |
+
jQuery('.es-send-email-screen .es-loader').show();
|
13 |
+
var emails = [];
|
14 |
+
jQuery(".es_email").each(function() {
|
15 |
+
if ((jQuery.trim(jQuery(this).val()).length > 0)) {
|
16 |
+
emails.push(jQuery(this).val());
|
17 |
+
}
|
18 |
+
});
|
19 |
+
var es_from_name = jQuery('.es_from_name').val();
|
20 |
+
var es_from_email = jQuery('.es_from_email').val();
|
21 |
+
var params = {
|
22 |
+
type: 'POST',
|
23 |
+
url: ajaxurl,
|
24 |
+
data: {
|
25 |
+
action: 'send_test_email',
|
26 |
+
emails: emails,
|
27 |
+
es_from_name: es_from_name,
|
28 |
+
es_from_email: es_from_email,
|
29 |
+
security: ig_es_js_data.security
|
30 |
+
},
|
31 |
+
dataType: 'json',
|
32 |
+
success: function(data, status, xhr) {
|
33 |
|
34 |
+
jQuery('.es-send-email-screen .es-loader').find('img').hide();
|
35 |
+
jQuery('.active').fadeOut('fast').removeClass('active');
|
36 |
+
jQuery('#button-send').hide();
|
37 |
+
if (data.status == 'SUCCESS') {
|
38 |
+
jQuery('.sp.es-success').addClass('active').fadeIn('slow');
|
39 |
+
} else if (data.status == 'ERROR') {
|
40 |
+
jQuery('.sp.es-error').find('.es-email-sending-error').html('<i class="dashicons dashicons-es dashicons-no-alt" style="color: #e66060"></i>' + data.message);
|
41 |
+
jQuery('.sp.es-error').addClass('active').fadeIn('slow');
|
42 |
+
jQuery('#button-send').hide();
|
43 |
+
}
|
44 |
+
},
|
45 |
+
error: function(data, status, xhr) {}
|
46 |
+
};
|
47 |
|
48 |
+
jQuery.ajax(params);
|
49 |
+
} else {
|
50 |
+
jQuery(".es_email").addClass('error');
|
51 |
+
jQuery("#es-send-email-form")[0].reportValidity();
|
52 |
+
}
|
53 |
|
54 |
+
});
|
55 |
|
56 |
+
jQuery(document).on('click', '.es-receive-success-btn', function() {
|
57 |
+
jQuery('.active').fadeOut('fast').removeClass('active');
|
58 |
+
jQuery('.sp.es-receive-success').fadeIn('slow').addClass('active');
|
59 |
|
60 |
+
});
|
61 |
|
62 |
+
jQuery(document).on('click', '.es-receive-error-btn', function() {
|
63 |
+
jQuery('.active').fadeOut('fast').removeClass('active');
|
64 |
+
jQuery('.sp.es-receive-error').fadeIn('slow').addClass('active');
|
65 |
+
});
|
66 |
|
67 |
+
});
|
lite/admin/js/ig-es-workflows.js
CHANGED
@@ -23,14 +23,14 @@
|
|
23 |
});
|
24 |
|
25 |
let d = new Date();
|
26 |
-
|
27 |
$('.ig-es-time-picker').timepicker({
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
minTime: new Date(0,0,0,n,0,0)
|
35 |
});
|
36 |
},
|
@@ -46,7 +46,7 @@
|
|
46 |
return;
|
47 |
}
|
48 |
|
49 |
-
state
|
50 |
new_state = state === 'active' ? 'inactive' : 'active';
|
51 |
|
52 |
$switch.addClass('ig-es-loading');
|
@@ -71,64 +71,58 @@
|
|
71 |
init_show_hide: function() {
|
72 |
|
73 |
let update = function( $el ) {
|
74 |
-
let id
|
75 |
-
let value
|
76 |
let is_checkbox = $el.is('input[type="checkbox"]');
|
77 |
|
78 |
$('[data-ig-es-show]').each(function() {
|
79 |
if ( is_checkbox && $(this).data('ig-es-show') === id ) {
|
80 |
if ( $el.is(':checked') ) {
|
81 |
-
|
|
|
|
|
82 |
}
|
83 |
-
|
84 |
-
|
85 |
-
}
|
86 |
-
}
|
87 |
-
else {
|
88 |
-
let logic = $(this).data('ig-es-show').split('=');
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
|
94 |
-
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
}
|
102 |
}
|
103 |
});
|
104 |
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
else {
|
128 |
-
$(this).show();
|
129 |
-
}
|
130 |
}
|
131 |
-
|
132 |
};
|
133 |
|
134 |
|
@@ -166,13 +160,13 @@
|
|
166 |
|
167 |
let workflow_id = $('#workflow_id').val();
|
168 |
$.ajax({
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
})
|
177 |
.done(function(response){
|
178 |
|
@@ -211,8 +205,7 @@
|
|
211 |
|
212 |
if ($action.is('.js-open')) {
|
213 |
IG_ES_Workflows.action_edit_close($action);
|
214 |
-
}
|
215 |
-
else {
|
216 |
IG_ES_Workflows.action_edit_open($action);
|
217 |
}
|
218 |
});
|
@@ -227,17 +220,29 @@
|
|
227 |
$('#ig_es_workflow_save #publish').on('click', function(e){
|
228 |
let trigger_name = $('.js-trigger-select').val();
|
229 |
|
230 |
-
if( '' === trigger_name) {
|
231 |
e.preventDefault();
|
232 |
alert( ig_es_workflows_data.no_trigger_message );
|
233 |
return;
|
234 |
}
|
235 |
|
236 |
-
let
|
237 |
-
if( 0 ===
|
238 |
e.preventDefault();
|
239 |
alert( ig_es_workflows_data.no_actions_message );
|
240 |
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
}
|
242 |
});
|
243 |
},
|
@@ -329,9 +334,9 @@
|
|
329 |
|
330 |
remove_actions: function() {
|
331 |
let number_of_actions = IG_ES_Workflows.get_number_of_actions();
|
332 |
-
if( number_of_actions > 0 ) {
|
333 |
let confirm_trigger_change = window.confirm( ig_es_workflows_data.trigger_change_message );
|
334 |
-
if( confirm_trigger_change ) {
|
335 |
$('.ig-es-action:not([data-action-number=""])').remove();
|
336 |
}
|
337 |
}
|
23 |
});
|
24 |
|
25 |
let d = new Date();
|
26 |
+
let n = d.getHours() + 1;
|
27 |
$('.ig-es-time-picker').timepicker({
|
28 |
+
timeFormat: 'H:mm',
|
29 |
+
interval: 15,
|
30 |
+
startTime: new Date(0,0,0,n,0,0),
|
31 |
+
dynamic: true,
|
32 |
+
dropdown: true,
|
33 |
+
scrollbar: false,
|
34 |
minTime: new Date(0,0,0,n,0,0)
|
35 |
});
|
36 |
},
|
46 |
return;
|
47 |
}
|
48 |
|
49 |
+
state = $switch.attr( 'data-ig-es-switch' );
|
50 |
new_state = state === 'active' ? 'inactive' : 'active';
|
51 |
|
52 |
$switch.addClass('ig-es-loading');
|
71 |
init_show_hide: function() {
|
72 |
|
73 |
let update = function( $el ) {
|
74 |
+
let id = $el.data( 'ig-es-bind' );
|
75 |
+
let value = $el.val();
|
76 |
let is_checkbox = $el.is('input[type="checkbox"]');
|
77 |
|
78 |
$('[data-ig-es-show]').each(function() {
|
79 |
if ( is_checkbox && $(this).data('ig-es-show') === id ) {
|
80 |
if ( $el.is(':checked') ) {
|
81 |
+
$(this).show();
|
82 |
+
} else {
|
83 |
+
$(this).hide();
|
84 |
}
|
85 |
+
} else {
|
86 |
+
let logic = $(this).data('ig-es-show').split('=');
|
|
|
|
|
|
|
|
|
87 |
|
88 |
+
if ( logic[0] !== id ) {
|
89 |
+
return;
|
90 |
+
}
|
91 |
|
92 |
+
let possible_values = logic[1].split('|');
|
93 |
|
94 |
+
if ( possible_values.indexOf( value ) !== -1 ) {
|
95 |
+
$(this).show();
|
96 |
+
} else {
|
97 |
+
$(this).hide();
|
98 |
+
}
|
|
|
99 |
}
|
100 |
});
|
101 |
|
102 |
|
103 |
+
$('[data-ig-es-hide]').each(function() {
|
104 |
+
if ( is_checkbox && $(this).data('ig-es-hide') === id ) {
|
105 |
+
if ( $el.is(':checked') ) {
|
106 |
+
$(this).hide();
|
107 |
+
} else {
|
108 |
+
$(this).show();
|
109 |
+
}
|
110 |
+
} else {
|
111 |
+
let logic = $(this).data('ig-es-hide').split('=');
|
112 |
+
|
113 |
+
if ( logic[0] !== id ) {
|
114 |
+
return;
|
115 |
+
}
|
116 |
+
|
117 |
+
let possible_values = logic[1].split('|');
|
118 |
+
|
119 |
+
if ( possible_values.indexOf( value ) !== -1 ) {
|
120 |
+
$(this).hide();
|
121 |
+
} else {
|
122 |
+
$(this).show();
|
123 |
+
}
|
|
|
|
|
|
|
124 |
}
|
125 |
+
});
|
126 |
};
|
127 |
|
128 |
|
160 |
|
161 |
let workflow_id = $('#workflow_id').val();
|
162 |
$.ajax({
|
163 |
+
url: ajaxurl,
|
164 |
+
data: {
|
165 |
+
action: 'ig_es_fill_trigger_fields',
|
166 |
+
trigger_name: trigger_name,
|
167 |
+
security: ig_es_workflows_data.security,
|
168 |
+
workflow_id: workflow_id
|
169 |
+
}
|
170 |
})
|
171 |
.done(function(response){
|
172 |
|
205 |
|
206 |
if ($action.is('.js-open')) {
|
207 |
IG_ES_Workflows.action_edit_close($action);
|
208 |
+
} else {
|
|
|
209 |
IG_ES_Workflows.action_edit_open($action);
|
210 |
}
|
211 |
});
|
220 |
$('#ig_es_workflow_save #publish').on('click', function(e){
|
221 |
let trigger_name = $('.js-trigger-select').val();
|
222 |
|
223 |
+
if ( '' === trigger_name) {
|
224 |
e.preventDefault();
|
225 |
alert( ig_es_workflows_data.no_trigger_message );
|
226 |
return;
|
227 |
}
|
228 |
|
229 |
+
let actions = $('.ig-es-action:not([data-action-number=""]) .js-action-select');
|
230 |
+
if ( 0 === $( actions ).length ) {
|
231 |
e.preventDefault();
|
232 |
alert( ig_es_workflows_data.no_actions_message );
|
233 |
return;
|
234 |
+
} else {
|
235 |
+
$(actions).each(function() {
|
236 |
+
let action_name = $(this).val();
|
237 |
+
// Check if user have selected an action or not.
|
238 |
+
if( '' === action_name ) {
|
239 |
+
e.preventDefault();
|
240 |
+
// Open the action accordion if is not already open.
|
241 |
+
$(this).closest('.ig-es-action:not(.js-open)').find('.ig-es-action__header').trigger('click');
|
242 |
+
alert( ig_es_workflows_data.no_action_selected_message );
|
243 |
+
return false;
|
244 |
+
}
|
245 |
+
});
|
246 |
}
|
247 |
});
|
248 |
},
|
334 |
|
335 |
remove_actions: function() {
|
336 |
let number_of_actions = IG_ES_Workflows.get_number_of_actions();
|
337 |
+
if ( number_of_actions > 0 ) {
|
338 |
let confirm_trigger_change = window.confirm( ig_es_workflows_data.trigger_change_message );
|
339 |
+
if ( confirm_trigger_change ) {
|
340 |
$('.ig-es-action:not([data-action-number=""])').remove();
|
341 |
}
|
342 |
}
|
lite/admin/partials/admin-header.php
CHANGED
@@ -7,14 +7,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
function header_part() {
|
9 |
$screen = get_current_screen();
|
10 |
-
if ( $screen->parent_base
|
11 |
?>
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
<?php
|
19 |
}
|
20 |
}
|
@@ -22,4 +22,4 @@ function header_part() {
|
|
22 |
// add_action( 'admin_notices', 'header_part' );
|
23 |
|
24 |
|
25 |
-
?>
|
7 |
|
8 |
function header_part() {
|
9 |
$screen = get_current_screen();
|
10 |
+
if ( 'es_dashboard' == $screen->parent_base || 'es_template' == $screen->id || 'admin_page_es_template_preview' == $screen->parent_base ) {
|
11 |
?>
|
12 |
|
13 |
+
<div class="headerpart">
|
14 |
+
<div class="esbgheader">
|
15 |
+
<h1>Email Subscribers V4.0</h1>
|
16 |
+
</div>
|
17 |
+
</div>
|
18 |
<?php
|
19 |
}
|
20 |
}
|
22 |
// add_action( 'admin_notices', 'header_part' );
|
23 |
|
24 |
|
25 |
+
?>
|
lite/admin/partials/dashboard.php
CHANGED
@@ -5,9 +5,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
5 |
}
|
6 |
|
7 |
|
8 |
-
$current_user = wp_get_current_user();
|
9 |
-
$current_user_email = $current_user->user_email;
|
10 |
-
|
11 |
$reports_data = ES_Reports_Data::get_dashboard_reports_data( true );
|
12 |
|
13 |
$active_contacts = isset( $reports_data['total_contacts'] ) ? $reports_data['total_contacts'] : 0;
|
@@ -26,10 +23,11 @@ $avg_click_rate = isset( $reports_data['avg_click_rate'] ) ? $reports_data['
|
|
26 |
$contacts_growth = isset( $reports_data['contacts_growth'] ) ? $reports_data['contacts_growth'] : array();
|
27 |
$campaigns = isset( $reports_data['campaigns'] ) ? $reports_data['campaigns'] : array();
|
28 |
|
29 |
-
$labels =
|
|
|
30 |
if ( ! empty( $contacts_growth ) ) {
|
31 |
-
$labels =
|
32 |
-
$values =
|
33 |
}
|
34 |
|
35 |
$audience_url = admin_url( 'admin.php?page=es_subscribers' );
|
@@ -52,155 +50,163 @@ $topics_indexes = array_rand( $topics, 3 );
|
|
52 |
|
53 |
?>
|
54 |
<div class="wrap" id="ig-es-container">
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
<?php
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
<?php
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
<?php echo $total_email_opens; ?>
|
134 |
-
|
135 |
-
|
136 |
-
<?php
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
<?php echo $avg_open_rate; ?> %
|
142 |
-
|
143 |
-
|
144 |
-
<?php
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
<?php echo $total_message_sent; ?>
|
150 |
-
|
151 |
-
|
152 |
-
<?php
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
<?php echo $avg_click_rate; ?> %
|
158 |
-
|
159 |
-
|
160 |
-
<?php
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
<?php foreach ( $topics_indexes as $index ) { ?>
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
<?php
|
176 |
-
|
177 |
-
|
|
|
|
|
178 |
<?php } ?>
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
<?php } ?>
|
189 |
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
|
205 |
|
206 |
<?php
|
@@ -209,7 +215,7 @@ $topics_indexes = array_rand( $topics, 3 );
|
|
209 |
}
|
210 |
?>
|
211 |
|
212 |
-
|
213 |
</div>
|
214 |
|
215 |
<script type="text/javascript">
|
@@ -231,17 +237,25 @@ $topics_indexes = array_rand( $topics, 3 );
|
|
231 |
$('#ig-es-create-dropdown').toggle();
|
232 |
});
|
233 |
|
234 |
-
var labels =
|
235 |
-
|
|
|
|
|
236 |
} else {
|
237 |
echo "''";
|
238 |
-
}
|
239 |
-
|
240 |
-
|
241 |
-
|
|
|
|
|
|
|
|
|
242 |
} else {
|
243 |
echo "''";
|
244 |
-
}
|
|
|
|
|
245 |
|
246 |
if (labels != '' && values != '') {
|
247 |
const data = {
|
5 |
}
|
6 |
|
7 |
|
|
|
|
|
|
|
8 |
$reports_data = ES_Reports_Data::get_dashboard_reports_data( true );
|
9 |
|
10 |
$active_contacts = isset( $reports_data['total_contacts'] ) ? $reports_data['total_contacts'] : 0;
|
23 |
$contacts_growth = isset( $reports_data['contacts_growth'] ) ? $reports_data['contacts_growth'] : array();
|
24 |
$campaigns = isset( $reports_data['campaigns'] ) ? $reports_data['campaigns'] : array();
|
25 |
|
26 |
+
$labels = '';
|
27 |
+
$values = '';
|
28 |
if ( ! empty( $contacts_growth ) ) {
|
29 |
+
$labels = array_keys( $contacts_growth );
|
30 |
+
$values = array_values( $contacts_growth );
|
31 |
}
|
32 |
|
33 |
$audience_url = admin_url( 'admin.php?page=es_subscribers' );
|
50 |
|
51 |
?>
|
52 |
<div class="wrap" id="ig-es-container">
|
53 |
+
<header class="px-4 mx-auto max-w-7xl sm:px-6 lg:px-8">
|
54 |
+
<div class="md:flex md:items-center md:justify-between">
|
55 |
+
<div class="flex-1 min-w-0">
|
56 |
+
<h2 class="text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:leading-9 sm:truncate">
|
57 |
+
<?php echo esc_html__( 'Dashboard', 'email-subscribers' ); ?>
|
58 |
+
</h2>
|
59 |
+
</div>
|
60 |
+
<div class="flex mt-4 md:mt-0 md:ml-4">
|
61 |
+
<a href="<?php echo esc_url( $audience_url ); ?>">
|
62 |
+
<span class="rounded-md shadow-sm">
|
63 |
+
<button type="button" class="inline-flex items-center px-4 py-2 text-sm font-medium leading-5 text-gray-700 transition duration-150 ease-in-out bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:shadow-outline focus:border-blue-300">
|
64 |
+
<?php echo esc_html__( 'Audience', 'email-subscribers' ); ?>
|
65 |
+
</button>
|
66 |
+
</span>
|
67 |
+
</a>
|
68 |
+
<span class="ml-3 rounded-md shadow-sm">
|
69 |
+
<div id="ig-es-create-button" class="relative inline-block text-left">
|
70 |
+
<div>
|
71 |
+
<span class="rounded-md shadow-sm">
|
72 |
+
<button type="button" class="w-full ig-es-primary-button">
|
73 |
+
<?php echo esc_html__( 'Create', 'email-subscribers' ); ?>
|
74 |
+
<svg class="w-5 h-5 ml-2 -mr-1" fill="currentColor" viewBox="0 0 20 20">
|
75 |
+
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
76 |
+
</svg>
|
77 |
+
</button>
|
78 |
+
</span>
|
79 |
+
</div>
|
80 |
+
<div x-show="open" id="ig-es-create-dropdown" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100"
|
81 |
+
x-transition:leave-end="transform opacity-0 scale-95" class="absolute right-0 hidden w-56 mt-2 origin-top-right rounded-md shadow-lg">
|
82 |
+
<div class="bg-white rounded-md shadow-xs">
|
83 |
+
<div class="py-1">
|
84 |
+
<a href="<?php echo esc_url( $new_broadcast_url ); ?>" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"><?php echo esc_html__( 'New Broadcast', 'email-subscribers' ); ?></a>
|
85 |
+
|
86 |
+
<a href="<?php echo esc_url( $new_post_notification_url ); ?>" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"><?php echo esc_html__( 'New Post Notification', 'email-subscribers' ); ?></a>
|
87 |
+
|
88 |
+
<?php if ( ES()->is_pro() ) { ?>
|
89 |
+
<a href="<?php echo esc_url( $new_sequence_url ); ?>" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"><?php echo esc_html__( 'New Sequence', 'email-subscribers' ); ?></a>
|
90 |
+
<?php } else { ?>
|
91 |
+
<a href="<?php echo esc_url( $icegram_pricing_url ); ?>" target="_blank" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"><?php echo esc_html__( 'New Sequence', 'email-subscribers' ); ?>
|
92 |
+
<span class="inline-flex px-2 text-xs font-semibold leading-5 text-green-800 bg-green-100 rounded-full"><?php echo esc_html__( 'Premium', 'email-subscribers' ); ?></span></a>
|
93 |
+
<?php } ?>
|
94 |
+
</div>
|
95 |
+
<div class="border-t border-gray-100"></div>
|
96 |
+
<div class="py-1">
|
97 |
+
<a href="<?php echo esc_url( $new_template_url ); ?>" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"><?php echo esc_html__( 'New Template', 'email-subscribers' ); ?></a>
|
98 |
+
</div>
|
99 |
+
<div class="border-t border-gray-100"></div>
|
100 |
+
<div class="py-1">
|
101 |
+
<a href="<?php echo esc_url( $new_form_url ); ?>" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"><?php echo esc_html__( 'New Form', 'email-subscribers' ); ?></a>
|
102 |
+
<a href="<?php echo esc_url( $new_list_url ); ?>" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"><?php echo esc_html__( 'New List', 'email-subscribers' ); ?></a>
|
103 |
+
<a href="<?php echo esc_url( $new_contact_url ); ?>" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900"><?php echo esc_html__( 'New Contact', 'email-subscribers' ); ?></a>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
</div>
|
108 |
+
</span>
|
109 |
+
</div>
|
110 |
+
</div>
|
111 |
+
</header>
|
112 |
+
|
113 |
+
<main class="mx-auto max-w-7xl sm:px-6 lg:px-8">
|
114 |
+
|
115 |
+
<section class="py-4 my-8 bg-white rounded-lg shadow md:flex md:items-start md:justify-between sm:px-4 sm:px-0 sm:grid sm:grid-cols-3">
|
116 |
+
<div class="flex-1 min-w-0">
|
117 |
+
<p class="px-3 text-lg font-medium leading-6 text-gray-400">
|
118 |
+
<span class="text-black"><?php echo esc_html( $active_contacts ); ?></span><?php echo esc_html__( ' active contacts', 'email-subscribers' ); ?>
|
119 |
+
</p>
|
120 |
+
<div class="text-center bg-white-100" id="ig-es-contacts-growth">
|
121 |
+
|
122 |
+
</div>
|
123 |
+
</div>
|
124 |
+
<div class="flex-1 min-w-0">
|
125 |
+
<p class="px-3 text-lg font-medium leading-6 text-gray-400">
|
126 |
+
<?php echo esc_html__( 'Last 60 days', 'email-subscribers' ); ?>
|
127 |
+
</p>
|
128 |
+
<div class="sm:grid sm:grid-cols-2">
|
129 |
+
<div class="p-3">
|
130 |
+
<p class="text-2xl font-bold leading-none text-indigo-600">
|
131 |
+
<?php echo esc_html( $total_email_opens ); ?>
|
132 |
+
</p>
|
133 |
+
<p class="mt-1 font-medium leading-6 text-gray-500">
|
134 |
+
<?php echo esc_html__( 'Opens', 'email-subscribers' ); ?>
|
135 |
+
</p>
|
136 |
+
</div>
|
137 |
+
<div class="p-3">
|
138 |
+
<p class="text-2xl font-bold leading-none text-indigo-600">
|
139 |
+
<?php echo esc_html( $avg_open_rate ); ?> %
|
140 |
+
</p>
|
141 |
+
<p class="mt-1 font-medium leading-6 text-gray-500">
|
142 |
+
<?php echo esc_html__( ' Avg Open Rate', 'email-subscribers' ); ?>
|
143 |
+
</p>
|
144 |
+
</div>
|
145 |
+
<div class="p-3">
|
146 |
+
<p class="text-2xl font-bold leading-none text-indigo-600">
|
147 |
+
<?php echo esc_html( $total_message_sent ); ?>
|
148 |
+
</p>
|
149 |
+
<p class="mt-1 font-medium leading-6 text-gray-500">
|
150 |
+
<?php echo esc_html__( 'Messages Sent', 'email-subscribers' ); ?>
|
151 |
+
</p>
|
152 |
+
</div>
|
153 |
+
<div class="p-3">
|
154 |
+
<p class="text-2xl font-bold leading-none text-indigo-600">
|
155 |
+
<?php echo esc_html( $avg_click_rate ); ?> %
|
156 |
+
</p>
|
157 |
+
<p class="mt-1 font-medium leading-6 text-gray-500">
|
158 |
+
<?php echo esc_html__( 'Avg Click Rate', 'email-subscribers' ); ?>
|
159 |
+
</p>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
|
164 |
+
<div class="flex-1 min-w-0">
|
165 |
+
<div class="overflow-hidden">
|
166 |
+
<ul>
|
167 |
<?php foreach ( $topics_indexes as $index ) { ?>
|
168 |
+
<li class="border-b border-gray-200">
|
169 |
+
<a href="<?php echo esc_url( $topics[ $index ]['link'] ); ?>" class="block transition duration-150 ease-in-out hover:bg-gray-50 focus:outline-none focus:bg-gray-50" target="_blank">
|
170 |
+
|
171 |
+
<div class="flex items-center px-2 py-2 md:justify-between sm:px-2">
|
172 |
+
<div class="text-sm leading-5 text-gray-900">
|
173 |
+
<?php
|
174 |
+
echo wp_kses_post( $topics[ $index ]['title'] );
|
175 |
+
if ( ! empty( $topics[ $index ]['label'] ) ) {
|
176 |
+
?>
|
177 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?php echo esc_attr( $topics[ $index ]['label_class'] ); ?>"><?php echo esc_html( $topics[ $index ]['label'] ); ?></span>
|
178 |
<?php } ?>
|
179 |
+
</div>
|
180 |
+
<div>
|
181 |
+
<svg class="w-5 h-5 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
|
182 |
+
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
|
183 |
+
</svg>
|
184 |
+
</div>
|
185 |
+
</div>
|
186 |
+
</a>
|
187 |
+
</li>
|
188 |
<?php } ?>
|
189 |
|
190 |
+
<li class="">
|
191 |
+
<div class="px-2 py-2 text-sm leading-5 text-gray-900 sm:px-2">
|
192 |
+
<?php echo esc_html__( 'Jump to: ', 'email-subscribers' ); ?>
|
193 |
+
<a href="<?php echo esc_url( $reports_url ); ?>" class="font-bold" target="_blank">
|
194 |
+
<?php echo esc_html__( 'Reports', 'email-subscribers' ); ?>
|
195 |
+
</a>
|
196 |
+
・
|
197 |
+
<a href="<?php echo esc_url( $templates_url ); ?>" class="font-bold" target="_blank">
|
198 |
+
<?php echo esc_html__( 'Templates', 'email-subscribers' ); ?>
|
199 |
+
</a>
|
200 |
+
・
|
201 |
+
<a href="<?php echo esc_url( $settings_url ); ?>" class="font-bold" target="_blank">
|
202 |
+
<?php echo esc_html__( 'Settings', 'email-subscribers' ); ?>
|
203 |
+
</a>
|
204 |
+
</div>
|
205 |
+
</li>
|
206 |
+
</ul>
|
207 |
+
</div>
|
208 |
+
</div>
|
209 |
+
</section>
|
210 |
|
211 |
|
212 |
<?php
|
215 |
}
|
216 |
?>
|
217 |
|
218 |
+
</main>
|
219 |
</div>
|
220 |
|
221 |
<script type="text/javascript">
|
237 |
$('#ig-es-create-dropdown').toggle();
|
238 |
});
|
239 |
|
240 |
+
var labels =
|
241 |
+
<?php
|
242 |
+
if ( ! empty( $labels ) ) {
|
243 |
+
echo json_encode( $labels );
|
244 |
} else {
|
245 |
echo "''";
|
246 |
+
}
|
247 |
+
?>
|
248 |
+
;
|
249 |
+
|
250 |
+
var values =
|
251 |
+
<?php
|
252 |
+
if ( ! empty( $values ) ) {
|
253 |
+
echo json_encode( $values );
|
254 |
} else {
|
255 |
echo "''";
|
256 |
+
}
|
257 |
+
?>
|
258 |
+
;
|
259 |
|
260 |
if (labels != '' && values != '') {
|
261 |
const data = {
|
lite/admin/partials/help.php
CHANGED
@@ -23,7 +23,7 @@ $all_plugins = $ig_es_tracker::get_plugins();
|
|
23 |
|
24 |
$contact_us_btn_class = "ig-feedback-button-{$ig_es_feedback->plugin}";
|
25 |
|
26 |
-
$
|
27 |
array(
|
28 |
'title' => __( 'Icegram', 'email-subscribers' ),
|
29 |
'logo' => 'https://ps.w.org/icegram/assets/icon-128x128.png',
|
@@ -76,142 +76,163 @@ $articles = array(
|
|
76 |
);
|
77 |
|
78 |
?>
|
79 |
-
<h1 class="mt-4 wp-heading-inline"><span class="text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate"><?php
|
80 |
<div class="font-sans wrap">
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
<?php if ( ES()->is_current_user_administrator() && $enable_manual_update ) { ?>
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
<?php } else { ?>
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
125 |
<?php } ?>
|
126 |
-
|
127 |
|
128 |
-
|
129 |
-
|
130 |
<?php foreach ( $topics_indexes as $index ) { ?>
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
<?php
|
137 |
-
|
138 |
-
|
|
|
|
|
139 |
<?php } ?>
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
<?php } ?>
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
<?php foreach ( $
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
<?php if ( in_array( $
|
187 |
-
|
188 |
-
<?php } elseif ( in_array( $
|
189 |
-
|
190 |
<?php } else { ?>
|
191 |
-
|
192 |
<?php } ?>
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
|
|
|
|
212 |
<?php } ?>
|
213 |
|
214 |
-
|
215 |
-
|
216 |
|
217 |
-
</div>
|
23 |
|
24 |
$contact_us_btn_class = "ig-feedback-button-{$ig_es_feedback->plugin}";
|
25 |
|
26 |
+
$ig_plugins = array(
|
27 |
array(
|
28 |
'title' => __( 'Icegram', 'email-subscribers' ),
|
29 |
'logo' => 'https://ps.w.org/icegram/assets/icon-128x128.png',
|
76 |
);
|
77 |
|
78 |
?>
|
79 |
+
<h1 class="mt-4 wp-heading-inline"><span class="text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate"><?php echo esc_html__( 'Help & Info', 'email-subscribers' ); ?></span></h1>
|
80 |
<div class="font-sans wrap">
|
81 |
+
<div class="container flex flex-wrap w-full bg-white border rounded-lg shadow ">
|
82 |
+
<div class="inline-block w-4/12 px-2 pl-2 border-r border-dashed ">
|
83 |
+
<div class="max-h-full" id="features_display">
|
84 |
+
<div class="pt-6 pb-6 pl-2 mt-2">
|
85 |
+
<ul class="mx-6 leading-relaxed list-disc">
|
86 |
+
<?php foreach ( $articles as $article ) { ?>
|
87 |
+
<li><a target="_blank" href="<?php echo esc_url( $article['link'] ); ?>" class="<?php echo esc_attr( $article['class'] ); ?>"><?php echo esc_html( $article['title'] ); ?></a></li>
|
88 |
+
<?php } ?>
|
89 |
+
</ul>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
|
94 |
+
<div class="inline-block w-4/12 border-r border-dashed">
|
95 |
<?php if ( ES()->is_current_user_administrator() && $enable_manual_update ) { ?>
|
96 |
|
97 |
+
<div class="px-4 py-4 bg-gray-200 database-migration">
|
98 |
+
<h3 class="mt-4 mb-6 text-2xl font-medium text-center text-gray-700"><?php echo esc_html__( 'Database Migration', 'email-subscribers' ); ?></h3>
|
99 |
+
|
100 |
+
<p class="px-2 py-2">
|
101 |
+
<?php
|
102 |
+
/* translators: 1. Starting strong tag 2. Closing strong tag */
|
103 |
+
echo sprintf( esc_html__( 'If you found duplicate campaigns, lists, forms, reports after upgrading from Email Subscribers 3.5.x to 4.x and want to run the database migration again to fix this, please click the below %1$sRun the updater%2$s button.', 'email-subscribers' ), '<strong>', '</strong>' );
|
104 |
+
?>
|
105 |
+
</p>
|
106 |
+
|
107 |
+
<p class="px-2 py-2">
|
108 |
+
<?php
|
109 |
+
/* translators: 1. Starting strong tag 2. Closing strong tag */
|
110 |
+
echo sprintf( esc_html__( 'Once you click on %1$sRun the updater%2$s button, it will run the migration process from 3.5.x once again. So, if you have created new campaigns, forms or lists after migration to 4.x earlier, you will lose those data. So, make sure you have a backup with you.', 'email-subscribers' ), '<strong>', '</strong>' );
|
111 |
+
?>
|
112 |
+
</p>
|
113 |
+
|
114 |
+
<div class="flex justify-start w-2/3 py-2">
|
115 |
+
<span class="rounded-md shadow-sm">
|
116 |
+
<a href="<?php echo esc_url( $update_url ); ?>">
|
117 |
+
<button type="button" class="inline-flex justify-center w-full px-4 py-2 text-sm font-medium leading-5 text-white transition duration-150 ease-in-out bg-white bg-indigo-600 border border-transparent rounded-md hover:bg-indigo-500 focus:outline-none focus:shadow-outline-blue">
|
118 |
+
<?php
|
119 |
+
echo esc_html__( 'Run the updater', 'email-subscribers' );
|
120 |
+
?>
|
121 |
+
</button>
|
122 |
+
</a>
|
123 |
+
</span>
|
124 |
+
</div>
|
125 |
+
</div>
|
126 |
<?php } else { ?>
|
127 |
+
<h3 class="mt-4 mb-6 text-2xl font-medium text-center text-gray-700"><?php echo esc_html__( 'Get Help?', 'email-subscribers' ); ?></h3>
|
128 |
+
<ul class="mx-6 leading-relaxed list-disc">
|
129 |
+
<li>Install & Activate <a href="https://www.icegram.com/r7gg" target="_blank" class="text-indigo-600">Temporary Login Without Password</a> plugin</li>
|
130 |
+
<li>Create & Copy new Temporary Login link. <a href="https://www.icegram.com/r7gg" target="_blank" class="text-indigo-600">Learn why you should use this plugin</a></li>
|
131 |
+
<li>Click on <b>Contact US</b> button and let us know your queries along with Temporary Login Link </li>
|
132 |
+
</ul>
|
133 |
+
<div class="flex w-2/3 py-2 justify-center <?php echo esc_attr( $contact_us_btn_class ); ?>">
|
134 |
+
<span class="rounded-md shadow-sm">
|
135 |
+
<button type="button" class="inline-flex justify-center w-full px-4 py-2 text-sm font-medium leading-5 text-white transition duration-150 ease-in-out bg-white bg-indigo-600 border border-transparent rounded-md hover:bg-indigo-500 focus:outline-none focus:shadow-outline-blue">
|
136 |
+
<?php
|
137 |
+
echo esc_html__( 'Contact US', 'email-subscribers' );
|
138 |
+
?>
|
139 |
+
</button>
|
140 |
+
</span>
|
141 |
+
</div>
|
142 |
<?php } ?>
|
143 |
+
</div>
|
144 |
|
145 |
+
<div class="inline-block w-4/12">
|
146 |
+
<ul>
|
147 |
<?php foreach ( $topics_indexes as $index ) { ?>
|
148 |
+
<li class="border-b border-gray-200">
|
149 |
+
<a href="<?php echo esc_url( $topics[ $index ]['link'] ); ?>" class="block transition duration-150 ease-in-out hover:bg-gray-50 focus:outline-none focus:bg-gray-50" target="_blank">
|
150 |
+
|
151 |
+
<div class="flex items-center px-2 py-2 md:justify-between sm:px-2">
|
152 |
+
<div class="text-sm leading-5 text-gray-900">
|
153 |
+
<?php
|
154 |
+
echo wp_kses_post( $topics[ $index ]['title'] );
|
155 |
+
if ( ! empty( $topics[ $index ]['label'] ) ) {
|
156 |
+
?>
|
157 |
+
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?php echo esc_attr( $topics[ $index ]['label_class'] ); ?>"><?php echo esc_html( $topics[ $index ]['label'] ); ?></span>
|
158 |
<?php } ?>
|
159 |
+
</div>
|
160 |
+
<div>
|
161 |
+
<svg class="w-5 h-5 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
|
162 |
+
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
|
163 |
+
</svg>
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
</a>
|
167 |
+
</li>
|
168 |
<?php } ?>
|
169 |
+
</ul>
|
170 |
+
</div>
|
171 |
+
|
172 |
+
</div>
|
173 |
+
|
174 |
+
|
175 |
+
<div class="container flex flex-wrap w-full mt-4">
|
176 |
+
<div class="block mt-6">
|
177 |
+
<h3 class="text-2xl font-medium text-gray-700"><?php echo esc_html__( 'Other awesome plugins from same author', 'email-subscribers' ); ?></h3>
|
178 |
+
</div>
|
179 |
+
<div class="grid w-full grid-cols-3 py-2 my-4">
|
180 |
+
<?php foreach ( $ig_plugins as $ig_plugin ) { ?>
|
181 |
+
<div class="flex flex-col my-4 mr-3 bg-white border rounded-lg shadow">
|
182 |
+
<div class="flex h-48">
|
183 |
+
<div class="flex pl-1">
|
184 |
+
<div class="flex w-1/4 rounded">
|
185 |
+
<div class="flex flex-col w-full h-6">
|
186 |
+
<div>
|
187 |
+
<img class="mx-auto my-4 border-0 h-15" src="<?php echo esc_url( $ig_plugin['logo'] ); ?>" alt="">
|
188 |
+
</div>
|
189 |
+
</div>
|
190 |
+
</div>
|
191 |
+
<div class="flex w-3/4 pt-2">
|
192 |
+
<div class="flex flex-col">
|
193 |
+
<div class="flex w-full">
|
194 |
+
<a href="<?php echo esc_url( $ig_plugin['plugin_url'] ); ?>" target="_blank"><h3 class="pb-2 pl-2 mt-2 text-lg font-medium text-indigo-600"><?php echo esc_html( $ig_plugin['title'] ); ?></h3></a>
|
195 |
+
</div>
|
196 |
+
<div class="flex w-full pl-2 leading-normal xl:pb-4 lg:pb-2 md:pb-2">
|
197 |
+
<h4 class="pt-1 pr-4 text-sm text-gray-700"><?php echo esc_html( $ig_plugin['desc'] ); ?></h4>
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
</div>
|
202 |
+
</div>
|
203 |
+
<div class="flex flex-row mb-0 border-t">
|
204 |
+
<div class="flex w-2/3 px-3 py-5 text-sm"><?php echo esc_html__( 'Status', 'email-subscribers' ); ?>:
|
205 |
+
<?php if ( in_array( $ig_plugin['name'], $active_plugins ) ) { ?>
|
206 |
+
<span class="font-bold text-green-600"> <?php echo esc_html__( 'Active', 'email-subscribers' ); ?></span>
|
207 |
+
<?php } elseif ( in_array( $ig_plugin['name'], $inactive_plugins ) ) { ?>
|
208 |
+
<span class="font-bold text-red-600"> <?php echo esc_html__( 'Inactive', 'email-subscribers' ); ?></span>
|
209 |
<?php } else { ?>
|
210 |
+
<span class="font-bold text-orange-500"> <?php echo esc_html__( 'Not Installed', 'email-subscribers' ); ?></span>
|
211 |
<?php } ?>
|
212 |
+
</div>
|
213 |
+
<div class="flex justify-center w-1/3 py-3 md:pr-4">
|
214 |
+
<span class="rounded-md shadow-sm">
|
215 |
+
<?php if ( ! in_array( $ig_plugin['name'], $active_plugins ) ) { ?>
|
216 |
+
<a href="<?php echo esc_url( $ig_plugin['install_url'] ); ?>">
|
217 |
+
<?php
|
218 |
+
}
|
219 |
+
|
220 |
+
if ( ! in_array( $ig_plugin['name'], $all_plugins ) ) {
|
221 |
+
?>
|
222 |
+
<button type="button" class="inline-flex justify-center w-full px-4 py-2 text-sm font-medium leading-5 text-white transition duration-150 ease-in-out bg-white bg-green-600 border border-transparent rounded-md hover:bg-green-500 focus:outline-none focus:shadow-outline-blue">
|
223 |
+
<?php echo esc_html__( 'Install', 'email-subscribers' ); ?> </button>
|
224 |
+
<?php } elseif ( in_array( $ig_plugin['name'], $inactive_plugins ) ) { ?>
|
225 |
+
<button type="button" class="inline-flex justify-center w-full px-4 py-2 text-sm font-medium leading-5 text-white transition duration-150 ease-in-out bg-white bg-indigo-600 border border-transparent rounded-md hover:bg-indigo-500 focus:outline-none focus:shadow-outline-blue">
|
226 |
+
<?php echo esc_html__( 'Activate', 'email-subscribers' ); ?> </button>
|
227 |
+
<?php } ?>
|
228 |
+
</a>
|
229 |
+
</span>
|
230 |
+
</div>
|
231 |
+
</div>
|
232 |
+
</div>
|
233 |
<?php } ?>
|
234 |
|
235 |
+
</div>
|
236 |
+
</div>
|
237 |
|
238 |
+
</div>
|
lite/admin/partials/onboarding.php
CHANGED
@@ -1,111 +1,167 @@
|
|
1 |
<div id="slider-wrapper">
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
</div>
|
1 |
<div id="slider-wrapper">
|
2 |
+
<div id="slider">
|
3 |
+
<div class="sp es-send-email-screen" >
|
4 |
+
<?php $from_name = get_option( 'ig_es_from_name'); ?>
|
5 |
+
<?php $from_email = get_option( 'ig_es_from_email'); ?>
|
6 |
+
<h1> 👍 <?php echo esc_html__( '80% done!', 'email-subscribers' ); ?></h1>
|
7 |
+
<strong><?php echo esc_html__( 'We automatically:', 'email-subscribers' ); ?></strong>
|
8 |
+
<ol>
|
9 |
+
<li>
|
10 |
+
<?php
|
11 |
+
/* translators: 1: Starting anchor tag with list URL 2: Closing anchor tag */
|
12 |
+
echo sprintf( esc_html__( 'Created two Lists - %1$sMain%2$s and %1$sTest%2$s', 'email-subscribers'), '<a href="' . esc_url( admin_url( 'admin.php?page=es_lists' ) ) . '" target="_blank">', '</a>' );
|
13 |
+
?>
|
14 |
+
</li>
|
15 |
+
<li><?php echo esc_html__( 'Added yourself', 'email-subscribers'); ?> <strong>(<?php echo esc_html( get_option('admin_email') ); ?>)</strong> <?php echo esc_html__( 'to both lists', 'email-subscribers' ); ?> </li>
|
16 |
+
<li>
|
17 |
+
<?php
|
18 |
+
/* translators: 1: Starting anchor tag with forms URL 2: Closing anchor tag */
|
19 |
+
echo sprintf( esc_html__( 'Created a %1$s subscription / lead collection optin form%2$s', 'email-subscribers'), '<a href="' . esc_url( admin_url( 'admin.php?page=es_forms') ) . '" target="_blank">', '</a>' );
|
20 |
+
?>
|
21 |
+
</li>
|
22 |
+
<li>
|
23 |
+
<?php
|
24 |
+
/* translators: 1: Starting anchor tag with widgets URL 2: Closing anchor tag */
|
25 |
+
echo sprintf( esc_html__( 'Added optin form to %1$sdefault widget area%2$s to show it on your site', 'email-subscribers' ), '<a href="' . esc_url( admin_url('widgets.php') ) . '" target="_blank">', '</a>' );
|
26 |
+
?>
|
27 |
+
</li>
|
28 |
+
</ol>
|
29 |
+
<div class="es-form-wrapper">
|
30 |
+
<div class="es-form-next"style="padding: 0.5em 0.8em; border-radius: 3px;">
|
31 |
+
<?php
|
32 |
+
/* translators: 1: Starting strong tag 2: Closing strong tag 3: Line break tag */
|
33 |
+
echo sprintf( esc_html__(' We will create "%1$sNewsletter Broadcast%2$s" and "%1$sNew Post Notification%2$s" campaigns. Next step is to test everything by %1$ssending test campaigns%2$s.%3$sWe\'ve already added you, but recommend adding another email to test.', 'email-subscribers'), '<strong>', '</strong>', '<br />');
|
34 |
+
?>
|
35 |
+
<br/>
|
36 |
+
<?php
|
37 |
+
/* translators: 1: Starting strong tag 2: Closing strong tag */
|
38 |
+
echo sprintf( esc_html__('But before test %1$sverify your sender details%2$s', 'email-subscribers'), '<strong>', '</strong>' );
|
39 |
+
?>
|
40 |
+
</div>
|
41 |
+
<form id="es-send-email-form">
|
42 |
+
<label><strong><?php echo esc_html__('Sender', 'email-subscribers'); ?></strong></label><br/>
|
43 |
+
<input type="text" name="es_from_name" class="es_from_name" value="<?php echo esc_attr( $from_name ); ?>" required style="padding: 0.6em 0.5em; border: 1px solid #dcdcdc; "/>
|
44 |
+
<input type="email" name="es_from_email" class="es_from_email" value="<?php echo esc_attr( $from_email ); ?>" required style="padding: 0.6em 0.5em; border: 1px solid #dcdcdc; "/><br/>
|
45 |
+
<label><strong><?php echo esc_html__('Add an email to send a test to:', 'email-subscribers'); ?></strong></label><br/>
|
46 |
+
<input type="email" placeholder="abc@gmail.com" name="es_test_email[]" class="es_email" required style="padding: 0.6em 0.5em; border: 1px solid #dcdcdc; "/>
|
47 |
+
<a id="button-send" class="button-send"><?php echo esc_html__('Create and Send test camapigns', 'email-subscribers'); ?></a>
|
48 |
+
<img class="es-loader" src="<?php echo esc_url( ES_PLUGIN_URL . 'lite/public/images/spinner.gif' ); ?>" style="display:none;"/>
|
49 |
+
</form>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
<div class="sp es-success" >
|
53 |
+
<h1><?php echo esc_html__('Test emails sent, check your inbox'); ?></h1>
|
54 |
+
<div class="es-sent-success">
|
55 |
+
<div class="es-gray">
|
56 |
+
<?php
|
57 |
+
/* translators: %s: Site admin email */
|
58 |
+
echo sprintf( esc_html__( 'We sent two campaigns to %s and email you have added.', 'email-subscribers' ), esc_html( get_option( 'admin_email' ) ) );
|
59 |
+
?>
|
60 |
+
</div>
|
61 |
+
<div class="es-gray"><?php echo esc_html__( 'They may take a few minutes to arrive. But do confirm you received them.', 'email-subscribers' ); ?></div>
|
62 |
+
</div>
|
63 |
+
<div class="emoji" style="text-align: center; font-size: 10em; opacity: 0.45"> 📨 </div>
|
64 |
+
<div class="es-actions">
|
65 |
+
<div class="button button-hero es-receive-success-btn" style="width: 100%; text-align: center;padding: 0"><?php echo esc_html__('Yes, I received the test emails', 'email-subscribers'); ?></div>
|
66 |
+
<div style="margin-top: 0.7em;"><a href="#" style="text-decoration: none;color: #737373" class="es-secondary es-receive-error-btn""><?php echo esc_html__('No, I haven\'t received them yet', 'email-subscribers'); ?></a></div>
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
<div class="sp es-receive-success">
|
70 |
+
<h1> 👍 <?php echo esc_html__('We\'re done!'); ?></h1>
|
71 |
+
<div>
|
72 |
+
<div class="" style="color: #737373; line-height: 1.75;"><?php echo esc_html__('Everything is setup now. It\'s a perfect time to get better at email marketing now. Sign up below to get our highly acclaimed course for free.', 'email-subscribers'); ?> </div>
|
73 |
+
<form name="klawoo_subscribe" action="#" method="POST" accept-charset="utf-8" class="es-onboarding" style="margin-right: 0; margin-top: 1em; /* text-align: center; */ ">
|
74 |
+
<input class="es-ltr" type="text" name="name" id="name" placeholder="Your Name"/> <br />
|
75 |
+
<input class="es-ltr" type="text" name="email" id="email" placeholder="Your Email" required/> <br />
|
76 |
+
<input type="hidden" name="list" value="hN8OkYzujUlKgDgfCTEcIA"/>
|
77 |
+
<input type="hidden" name="form-source" value="es_email_send_success"/>
|
78 |
+
<input type="checkbox" name="es-gdpr-agree" id ="es-gdpr-agree" value="1" required="required">
|
79 |
+
<label for="es-gdpr-agree" style="font-size: 0.9em; color: #777777; ">
|
80 |
+
<?php
|
81 |
+
/* translators: %s: Icegram Privacy Policy text with anchor tag */
|
82 |
+
echo sprintf( esc_html__( 'I have read and agreed to your %s.', 'email-subscribers' ), '<a href="https://www.icegram.com/privacy-policy/" target="_blank">' . esc_html__( 'Privacy Policy', 'email-subscribers' ) . '</a>' );
|
83 |
+
?>
|
84 |
+
</label>
|
85 |
+
<br />
|
86 |
+
<input type="submit" name="submit" id="submit" class="button button-hero" style="padding: 0; width: 320px; "value="<?php echo esc_html__( 'Signup and send me the course for free', 'email-subscribers' ); ?>">
|
87 |
+
<div style="text-align: center; width: 56%; margin-top: 0.5em;"><a class="es-skip" href="<?php echo esc_url( admin_url( 'admin.php?page=es_dashboard&es_skip=1&option_name=email_send_success') ); ?>"><?php echo esc_html__('Skip and goto Dashboard', 'email-subscribers'); ?></a></div>
|
88 |
+
<br>
|
89 |
+
<p id="klawoo_response"></p>
|
90 |
+
</form>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
<div class="sp es-receive-error">
|
94 |
+
<h1><?php echo esc_html__('Check these few things below'); ?></h1>
|
95 |
+
<ul>
|
96 |
+
<li>
|
97 |
+
<?php
|
98 |
+
echo esc_html__('1. Check your spam or junk folder', 'email-subscribers');
|
99 |
+
?>
|
100 |
+
</li>
|
101 |
+
<li>
|
102 |
+
<?php
|
103 |
+
/* translators: 1: Starting anchor tag 2: Closing anchor tag */
|
104 |
+
echo sprintf( esc_html__('2. %1$sSend another test email%2$s with different email address ', 'email-subscribers'), '<a href="' . esc_url( admin_url('admin.php?page=es_settings#tabs-email_sending') ) . '" target="_blank">', '</a>');
|
105 |
+
?>
|
106 |
+
</li>
|
107 |
+
<li>
|
108 |
+
<?php
|
109 |
+
/* translators: 1: Starting strong tag 2: Closing strong tag */
|
110 |
+
echo sprintf( esc_html__( '3. Is %1$s' . get_option('admin_email') . '%2$s email is free/disposable?', 'email-subscribers' ), '<strong>', '</strong>' );
|
111 |
+
?>
|
112 |
+
</li>
|
113 |
+
<li><a href="https://www.icegram.com/documentation/reasons-why-you-havent-received-the-test-email/?utm_source=es&utm_medium=es_onboarding&utm_campaign=view_docs_help_page" target="_blank" style="color: #387bff; font-weight: 500; "> <?php echo esc_html__('Explore more', 'email-subscribers'); ?></a></li>
|
114 |
+
</ul>
|
115 |
+
<div class="">
|
116 |
+
<div class="es-gray"><?php echo esc_html__('Also, it\'s a perfect time to get better at email marketing now. Sign up below to get our highly acclaimed course for free.', 'email-subscribers'); ?></div>
|
117 |
+
<form name="klawoo_subscribe" action="#" method="POST" accept-charset="utf-8" class="es-onboarding">
|
118 |
+
<input class="es-ltr" type="text" name="name" id="name" placeholder="Your Name"/> <br />
|
119 |
+
<input class="es-ltr" type="text" name="email" id="email" placeholder="Your Email" required/> <br />
|
120 |
+
<input type="hidden" name="list" value="hN8OkYzujUlKgDgfCTEcIA"/>
|
121 |
+
<input type="hidden" name="form-source" value="es_email_receive_error"/>
|
122 |
+
<input type="checkbox" name="es-gdpr-agree" id ="es-gdpr-agree" value="1" required="required">
|
123 |
+
<label for="es-gdpr-agree" style="font-size: 0.9em; color: #777777; ">
|
124 |
+
<?php
|
125 |
+
/* translators: %s: Icegram Privacy Policy text with anchor tag */
|
126 |
+
echo sprintf(esc_html__( 'I have read and agreed to your %s.', 'email-subscribers' ), '<a href="https://www.icegram.com/privacy-policy/" target="_blank">' . esc_html__( 'Privacy Policy', 'email-subscribers' ) . '</a>' );
|
127 |
+
?>
|
128 |
+
</label>
|
129 |
+
<br />
|
130 |
+
<input type="submit" name="submit" id="submit" class="button button-hero" value="<?php echo esc_html__('Signup and send me the course for free', 'email-subscribers' ); ?>">
|
131 |
+
<div style="text-align: center; width: 56%; margin-top: 0.5em;"><a class="es-skip" href="<?php echo esc_url( admin_url('admin.php?page=es_dashboard&es_skip=1&option_name=email_receive_error') ); ?>" ><?php echo esc_html__('Skip and goto Dashboard', 'email-subscribers'); ?></a></div>
|
132 |
+
<br>
|
133 |
+
<p id="klawoo_response"></p>
|
134 |
+
</form>
|
135 |
+
</div>
|
136 |
+
</div>
|
137 |
+
<div class="sp es-error" >
|
138 |
+
<h1>⚠️ <?php echo esc_html__('Problem sending emails - fix this first.'); ?></h1>
|
139 |
+
<div style="font-weight: 500; font-size: 1.1em;"><?php echo esc_html__('We faced some problems sending test Campaigns.'); ?></div>
|
140 |
+
<div class="es-email-sending-error"></div>
|
141 |
+
<div><a href="https://www.icegram.com/documentation/common-email-sending-problems/?utm_source=es&utm_medium=es_onboarding&utm_campaign=view_docs_help_page" target="_blank" style="color: #387bff; font-weight: 500; "> <?php echo esc_html__('Explore more about problems', 'email-subscribers'); ?></a></div>
|
142 |
+
<div class="es-gray"><?php echo esc_html__('Please solve these problems, without that email sending won\'t work.'); ?></div>
|
143 |
+
<div style="margin-top: 1em;">
|
144 |
+
<div class="es-gray"><?php echo esc_html__('Also, it\'s a perfect time to get better at email marketing now. Sign up below to get our highly acclaimed course for free.', 'email-subscribers'); ?></div>
|
145 |
+
<form name="klawoo_subscribe" action="#" method="POST" accept-charset="utf-8" class="es-onboarding">
|
146 |
+
<input class="es-ltr" type="text" name="name" id="name" placeholder="Your Name"/> <br />
|
147 |
+
<input class="es-ltr" type="text" name="email" id="email" placeholder="Your Email" required/> <br />
|
148 |
+
<input type="hidden" name="list" value="hN8OkYzujUlKgDgfCTEcIA"/>
|
149 |
+
<input type="hidden" name="form-source" value="es_email_send_error"/>
|
150 |
+
<input type="checkbox" name="es-gdpr-agree" id ="es-gdpr-agree" value="1" required="required">
|
151 |
+
<label for="es-gdpr-agree" style="font-size: 0.9em; color: #777777; ">
|
152 |
+
<?php
|
153 |
+
/* translators: %s: Icegram Privacy Policy text with anchor tag */
|
154 |
+
echo sprintf(esc_html__( 'I have read and agreed to your %s.', 'email-subscribers' ), '<a href="https://www.icegram.com/privacy-policy/" target="_blank">' . esc_html__( 'Privacy Policy', 'email-subscribers' ) . '</a>' );
|
155 |
+
?>
|
156 |
+
</label>
|
157 |
+
<br />
|
158 |
+
<input type="submit" name="submit" id="submit" class="button button-hero" value="<?php echo esc_html__( 'Signup and send me the course for free', 'email-subscribers' ); ?>">
|
159 |
+
<div style="text-align: center; width: 56%; margin-top: 0.5em;"><a class="es-skip" href="<?php echo esc_url( admin_url('admin.php?page=es_dashboard&es_skip=1&option_name=email_send_error') ); ?>"><?php echo esc_html__('Skip and goto Dashboard', 'email-subscribers'); ?></a></div>
|
160 |
+
<br>
|
161 |
+
<p id="klawoo_response"></p>
|
162 |
+
</form>
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
</div>
|
167 |
</div>
|
lite/includes/class-email-subscribers-activator.php
CHANGED
@@ -41,21 +41,21 @@ class Email_Subscribers_Activator {
|
|
41 |
|
42 |
public static function register_email_templates() {
|
43 |
$labels = array(
|
44 |
-
'name' => __( 'Templates', '
|
45 |
-
'singular_name' => __( 'Templates', '
|
46 |
-
'add_new' => __( 'Add new Template', '
|
47 |
-
'add_new_item' => __( 'Add new Template', '
|
48 |
-
'edit_item' => __( 'Edit Templates', '
|
49 |
-
'new_item' => __( 'New Templates', '
|
50 |
-
'all_items' => __( 'Templates', '
|
51 |
-
'view_item' => __( 'View Templates', '
|
52 |
-
'search_items' => __( 'Search Templates', '
|
53 |
-
'not_found' => __( 'No Templates found', '
|
54 |
-
'not_found_in_trash' => __( 'No Templates found in Trash', '
|
55 |
-
'parent_item_colon' =>
|
56 |
-
'menu_name' => __( 'Email Subscribers', '
|
57 |
-
'featured_image' => __( 'Thumbnail (For Visual Representation only)', '
|
58 |
-
'set_featured_image' => __( 'Set thumbnail', '
|
59 |
);
|
60 |
|
61 |
$args = array(
|
41 |
|
42 |
public static function register_email_templates() {
|
43 |
$labels = array(
|
44 |
+
'name' => __( 'Templates', 'email-subscribers' ),
|
45 |
+
'singular_name' => __( 'Templates', 'email-subscribers' ),
|
46 |
+
'add_new' => __( 'Add new Template', 'email-subscribers' ),
|
47 |
+
'add_new_item' => __( 'Add new Template', 'email-subscribers' ),
|
48 |
+
'edit_item' => __( 'Edit Templates', 'email-subscribers' ),
|
49 |
+
'new_item' => __( 'New Templates', 'email-subscribers' ),
|
50 |
+
'all_items' => __( 'Templates', 'email-subscribers' ),
|
51 |
+
'view_item' => __( 'View Templates', 'email-subscribers' ),
|
52 |
+
'search_items' => __( 'Search Templates', 'email-subscribers' ),
|
53 |
+
'not_found' => __( 'No Templates found', 'email-subscribers' ),
|
54 |
+
'not_found_in_trash' => __( 'No Templates found in Trash', 'email-subscribers' ),
|
55 |
+
'parent_item_colon' => '',
|
56 |
+
'menu_name' => __( 'Email Subscribers', 'email-subscribers' ),
|
57 |
+
'featured_image' => __( 'Thumbnail (For Visual Representation only)', 'email-subscribers' ),
|
58 |
+
'set_featured_image' => __( 'Set thumbnail', 'email-subscribers' )
|
59 |
);
|
60 |
|
61 |
$args = array(
|
lite/includes/class-email-subscribers-loader.php
CHANGED
@@ -31,7 +31,6 @@ class Email_Subscribers_Loader {
|
|
31 |
* The array of actions registered with WordPress.
|
32 |
*
|
33 |
* @since 4.0
|
34 |
-
* @access protected
|
35 |
* @var array $actions The actions registered with WordPress to fire when the plugin loads.
|
36 |
*/
|
37 |
protected $actions;
|
@@ -40,7 +39,6 @@ class Email_Subscribers_Loader {
|
|
40 |
* The array of filters registered with WordPress.
|
41 |
*
|
42 |
* @since 4.0
|
43 |
-
* @access protected
|
44 |
* @var array $filters The filters registered with WordPress to fire when the plugin loads.
|
45 |
*/
|
46 |
protected $filters;
|
@@ -90,7 +88,6 @@ class Email_Subscribers_Loader {
|
|
90 |
* collection.
|
91 |
*
|
92 |
* @since 4.0
|
93 |
-
* @access private
|
94 |
* @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
|
95 |
* @param string $hook The name of the WordPress filter that is being registered.
|
96 |
* @param object $component A reference to the instance of the object on which the filter is defined.
|
31 |
* The array of actions registered with WordPress.
|
32 |
*
|
33 |
* @since 4.0
|
|
|
34 |
* @var array $actions The actions registered with WordPress to fire when the plugin loads.
|
35 |
*/
|
36 |
protected $actions;
|
39 |
* The array of filters registered with WordPress.
|
40 |
*
|
41 |
* @since 4.0
|
|
|
42 |
* @var array $filters The filters registered with WordPress to fire when the plugin loads.
|
43 |
*/
|
44 |
protected $filters;
|
88 |
* collection.
|
89 |
*
|
90 |
* @since 4.0
|
|
|
91 |
* @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
|
92 |
* @param string $hook The name of the WordPress filter that is being registered.
|
93 |
* @param object $component A reference to the instance of the object on which the filter is defined.
|
lite/includes/class-email-subscribers.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
// Exit if accessed directly
|
4 |
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
exit;
|
@@ -36,6 +35,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
36 |
*/
|
37 |
class Email_Subscribers {
|
38 |
/**
|
|
|
39 |
*
|
40 |
* @since 4.2.1
|
41 |
*
|
@@ -118,6 +118,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
118 |
public $tracker;
|
119 |
|
120 |
/**
|
|
|
|
|
121 |
* @since 4.2.1
|
122 |
*
|
123 |
* @var object|ES_Campaigns_Table
|
@@ -135,6 +137,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
135 |
public $campaigns_db;
|
136 |
|
137 |
/**
|
|
|
|
|
138 |
* @since 4.2.1
|
139 |
* @var object|ES_Lists_Table
|
140 |
*
|
@@ -142,6 +146,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
142 |
public $lists;
|
143 |
|
144 |
/**
|
|
|
|
|
145 |
* @since 4.2.1
|
146 |
*
|
147 |
* @var object|ES_DB_Lists
|
@@ -150,6 +156,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
150 |
public $lists_db;
|
151 |
|
152 |
/**
|
|
|
|
|
153 |
* @since 4.2.1
|
154 |
* @var object|ES_Forms_Table
|
155 |
*
|
@@ -157,6 +165,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
157 |
public $forms;
|
158 |
|
159 |
/**
|
|
|
|
|
160 |
* @since 4.2.1
|
161 |
*
|
162 |
* @var object|ES_DB_Forms
|
@@ -164,6 +174,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
164 |
public $forms_db;
|
165 |
|
166 |
/**
|
|
|
|
|
167 |
* @since 4.2.1
|
168 |
*
|
169 |
* @var object|ES_Contacts_Table
|
@@ -171,6 +183,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
171 |
public $contacts;
|
172 |
|
173 |
/**
|
|
|
|
|
174 |
* @since 4.2.1
|
175 |
*
|
176 |
* @var object|ES_DB_Contacts
|
@@ -178,6 +192,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
178 |
public $contacts_db;
|
179 |
|
180 |
/**
|
|
|
|
|
181 |
* @since 4.2.2
|
182 |
*
|
183 |
* @var object|ES_DB_Blocked_Emails
|
@@ -185,6 +201,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
185 |
public $blocked_emails_db;
|
186 |
|
187 |
/**
|
|
|
|
|
188 |
* @since 4.2.4
|
189 |
*
|
190 |
* @var object|ES_DB_Links
|
@@ -192,6 +210,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
192 |
public $links_db;
|
193 |
|
194 |
/**
|
|
|
|
|
195 |
* @since 4.3.5
|
196 |
*
|
197 |
* @var object|ES_DB_Lists_Contacts
|
@@ -199,6 +219,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
199 |
public $lists_contacts_db;
|
200 |
|
201 |
/**
|
|
|
202 |
*
|
203 |
* @since 4.2.1
|
204 |
*
|
@@ -208,6 +229,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
208 |
public $integrations;
|
209 |
|
210 |
/**
|
|
|
|
|
211 |
* @since 4.2.1
|
212 |
*
|
213 |
* @var object|IG_Logger
|
@@ -216,6 +239,8 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
216 |
public $logger;
|
217 |
|
218 |
/**
|
|
|
|
|
219 |
* @since 4.3.1
|
220 |
*
|
221 |
* @var object|ES_Mailer
|
@@ -227,7 +252,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
227 |
* the plugin.
|
228 |
*
|
229 |
* @since 4.0
|
230 |
-
*
|
231 |
* @var Email_Subscribers_Loader $loader Maintains and registers all hooks for the plugin.
|
232 |
*/
|
233 |
protected $loader;
|
@@ -236,7 +261,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
236 |
* The unique identifier of this plugin.
|
237 |
*
|
238 |
* @since 4.0
|
239 |
-
*
|
240 |
* @var string $email_subscribers The string used to uniquely identify this plugin.
|
241 |
*/
|
242 |
protected $email_subscribers;
|
@@ -245,12 +270,14 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
245 |
* The current version of the plugin.
|
246 |
*
|
247 |
* @since 4.0
|
248 |
-
*
|
249 |
* @var string $version The current version of the plugin.
|
250 |
*/
|
251 |
protected $version;
|
252 |
|
253 |
/**
|
|
|
|
|
254 |
* @since 4.4.0
|
255 |
*
|
256 |
* @var object|ES_DB_Workflows
|
@@ -293,7 +320,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
293 |
$is_onboarding_complete = get_option( 'ig_es_onboarding_complete', false );
|
294 |
|
295 |
// We don't have ig_es_onboarding_complete option if somebody is migrating from older version
|
296 |
-
if ( ( 'toplevel_page_es_dashboard' === $screen_id ) && ( ! $is_onboarding_complete ||
|
297 |
return;
|
298 |
}
|
299 |
|
@@ -303,19 +330,28 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
303 |
$show_notice = true;
|
304 |
$show_notice = apply_filters( 'ig_es_show_wp_cron_notice', $show_notice );
|
305 |
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
|
|
|
|
|
|
|
|
|
|
310 |
$disable_wp_cron_notice = sprintf( __( 'WordPress Cron is disabled on your site. Email notifications from Email Subscribers plugin will not be sent automatically. <a href="%s" target="_blank" >Here\'s how you can enable it.</a>', 'email-subscribers' ), $es_cron_url );
|
|
|
311 |
$disable_wp_cron_notice .= '<br/>' . sprintf( __( 'Or schedule Cron in <a href="%s" target="_blank">cPanel</a>', 'email-subscribers' ), $cpanel_url );
|
|
|
312 |
$disable_wp_cron_notice .= '<br/>' . sprintf( __( 'Or use <strong><a href="%s" target="_blank">Email Subscribers Pro</a></strong> for automatic Cron support', 'email-subscribers' ), $es_pro_url );
|
313 |
-
$html
|
314 |
'email-subscribers' ) . '</a></p></div>';
|
315 |
-
$args['html']
|
316 |
ES_Admin_Notices::add_custom_notice( 'show_wp_cron', $args );
|
|
|
|
|
|
|
317 |
}
|
318 |
-
|
319 |
}
|
320 |
|
321 |
/**
|
@@ -541,7 +577,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
541 |
*
|
542 |
* @since 4.2.0
|
543 |
*/
|
544 |
-
function define( $constant, $value ) {
|
545 |
if ( ! defined( $constant ) ) {
|
546 |
define( $constant, $value );
|
547 |
}
|
@@ -561,7 +597,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
561 |
* with WordPress.
|
562 |
*
|
563 |
* @since 4.0
|
564 |
-
*
|
565 |
*/
|
566 |
private function load_dependencies() {
|
567 |
|
@@ -818,7 +854,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
818 |
* of the plugin.
|
819 |
*
|
820 |
* @since 4.0
|
821 |
-
*
|
822 |
*/
|
823 |
private function define_admin_hooks() {
|
824 |
|
@@ -842,7 +878,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
842 |
* of the plugin.
|
843 |
*
|
844 |
* @since 4.0
|
845 |
-
*
|
846 |
*/
|
847 |
private function define_public_hooks() {
|
848 |
|
@@ -971,10 +1007,10 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
971 |
$prefix = sanitize_title( __( 'Email Subscribers', 'email-subscribers' ) );
|
972 |
|
973 |
$screens = array(
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
"{$prefix}_page_es_subscribers",
|
979 |
"{$prefix}_page_es_lists",
|
980 |
"{$prefix}_page_es_forms",
|
@@ -1075,9 +1111,9 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
1075 |
$error = error_get_last();
|
1076 |
if ( in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ), true ) ) {
|
1077 |
$logger = get_ig_logger();
|
1078 |
-
|
1079 |
$logger->critical(
|
1080 |
-
|
|
|
1081 |
array(
|
1082 |
'source' => 'fatal-errors',
|
1083 |
)
|
@@ -1096,7 +1132,9 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
1096 |
*/
|
1097 |
public static function instance() {
|
1098 |
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Email_Subscribers ) ) {
|
1099 |
-
global $ig_es_feedback;
|
|
|
|
|
1100 |
|
1101 |
self::$instance = new Email_Subscribers();
|
1102 |
|
@@ -1114,7 +1152,7 @@ if ( ! class_exists( 'Email_Subscribers' ) ) {
|
|
1114 |
|
1115 |
self::$instance->logger = get_ig_logger();
|
1116 |
|
1117 |
-
self::$instance->mailer
|
1118 |
|
1119 |
add_action( 'widgets_init', array( self::$instance, 'register_es_widget' ) );
|
1120 |
|
1 |
<?php
|
|
|
2 |
// Exit if accessed directly
|
3 |
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
exit;
|
35 |
*/
|
36 |
class Email_Subscribers {
|
37 |
/**
|
38 |
+
* ES instance
|
39 |
*
|
40 |
* @since 4.2.1
|
41 |
*
|
118 |
public $tracker;
|
119 |
|
120 |
/**
|
121 |
+
* Campaigns Object
|
122 |
+
*
|
123 |
* @since 4.2.1
|
124 |
*
|
125 |
* @var object|ES_Campaigns_Table
|
137 |
public $campaigns_db;
|
138 |
|
139 |
/**
|
140 |
+
* Lists Object
|
141 |
+
*
|
142 |
* @since 4.2.1
|
143 |
* @var object|ES_Lists_Table
|
144 |
*
|
146 |
public $lists;
|
147 |
|
148 |
/**
|
149 |
+
* Lists DB Object
|
150 |
+
*
|
151 |
* @since 4.2.1
|
152 |
*
|
153 |
* @var object|ES_DB_Lists
|
156 |
public $lists_db;
|
157 |
|
158 |
/**
|
159 |
+
* Forms Object
|
160 |
+
*
|
161 |
* @since 4.2.1
|
162 |
* @var object|ES_Forms_Table
|
163 |
*
|
165 |
public $forms;
|
166 |
|
167 |
/**
|
168 |
+
* Forms DB Object
|
169 |
+
*
|
170 |
* @since 4.2.1
|
171 |
*
|
172 |
* @var object|ES_DB_Forms
|
174 |
public $forms_db;
|
175 |
|
176 |
/**
|
177 |
+
* Contacts Object
|
178 |
+
*
|
179 |
* @since 4.2.1
|
180 |
*
|
181 |
* @var object|ES_Contacts_Table
|
183 |
public $contacts;
|
184 |
|
185 |
/**
|
186 |
+
* Contacts DB Object
|
187 |
+
*
|
188 |
* @since 4.2.1
|
189 |
*
|
190 |
* @var object|ES_DB_Contacts
|
192 |
public $contacts_db;
|
193 |
|
194 |
/**
|
195 |
+
* ES_DB_Blocked_Emails object
|
196 |
+
*
|
197 |
* @since 4.2.2
|
198 |
*
|
199 |
* @var object|ES_DB_Blocked_Emails
|
201 |
public $blocked_emails_db;
|
202 |
|
203 |
/**
|
204 |
+
* ES_DB_Links object
|
205 |
+
*
|
206 |
* @since 4.2.4
|
207 |
*
|
208 |
* @var object|ES_DB_Links
|
210 |
public $links_db;
|
211 |
|
212 |
/**
|
213 |
+
* ES_DB_Lists_Contacts object
|
214 |
+
*
|
215 |
* @since 4.3.5
|
216 |
*
|
217 |
* @var object|ES_DB_Lists_Contacts
|
219 |
public $lists_contacts_db;
|
220 |
|
221 |
/**
|
222 |
+
* ES_Integrations object
|
223 |
*
|
224 |
* @since 4.2.1
|
225 |
*
|
229 |
public $integrations;
|
230 |
|
231 |
/**
|
232 |
+
* IG_Logger object
|
233 |
+
*
|
234 |
* @since 4.2.1
|
235 |
*
|
236 |
* @var object|IG_Logger
|
239 |
public $logger;
|
240 |
|
241 |
/**
|
242 |
+
* ES_Mailer object
|
243 |
+
*
|
244 |
* @since 4.3.1
|
245 |
*
|
246 |
* @var object|ES_Mailer
|
252 |
* the plugin.
|
253 |
*
|
254 |
* @since 4.0
|
255 |
+
*
|
256 |
* @var Email_Subscribers_Loader $loader Maintains and registers all hooks for the plugin.
|
257 |
*/
|
258 |
protected $loader;
|
261 |
* The unique identifier of this plugin.
|
262 |
*
|
263 |
* @since 4.0
|
264 |
+
*
|
265 |
* @var string $email_subscribers The string used to uniquely identify this plugin.
|
266 |
*/
|
267 |
protected $email_subscribers;
|
270 |
* The current version of the plugin.
|
271 |
*
|
272 |
* @since 4.0
|
273 |
+
*
|
274 |
* @var string $version The current version of the plugin.
|
275 |
*/
|
276 |
protected $version;
|
277 |
|
278 |
/**
|
279 |
+
* ES_DB_Workflows object
|
280 |
+
*
|
281 |
* @since 4.4.0
|
282 |
*
|
283 |
* @var object|ES_DB_Workflows
|
320 |
$is_onboarding_complete = get_option( 'ig_es_onboarding_complete', false );
|
321 |
|
322 |
// We don't have ig_es_onboarding_complete option if somebody is migrating from older version
|
323 |
+
if ( ( 'toplevel_page_es_dashboard' === $screen_id ) && ( ! $is_onboarding_complete || 'no' == $is_onboarding_complete ) ) {
|
324 |
return;
|
325 |
}
|
326 |
|
330 |
$show_notice = true;
|
331 |
$show_notice = apply_filters( 'ig_es_show_wp_cron_notice', $show_notice );
|
332 |
|
333 |
+
// If DISABLE_WP_CRON constant is defined and set to true, then we can say that wp cron is disabled.
|
334 |
+
$wp_cron_disabled = ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ? true : false;
|
335 |
+
|
336 |
+
// Add notice only if wp cron is disabled and user have not acknowledged the notice by clicking on the acknowledgement button in the notice.
|
337 |
+
if ( $wp_cron_disabled && 'yes' != $notice_option && $show_notice ) {
|
338 |
+
$es_cron_url = 'https://www.icegram.com/documentation/how-to-enable-the-wordpress-cron/?utm_medium=enable_wordpress_cron&utm_source=in_app&utm_campaign=view_admin_notice';
|
339 |
+
$cpanel_url = 'https://www.icegram.com/documentation/es-how-to-schedule-cron-emails-in-cpanel/?utm_source=schedule_cron_in_cpanel&utm_medium=in_app&utm_campaign=view_admin_notice';
|
340 |
+
$es_pro_url = 'https://www.icegram.com/documentation/es-how-to-schedule-cron-emails-in-cpanel/?utm_source=schedule_cron_in_cpanel&utm_medium=in_app&utm_campaign=view_admin_notice';
|
341 |
+
/* translators: %s: Cron URL */
|
342 |
$disable_wp_cron_notice = sprintf( __( 'WordPress Cron is disabled on your site. Email notifications from Email Subscribers plugin will not be sent automatically. <a href="%s" target="_blank" >Here\'s how you can enable it.</a>', 'email-subscribers' ), $es_cron_url );
|
343 |
+
/* translators: %s: Link to Cpanel URL */
|
344 |
$disable_wp_cron_notice .= '<br/>' . sprintf( __( 'Or schedule Cron in <a href="%s" target="_blank">cPanel</a>', 'email-subscribers' ), $cpanel_url );
|
345 |
+
/* translators: %s: ES Pro URL */
|
346 |
$disable_wp_cron_notice .= '<br/>' . sprintf( __( 'Or use <strong><a href="%s" target="_blank">Email Subscribers Pro</a></strong> for automatic Cron support', 'email-subscribers' ), $es_pro_url );
|
347 |
+
$html = '<div class="notice notice-warning" style="background-color: #FFF;"><p style="letter-spacing: 0.6px;">' . $disable_wp_cron_notice . '<a style="float:right" class="es-admin-btn es-admin-btn-secondary " href="' . admin_url() . '?es_dismiss_admin_notice=1&option_name=wp_cron_notice">' . __( 'OK, I Got it!',
|
348 |
'email-subscribers' ) . '</a></p></div>';
|
349 |
+
$args['html'] = $html;
|
350 |
ES_Admin_Notices::add_custom_notice( 'show_wp_cron', $args );
|
351 |
+
} else {
|
352 |
+
// Remove the notice if user hasn't disabled the WP CRON or renabled the WP CRON.
|
353 |
+
ES_Admin_Notices::remove_notice( 'show_wp_cron' );
|
354 |
}
|
|
|
355 |
}
|
356 |
|
357 |
/**
|
577 |
*
|
578 |
* @since 4.2.0
|
579 |
*/
|
580 |
+
public function define( $constant, $value ) {
|
581 |
if ( ! defined( $constant ) ) {
|
582 |
define( $constant, $value );
|
583 |
}
|
597 |
* with WordPress.
|
598 |
*
|
599 |
* @since 4.0
|
600 |
+
*
|
601 |
*/
|
602 |
private function load_dependencies() {
|
603 |
|
854 |
* of the plugin.
|
855 |
*
|
856 |
* @since 4.0
|
857 |
+
*
|
858 |
*/
|
859 |
private function define_admin_hooks() {
|
860 |
|
878 |
* of the plugin.
|
879 |
*
|
880 |
* @since 4.0
|
881 |
+
*
|
882 |
*/
|
883 |
private function define_public_hooks() {
|
884 |
|
1007 |
$prefix = sanitize_title( __( 'Email Subscribers', 'email-subscribers' ) );
|
1008 |
|
1009 |
$screens = array(
|
1010 |
+
'es_template',
|
1011 |
+
'edit-es_template',
|
1012 |
+
'toplevel_page_es_dashboard',
|
1013 |
+
'admin_page_go_to_icegram',
|
1014 |
"{$prefix}_page_es_subscribers",
|
1015 |
"{$prefix}_page_es_lists",
|
1016 |
"{$prefix}_page_es_forms",
|
1111 |
$error = error_get_last();
|
1112 |
if ( in_array( $error['type'], array( E_ERROR, E_PARSE, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR ), true ) ) {
|
1113 |
$logger = get_ig_logger();
|
|
|
1114 |
$logger->critical(
|
1115 |
+
/* translators: 1: Error message 2: File name 3: Line number */
|
1116 |
+
sprintf( esc_html__( '%1$s in %2$s on line %3$s', 'email-subscribers' ), $error['message'], $error['file'], $error['line'] ) . PHP_EOL,
|
1117 |
array(
|
1118 |
'source' => 'fatal-errors',
|
1119 |
)
|
1132 |
*/
|
1133 |
public static function instance() {
|
1134 |
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Email_Subscribers ) ) {
|
1135 |
+
global $wpdb, $ig_es_feedback, $wpbd;
|
1136 |
+
|
1137 |
+
$wpbd = $wpdb;
|
1138 |
|
1139 |
self::$instance = new Email_Subscribers();
|
1140 |
|
1152 |
|
1153 |
self::$instance->logger = get_ig_logger();
|
1154 |
|
1155 |
+
self::$instance->mailer = new ES_Mailer();
|
1156 |
|
1157 |
add_action( 'widgets_init', array( self::$instance, 'register_es_widget' ) );
|
1158 |
|
lite/includes/class-es-common.php
CHANGED
@@ -23,8 +23,8 @@ class ES_Common {
|
|
23 |
* @since 4.0
|
24 |
*/
|
25 |
public static function convert_es_templates( $template, $name, $email, $es_templ_id = 0 ) {
|
26 |
-
$convert_template = str_replace(
|
27 |
-
$convert_template = str_replace(
|
28 |
|
29 |
return $convert_template;
|
30 |
}
|
@@ -54,13 +54,13 @@ class ES_Common {
|
|
54 |
$content = $data['content'];
|
55 |
//total contacts
|
56 |
$total_contacts = ES()->contacts_db->count_active_contacts_by_list_id();
|
57 |
-
$content = str_replace(
|
58 |
//blog title
|
59 |
$blog_name = get_option( 'blogname' );
|
60 |
-
$content = str_replace(
|
61 |
// site url
|
62 |
$site_url = home_url( '/' );
|
63 |
-
$content = str_replace(
|
64 |
|
65 |
/*TODO: Enable it once Pre header issue fix
|
66 |
$meta = ES()->campaigns_db->get_campaign_meta_by_id( $campaign_id );
|
@@ -115,38 +115,38 @@ class ES_Common {
|
|
115 |
|
116 |
$post_link = get_permalink( $post_ID );
|
117 |
// Check if current URL is same as current post's permalink.
|
118 |
-
if( ! empty( $post_link ) && $url === $post_link ) {
|
119 |
// Convert URL HTML back to URL itself if it a current post URL.
|
120 |
$html = $url;
|
121 |
} else {
|
122 |
-
if( ! class_exists( 'WP_oEmbed' ) ) {
|
123 |
-
require_once
|
124 |
}
|
125 |
|
126 |
$oembed = new WP_oEmbed();
|
127 |
$provider = $oembed->discover( $url );
|
128 |
|
129 |
-
if( ! empty( $provider ) ) {
|
130 |
$oembed_response = $oembed->fetch( $provider, $url, $attr );
|
131 |
-
if( is_object( $oembed_response ) && ! empty( $oembed_response->type ) && 'video' === $oembed_response->type ) {
|
132 |
$thumbnail_url = $oembed_response->thumbnail_url;
|
133 |
-
if( ! empty( $thumbnail_url ) ) {
|
134 |
$title = $oembed_response->title;
|
135 |
$provider_name = $oembed_response->provider_name;
|
136 |
$play_icon_url = '';
|
137 |
|
138 |
-
switch( $provider_name ) {
|
139 |
case 'YouTube':
|
140 |
$play_icon_url = ES_PLUGIN_URL . 'lite/public/images/youtube-play-button.png';
|
141 |
-
|
142 |
|
143 |
case 'Vimeo':
|
144 |
$play_icon_url = ES_PLUGIN_URL . 'lite/public/images/vimeo-play-button.png';
|
145 |
-
|
146 |
|
147 |
default:
|
148 |
$play_icon_url = ES_PLUGIN_URL . 'lite/public/images/default-play-button.png';
|
149 |
-
|
150 |
}
|
151 |
|
152 |
ob_start();
|
@@ -221,13 +221,13 @@ class ES_Common {
|
|
221 |
|
222 |
$dropdown = '';
|
223 |
foreach ( $statuses as $key => $status ) {
|
224 |
-
$dropdown .=
|
225 |
|
226 |
if ( strtolower( $selected ) === strtolower( $key ) ) {
|
227 |
-
$dropdown .=
|
228 |
}
|
229 |
|
230 |
-
$dropdown .=
|
231 |
}
|
232 |
|
233 |
return $dropdown;
|
@@ -247,35 +247,37 @@ class ES_Common {
|
|
247 |
|
248 |
$default_option[0] = __( $default_label, 'email-subscribers' );
|
249 |
|
250 |
-
$lists
|
251 |
-
$lists
|
252 |
$dropdown = '';
|
253 |
|
254 |
-
if( is_string( $selected ) && strpos( $selected, ',' ) > 0 ) {
|
255 |
$selected = explode( ',', $selected );
|
256 |
}
|
257 |
|
258 |
foreach ( $lists as $key => $list ) {
|
259 |
|
260 |
-
$dropdown .=
|
261 |
|
262 |
-
if( is_array( $selected ) ) {
|
263 |
-
if( in_array( $key, $selected ) ) {
|
264 |
-
$dropdown .=
|
265 |
}
|
266 |
} else {
|
267 |
if ( ! empty( $selected ) && $selected == $key ) {
|
268 |
-
$dropdown .=
|
269 |
}
|
270 |
}
|
271 |
|
272 |
-
$dropdown .=
|
273 |
}
|
274 |
|
275 |
return $dropdown;
|
276 |
}
|
277 |
|
278 |
/**
|
|
|
|
|
279 |
* @param string $selected
|
280 |
* @param string $default_label
|
281 |
*
|
@@ -295,13 +297,13 @@ class ES_Common {
|
|
295 |
|
296 |
$dropdown = '';
|
297 |
foreach ( $forms as $key => $form ) {
|
298 |
-
$dropdown .=
|
299 |
|
300 |
if ( $selected == $key ) {
|
301 |
-
$dropdown .=
|
302 |
}
|
303 |
|
304 |
-
$dropdown .=
|
305 |
}
|
306 |
|
307 |
return $dropdown;
|
@@ -348,7 +350,7 @@ class ES_Common {
|
|
348 |
$default_template_option = array( $default_template_option );
|
349 |
|
350 |
$templates = self::get_templates( $type );
|
351 |
-
|
352 |
if ( is_array( $templates ) ) {
|
353 |
$templates = array_merge( $default_template_option, $templates );
|
354 |
}
|
@@ -356,14 +358,14 @@ class ES_Common {
|
|
356 |
|
357 |
$dropdown = '';
|
358 |
foreach ( $templates as $key => $template ) {
|
359 |
-
$es_templ_thumbnail = ( ! empty( $template->ID ) ) ?
|
360 |
-
$dropdown .= "<option data-img='" . $es_templ_thumbnail . "' value='
|
361 |
|
362 |
if ( absint( $selected ) === absint( $template->ID ) ) {
|
363 |
-
$dropdown .=
|
364 |
}
|
365 |
|
366 |
-
$dropdown .=
|
367 |
}
|
368 |
|
369 |
return $dropdown;
|
@@ -387,13 +389,13 @@ class ES_Common {
|
|
387 |
|
388 |
$dropdown = '';
|
389 |
foreach ( $statuses as $key => $status ) {
|
390 |
-
$dropdown .=
|
391 |
|
392 |
if ( strtolower( $selected ) === strtolower( $key ) ) {
|
393 |
-
$dropdown .=
|
394 |
}
|
395 |
|
396 |
-
$dropdown .=
|
397 |
}
|
398 |
|
399 |
return $dropdown;
|
@@ -450,20 +452,20 @@ class ES_Common {
|
|
450 |
$category_names = array();
|
451 |
}
|
452 |
$checked_selected = ! in_array( 'All', $category_names ) ? "checked='checked'" : '';
|
453 |
-
$category_html = '<tr><td style="padding-top:4px;padding-bottom:4px;padding-right:10px;" ><span class="block ml-6 pr-4 text-sm font-normal text-gray-600 pb-1"><input class="es-note-category-parent form-radio text-indigo-600" type="radio" ' . $checked_selected . ' value="selected_cat" name="es_note_cat_parent">' . __( 'Select Categories',
|
454 |
'email-subscribers' ) . '</td></tr>';
|
455 |
foreach ( $categories as $category ) {
|
456 |
|
457 |
if ( in_array( $category->term_id, $category_names ) ) {
|
458 |
$checked = "checked='checked'";
|
459 |
} else {
|
460 |
-
$checked =
|
461 |
}
|
462 |
|
463 |
-
$category_html .= '<tr class="es-note-child-category"><td style="padding-top:4px;padding-bottom:4px;padding-right:10px;"><span class="block ml-6 pr-4 text-sm font-normal text-gray-600 pb-1"><input type="checkbox" class="form-checkbox" ' . $checked . ' value="' . $category->term_id . '" id="es_note_cat[]" name="es_note_cat[]">' . $category->name . '</td></tr>';
|
464 |
}
|
465 |
$checked_all = in_array( 'All', $category_names ) ? "checked='checked'" : '';
|
466 |
-
$all_html = '<tr><td style="padding-top:4px;padding-bottom:4px;padding-right:10px;"><span class="block ml-6 pr-4 text-sm font-normal text-gray-600 pb-1"><input type="radio" class="form-radio text-indigo-600 es-note-category-parent" ' . $checked_all . ' value="{a}All{a}" name="es_note_cat_parent">' . __( 'All Categories (Also include all categories which will create later)',
|
467 |
'email-subscribers' ) . '</td></tr>';
|
468 |
|
469 |
return $all_html . $category_html;
|
@@ -490,9 +492,9 @@ class ES_Common {
|
|
490 |
if ( is_array( $custom_post_types ) && in_array( $post_type_search, $custom_post_types ) ) {
|
491 |
$checked = "checked='checked'";
|
492 |
} else {
|
493 |
-
$checked =
|
494 |
}
|
495 |
-
$custom_post_type_html .= '<tr><td style="padding-top:4px;padding-bottom:4px;padding-right:10px;"><span class="block ml-12 pr-4 text-sm font-medium text-gray-600 pb-2"><input type="checkbox" ' . $checked . ' value="{T}' . $post_type . '{T}" id="es_note_cat[]" class="es_custom_post_type form-checkbox" name="es_note_cat[]">' . $post_type . '</td></tr>';
|
496 |
}
|
497 |
|
498 |
} else {
|
@@ -613,7 +615,7 @@ class ES_Common {
|
|
613 |
$categories_str = '';
|
614 |
|
615 |
if ( is_array( $categories ) && count( $categories ) > 0 ) {
|
616 |
-
$categories_str =
|
617 |
$categories_str = wp_specialchars_decode( $categories_str, ENT_QUOTES );
|
618 |
}
|
619 |
|
@@ -655,7 +657,7 @@ class ES_Common {
|
|
655 |
* @since 4.1.0
|
656 |
*/
|
657 |
public static function convert_id_to_name( $category ) {
|
658 |
-
if (
|
659 |
return get_cat_name( $category );
|
660 |
} else {
|
661 |
return $category;
|
@@ -693,7 +695,7 @@ class ES_Common {
|
|
693 |
public static function prepare_category_string( $category = '' ) {
|
694 |
$category_str = '';
|
695 |
if ( ! empty( $category ) ) {
|
696 |
-
$category_str =
|
697 |
}
|
698 |
|
699 |
return $category_str;
|
@@ -711,7 +713,7 @@ class ES_Common {
|
|
711 |
public static function prepare_custom_post_type_string( $post_type = '' ) {
|
712 |
$post_type_str = '';
|
713 |
if ( ! empty( $post_type ) ) {
|
714 |
-
$post_type_str =
|
715 |
}
|
716 |
|
717 |
return $post_type_str;
|
@@ -812,7 +814,6 @@ class ES_Common {
|
|
812 |
* Option - 2 -> ES < 4.0.4 email_subscriber_widget
|
813 |
* Option - 3 -> ES > 4.0.5 email-subscribers-form
|
814 |
*
|
815 |
-
*
|
816 |
* - Fetch Option 1 from options table
|
817 |
* - Create a form
|
818 |
* - Set a new option with Option - 3 (title, form_id)
|
@@ -984,8 +985,9 @@ class ES_Common {
|
|
984 |
if ( $is_dismissible ) {
|
985 |
$class .= ' is-dismissible';
|
986 |
}
|
|
|
|
|
987 |
|
988 |
-
echo "<div class='{$class}'><p>{$message}</p></div>";
|
989 |
}
|
990 |
|
991 |
/**
|
@@ -1007,17 +1009,22 @@ class ES_Common {
|
|
1007 |
$is_imp = ! empty( $navigation['is_imp'] ) ? $navigation['is_imp'] : false;
|
1008 |
?>
|
1009 |
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
|
|
|
|
|
|
|
|
1013 |
<?php if ( $show_indicator ) { ?>
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
|
1018 |
<?php } ?>
|
1019 |
-
|
1020 |
-
|
|
|
1021 |
}
|
1022 |
|
1023 |
/**
|
@@ -1060,18 +1067,18 @@ class ES_Common {
|
|
1060 |
|
1061 |
?>
|
1062 |
|
1063 |
-
|
1064 |
-
|
1065 |
<?php if ( $show_icon ) { ?>
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
<?php } ?>
|
1070 |
-
|
1071 |
-
<?php echo $content_html; ?>
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
|
1076 |
<?php
|
1077 |
}
|
@@ -1162,9 +1169,8 @@ class ES_Common {
|
|
1162 |
|
1163 |
global $wpdb;
|
1164 |
|
1165 |
-
$
|
1166 |
-
|
1167 |
-
$results = $wpdb->get_results( $query, ARRAY_A );
|
1168 |
|
1169 |
$options_name_value_map = array();
|
1170 |
if ( count( $results ) > 0 ) {
|
@@ -1240,7 +1246,7 @@ class ES_Common {
|
|
1240 |
$email_sent_data_option = 'email_sent_data';
|
1241 |
|
1242 |
//Get total emails sent in this hour
|
1243 |
-
$email_sent_data =
|
1244 |
|
1245 |
$total_emails_sent = 0;
|
1246 |
$data = array();
|
@@ -1248,11 +1254,11 @@ class ES_Common {
|
|
1248 |
$total_emails_sent = $email_sent_data[ $current_date ][ $current_hour ];
|
1249 |
}
|
1250 |
|
1251 |
-
$total_emails_sent
|
1252 |
// We want to store only current hour data.
|
1253 |
$data[ $current_date ][ $current_hour ] = $total_emails_sent;
|
1254 |
|
1255 |
-
|
1256 |
|
1257 |
}
|
1258 |
|
@@ -1516,16 +1522,16 @@ class ES_Common {
|
|
1516 |
|
1517 |
$campaign_type = self::get_campaign_type_key_name_map();
|
1518 |
|
1519 |
-
$dropdown = '<option class="text-sm" value="">All Types</option>';
|
1520 |
foreach ( $campaign_type as $key => $type ) {
|
1521 |
|
1522 |
-
$dropdown .=
|
1523 |
|
1524 |
if ( strtolower( $selected ) === strtolower( $key ) ) {
|
1525 |
-
$dropdown .=
|
1526 |
}
|
1527 |
|
1528 |
-
$dropdown .=
|
1529 |
}
|
1530 |
|
1531 |
return $dropdown;
|
@@ -1572,17 +1578,17 @@ class ES_Common {
|
|
1572 |
|
1573 |
$statuses = self::get_campaign_statuses_key_name_map();
|
1574 |
|
1575 |
-
$dropdown = '<option class="text-sm" value="">All Statuses</option>';
|
1576 |
|
1577 |
foreach ( $statuses as $key => $status ) {
|
1578 |
|
1579 |
-
$dropdown .=
|
1580 |
|
1581 |
if ( strtolower( $selected ) === strtolower( $key ) ) {
|
1582 |
-
$dropdown .=
|
1583 |
}
|
1584 |
|
1585 |
-
$dropdown .=
|
1586 |
}
|
1587 |
|
1588 |
return $dropdown;
|
@@ -1631,7 +1637,7 @@ class ES_Common {
|
|
1631 |
self::update_coupon_data( $coupon );
|
1632 |
}
|
1633 |
return $can_show;
|
1634 |
-
|
1635 |
}
|
1636 |
|
1637 |
/**
|
@@ -1644,9 +1650,11 @@ class ES_Common {
|
|
1644 |
public static function update_coupon_data( $coupon ) {
|
1645 |
$coupons = get_option( 'ig_es_coupons', array() );
|
1646 |
|
|
|
|
|
1647 |
$coupons[ $coupon ] = array(
|
1648 |
'last_shown_time' => time(),
|
1649 |
-
'count' => $
|
1650 |
);
|
1651 |
|
1652 |
update_option( 'ig_es_coupons', $coupons );
|
23 |
* @since 4.0
|
24 |
*/
|
25 |
public static function convert_es_templates( $template, $name, $email, $es_templ_id = 0 ) {
|
26 |
+
$convert_template = str_replace( '{{NAME}}', $name, $template );
|
27 |
+
$convert_template = str_replace( '{{EMAIL}}', $email, $convert_template );
|
28 |
|
29 |
return $convert_template;
|
30 |
}
|
54 |
$content = $data['content'];
|
55 |
//total contacts
|
56 |
$total_contacts = ES()->contacts_db->count_active_contacts_by_list_id();
|
57 |
+
$content = str_replace( '{{TOTAL-CONTACTS}}', $total_contacts, $content );
|
58 |
//blog title
|
59 |
$blog_name = get_option( 'blogname' );
|
60 |
+
$content = str_replace( '{{SITENAME}}', $blog_name, $content );
|
61 |
// site url
|
62 |
$site_url = home_url( '/' );
|
63 |
+
$content = str_replace( '{{SITEURL}}', $site_url, $content );
|
64 |
|
65 |
/*TODO: Enable it once Pre header issue fix
|
66 |
$meta = ES()->campaigns_db->get_campaign_meta_by_id( $campaign_id );
|
115 |
|
116 |
$post_link = get_permalink( $post_ID );
|
117 |
// Check if current URL is same as current post's permalink.
|
118 |
+
if ( ! empty( $post_link ) && $url === $post_link ) {
|
119 |
// Convert URL HTML back to URL itself if it a current post URL.
|
120 |
$html = $url;
|
121 |
} else {
|
122 |
+
if ( ! class_exists( 'WP_oEmbed' ) ) {
|
123 |
+
require_once ABSPATH . 'wp-includes/class-wp-oembed.php' ;
|
124 |
}
|
125 |
|
126 |
$oembed = new WP_oEmbed();
|
127 |
$provider = $oembed->discover( $url );
|
128 |
|
129 |
+
if ( ! empty( $provider ) ) {
|
130 |
$oembed_response = $oembed->fetch( $provider, $url, $attr );
|
131 |
+
if ( is_object( $oembed_response ) && ! empty( $oembed_response->type ) && 'video' === $oembed_response->type ) {
|
132 |
$thumbnail_url = $oembed_response->thumbnail_url;
|
133 |
+
if ( ! empty( $thumbnail_url ) ) {
|
134 |
$title = $oembed_response->title;
|
135 |
$provider_name = $oembed_response->provider_name;
|
136 |
$play_icon_url = '';
|
137 |
|
138 |
+
switch ( $provider_name ) {
|
139 |
case 'YouTube':
|
140 |
$play_icon_url = ES_PLUGIN_URL . 'lite/public/images/youtube-play-button.png';
|
141 |
+
break;
|
142 |
|
143 |
case 'Vimeo':
|
144 |
$play_icon_url = ES_PLUGIN_URL . 'lite/public/images/vimeo-play-button.png';
|
145 |
+
break;
|
146 |
|
147 |
default:
|
148 |
$play_icon_url = ES_PLUGIN_URL . 'lite/public/images/default-play-button.png';
|
149 |
+
break;
|
150 |
}
|
151 |
|
152 |
ob_start();
|
221 |
|
222 |
$dropdown = '';
|
223 |
foreach ( $statuses as $key => $status ) {
|
224 |
+
$dropdown .= '<option class="text-sm" value="' . esc_attr( $key ) . '" ';
|
225 |
|
226 |
if ( strtolower( $selected ) === strtolower( $key ) ) {
|
227 |
+
$dropdown .= 'selected = selected';
|
228 |
}
|
229 |
|
230 |
+
$dropdown .= '>' . esc_html( $status ) . '</option>';
|
231 |
}
|
232 |
|
233 |
return $dropdown;
|
247 |
|
248 |
$default_option[0] = __( $default_label, 'email-subscribers' );
|
249 |
|
250 |
+
$lists = ES()->lists_db->get_list_id_name_map();
|
251 |
+
$lists = $default_option + $lists;
|
252 |
$dropdown = '';
|
253 |
|
254 |
+
if ( is_string( $selected ) && strpos( $selected, ',' ) > 0 ) {
|
255 |
$selected = explode( ',', $selected );
|
256 |
}
|
257 |
|
258 |
foreach ( $lists as $key => $list ) {
|
259 |
|
260 |
+
$dropdown .= '<option value="' . esc_attr( $key ) . '" ';
|
261 |
|
262 |
+
if ( is_array( $selected ) ) {
|
263 |
+
if ( in_array( $key, $selected ) ) {
|
264 |
+
$dropdown .= 'selected = selected';
|
265 |
}
|
266 |
} else {
|
267 |
if ( ! empty( $selected ) && $selected == $key ) {
|
268 |
+
$dropdown .= 'selected = selected';
|
269 |
}
|
270 |
}
|
271 |
|
272 |
+
$dropdown .= '>' . esc_html( $list ) . '</option>';
|
273 |
}
|
274 |
|
275 |
return $dropdown;
|
276 |
}
|
277 |
|
278 |
/**
|
279 |
+
* Prepare dropdown with form names
|
280 |
+
*
|
281 |
* @param string $selected
|
282 |
* @param string $default_label
|
283 |
*
|
297 |
|
298 |
$dropdown = '';
|
299 |
foreach ( $forms as $key => $form ) {
|
300 |
+
$dropdown .= '<option value="' . esc_attr( $key ) . '" ';
|
301 |
|
302 |
if ( $selected == $key ) {
|
303 |
+
$dropdown .= 'selected = selected';
|
304 |
}
|
305 |
|
306 |
+
$dropdown .= '>' . esc_html( $form ) . '</option>';
|
307 |
}
|
308 |
|
309 |
return $dropdown;
|
350 |
$default_template_option = array( $default_template_option );
|
351 |
|
352 |
$templates = self::get_templates( $type );
|
353 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
354 |
if ( is_array( $templates ) ) {
|
355 |
$templates = array_merge( $default_template_option, $templates );
|
356 |
}
|
358 |
|
359 |
$dropdown = '';
|
360 |
foreach ( $templates as $key => $template ) {
|
361 |
+
$es_templ_thumbnail = ( ! empty( $template->ID ) ) ? get_the_post_thumbnail_url( $template->ID, array( '200', '200' ) ) : ES_PLUGIN_URL . 'images/envelope.png';
|
362 |
+
$dropdown .= "<option data-img-url='" . $es_templ_thumbnail . "' value='" . $template->ID . "'";
|
363 |
|
364 |
if ( absint( $selected ) === absint( $template->ID ) ) {
|
365 |
+
$dropdown .= ' selected="selected"';
|
366 |
}
|
367 |
|
368 |
+
$dropdown .= '>' . $template->post_title . '</option>';
|
369 |
}
|
370 |
|
371 |
return $dropdown;
|
389 |
|
390 |
$dropdown = '';
|
391 |
foreach ( $statuses as $key => $status ) {
|
392 |
+
$dropdown .= '<option value="' . esc_attr( $key ) . '" ';
|
393 |
|
394 |
if ( strtolower( $selected ) === strtolower( $key ) ) {
|
395 |
+
$dropdown .= 'selected = selected';
|
396 |
}
|
397 |
|
398 |
+
$dropdown .= '>' . esc_html( $status ) . '</option>';
|
399 |
}
|
400 |
|
401 |
return $dropdown;
|
452 |
$category_names = array();
|
453 |
}
|
454 |
$checked_selected = ! in_array( 'All', $category_names ) ? "checked='checked'" : '';
|
455 |
+
$category_html = '<tr><td style="padding-top:4px;padding-bottom:4px;padding-right:10px;" ><span class="block ml-6 pr-4 text-sm font-normal text-gray-600 pb-1"><input class="es-note-category-parent form-radio text-indigo-600" type="radio" ' . esc_attr( $checked_selected ) . ' value="selected_cat" name="es_note_cat_parent">' . __( 'Select Categories',
|
456 |
'email-subscribers' ) . '</td></tr>';
|
457 |
foreach ( $categories as $category ) {
|
458 |
|
459 |
if ( in_array( $category->term_id, $category_names ) ) {
|
460 |
$checked = "checked='checked'";
|
461 |
} else {
|
462 |
+
$checked = '';
|
463 |
}
|
464 |
|
465 |
+
$category_html .= '<tr class="es-note-child-category"><td style="padding-top:4px;padding-bottom:4px;padding-right:10px;"><span class="block ml-6 pr-4 text-sm font-normal text-gray-600 pb-1"><input type="checkbox" class="form-checkbox" ' . esc_attr( $checked ) . ' value="' . esc_attr( $category->term_id ) . '" id="es_note_cat[]" name="es_note_cat[]">' . esc_html( $category->name ) . '</td></tr>';
|
466 |
}
|
467 |
$checked_all = in_array( 'All', $category_names ) ? "checked='checked'" : '';
|
468 |
+
$all_html = '<tr><td style="padding-top:4px;padding-bottom:4px;padding-right:10px;"><span class="block ml-6 pr-4 text-sm font-normal text-gray-600 pb-1"><input type="radio" class="form-radio text-indigo-600 es-note-category-parent" ' . esc_attr( $checked_all ) . ' value="{a}All{a}" name="es_note_cat_parent">' . __( 'All Categories (Also include all categories which will create later)',
|
469 |
'email-subscribers' ) . '</td></tr>';
|
470 |
|
471 |
return $all_html . $category_html;
|
492 |
if ( is_array( $custom_post_types ) && in_array( $post_type_search, $custom_post_types ) ) {
|
493 |
$checked = "checked='checked'";
|
494 |
} else {
|
495 |
+
$checked = '';
|
496 |
}
|
497 |
+
$custom_post_type_html .= '<tr><td style="padding-top:4px;padding-bottom:4px;padding-right:10px;"><span class="block ml-12 pr-4 text-sm font-medium text-gray-600 pb-2"><input type="checkbox" ' . esc_attr( $checked ) . ' value="{T}' . esc_html( $post_type ) . '{T}" id="es_note_cat[]" class="es_custom_post_type form-checkbox" name="es_note_cat[]">' . esc_html( $post_type ) . '</td></tr>';
|
498 |
}
|
499 |
|
500 |
} else {
|
615 |
$categories_str = '';
|
616 |
|
617 |
if ( is_array( $categories ) && count( $categories ) > 0 ) {
|
618 |
+
$categories_str = '##' . implode( '##', $categories ) . '##';
|
619 |
$categories_str = wp_specialchars_decode( $categories_str, ENT_QUOTES );
|
620 |
}
|
621 |
|
657 |
* @since 4.1.0
|
658 |
*/
|
659 |
public static function convert_id_to_name( $category ) {
|
660 |
+
if ( 'All' != $category ) {
|
661 |
return get_cat_name( $category );
|
662 |
} else {
|
663 |
return $category;
|
695 |
public static function prepare_category_string( $category = '' ) {
|
696 |
$category_str = '';
|
697 |
if ( ! empty( $category ) ) {
|
698 |
+
$category_str = '##' . $category . '##';
|
699 |
}
|
700 |
|
701 |
return $category_str;
|
713 |
public static function prepare_custom_post_type_string( $post_type = '' ) {
|
714 |
$post_type_str = '';
|
715 |
if ( ! empty( $post_type ) ) {
|
716 |
+
$post_type_str = '##{T}' . $post_type . '{T}##';
|
717 |
}
|
718 |
|
719 |
return $post_type_str;
|
814 |
* Option - 2 -> ES < 4.0.4 email_subscriber_widget
|
815 |
* Option - 3 -> ES > 4.0.5 email-subscribers-form
|
816 |
*
|
|
|
817 |
* - Fetch Option 1 from options table
|
818 |
* - Create a form
|
819 |
* - Set a new option with Option - 3 (title, form_id)
|
985 |
if ( $is_dismissible ) {
|
986 |
$class .= ' is-dismissible';
|
987 |
}
|
988 |
+
/* translators: 1: Class name 2: Message */
|
989 |
+
echo sprintf( '<div class="%s"><p>%s</p></div>', esc_attr( $class ), wp_kses_post( $message ) );
|
990 |
|
|
|
991 |
}
|
992 |
|
993 |
/**
|
1009 |
$is_imp = ! empty( $navigation['is_imp'] ) ? $navigation['is_imp'] : false;
|
1010 |
?>
|
1011 |
|
1012 |
+
<a href="<?php echo esc_url( $url ); ?>" class="ig-es-title-button px-2 py-2 mx-2
|
1013 |
+
<?php
|
1014 |
+
if ( $is_imp ) {
|
1015 |
+
echo esc_attr( ' ig-es-imp-button' );
|
1016 |
+
}
|
1017 |
+
?>
|
1018 |
+
"><?php echo esc_html( $action_label ); ?>
|
1019 |
<?php if ( $show_indicator ) { ?>
|
1020 |
+
<span class="ig-es-indicator <?php echo esc_attr( $indicator_class ); ?>">
|
1021 |
+
<?php echo esc_html( $indicator_label ); ?>
|
1022 |
+
</span>
|
1023 |
|
1024 |
<?php } ?>
|
1025 |
+
</a>
|
1026 |
+
<?php
|
1027 |
+
}
|
1028 |
}
|
1029 |
|
1030 |
/**
|
1067 |
|
1068 |
?>
|
1069 |
|
1070 |
+
<div class="<?php echo esc_attr( $div_class ); ?>">
|
1071 |
+
<div class="ig-vertical-align">
|
1072 |
<?php if ( $show_icon ) { ?>
|
1073 |
+
<div class="ig-es-icon text-center">
|
1074 |
+
<span class="dashicons ig-es-icon-<?php echo esc_attr( $type ); ?>"></span>
|
1075 |
+
</div>
|
1076 |
<?php } ?>
|
1077 |
+
<div class="ig-es-info-message">
|
1078 |
+
<?php echo wp_kses_post( $content_html ); ?>
|
1079 |
+
</div>
|
1080 |
+
</div>
|
1081 |
+
</div>
|
1082 |
|
1083 |
<?php
|
1084 |
}
|
1169 |
|
1170 |
global $wpdb;
|
1171 |
|
1172 |
+
$option_name_like = 'ig_es_%';
|
1173 |
+
$results = $wpdb->get_results( $wpdb->prepare( "SELECT option_name, option_value FROM {$wpdb->prefix}options WHERE option_name LIKE %s AND option_name != %s", $option_name_like, 'ig_es_managed_blocked_domains' ), ARRAY_A );
|
|
|
1174 |
|
1175 |
$options_name_value_map = array();
|
1176 |
if ( count( $results ) > 0 ) {
|
1246 |
$email_sent_data_option = 'email_sent_data';
|
1247 |
|
1248 |
//Get total emails sent in this hour
|
1249 |
+
$email_sent_data = self::get_ig_option( $email_sent_data_option, array() );
|
1250 |
|
1251 |
$total_emails_sent = 0;
|
1252 |
$data = array();
|
1254 |
$total_emails_sent = $email_sent_data[ $current_date ][ $current_hour ];
|
1255 |
}
|
1256 |
|
1257 |
+
$total_emails_sent++;
|
1258 |
// We want to store only current hour data.
|
1259 |
$data[ $current_date ][ $current_hour ] = $total_emails_sent;
|
1260 |
|
1261 |
+
self::set_ig_option( $email_sent_data_option, $data );
|
1262 |
|
1263 |
}
|
1264 |
|
1522 |
|
1523 |
$campaign_type = self::get_campaign_type_key_name_map();
|
1524 |
|
1525 |
+
$dropdown = '<option class="text-sm" value="">' . esc_html__( 'All Types', 'email-subscribers' ) . '</option>';
|
1526 |
foreach ( $campaign_type as $key => $type ) {
|
1527 |
|
1528 |
+
$dropdown .= '<option value="' . esc_attr( $key ) . '" ';
|
1529 |
|
1530 |
if ( strtolower( $selected ) === strtolower( $key ) ) {
|
1531 |
+
$dropdown .= 'selected = selected';
|
1532 |
}
|
1533 |
|
1534 |
+
$dropdown .= '>' . esc_html( $type ) . '</option>';
|
1535 |
}
|
1536 |
|
1537 |
return $dropdown;
|
1578 |
|
1579 |
$statuses = self::get_campaign_statuses_key_name_map();
|
1580 |
|
1581 |
+
$dropdown = '<option class="text-sm" value="">' . esc_html__( 'All Statuses', 'email-subscribers' ) . '</option>';
|
1582 |
|
1583 |
foreach ( $statuses as $key => $status ) {
|
1584 |
|
1585 |
+
$dropdown .= '<option class="text-sm" value="' . esc_attr( $key ) . '" ';
|
1586 |
|
1587 |
if ( strtolower( $selected ) === strtolower( $key ) ) {
|
1588 |
+
$dropdown .= 'selected = selected';
|
1589 |
}
|
1590 |
|
1591 |
+
$dropdown .= '>' . esc_html( $status ) . '</option>';
|
1592 |
}
|
1593 |
|
1594 |
return $dropdown;
|
1637 |
self::update_coupon_data( $coupon );
|
1638 |
}
|
1639 |
return $can_show;
|
1640 |
+
*/
|
1641 |
}
|
1642 |
|
1643 |
/**
|
1650 |
public static function update_coupon_data( $coupon ) {
|
1651 |
$coupons = get_option( 'ig_es_coupons', array() );
|
1652 |
|
1653 |
+
$shown_count = ! empty( $coupons[ $coupon ]['count'] ) ? $coupons[ $coupon ]['count'] : 0;
|
1654 |
+
|
1655 |
$coupons[ $coupon ] = array(
|
1656 |
'last_shown_time' => time(),
|
1657 |
+
'count' => $shown_count + 1
|
1658 |
);
|
1659 |
|
1660 |
update_option( 'ig_es_coupons', $coupons );
|
lite/includes/class-es-install.php
CHANGED
@@ -267,12 +267,12 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
267 |
public static function install_actions() {
|
268 |
if ( ! empty( $_GET['do_update_ig_es'] ) ) {
|
269 |
check_admin_referer( 'ig_es_db_update', 'ig_es_db_update_nonce' );
|
270 |
-
$from_db_version = ! empty( $_GET['from_db_version'] ) ? $_GET['from_db_version'] : '';
|
271 |
|
272 |
self::delete_update_transient();
|
273 |
|
274 |
if ( ! empty( $from_db_version ) ) {
|
275 |
-
self::$logger->info( sprintf(
|
276 |
|
277 |
self::update_db_version( $from_db_version );
|
278 |
}
|
@@ -373,9 +373,7 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
373 |
$running_migration_queue_like = '%' . $wpdb->esc_like( '_running_migration_for_' ) . '%';
|
374 |
$db_migration_queue_like = '%' . $wpdb->esc_like( 'ig_es_updater_batch_' ) . '%';
|
375 |
|
376 |
-
$query
|
377 |
-
|
378 |
-
$wpdb->query( $query );
|
379 |
|
380 |
}
|
381 |
|
@@ -426,7 +424,7 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
426 |
|
427 |
$latest_db_version_to_update = self::get_latest_db_version_to_update();
|
428 |
|
429 |
-
self::$logger->info( sprintf(
|
430 |
|
431 |
return ! is_null( $current_db_version ) && version_compare( $current_db_version, $latest_db_version_to_update, '<' );
|
432 |
}
|
@@ -488,7 +486,7 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
488 |
// Get all tasks processed
|
489 |
$processed_tasks = get_option( 'ig_es_update_processed_tasks', array() );
|
490 |
|
491 |
-
self::$logger->info( sprintf(
|
492 |
|
493 |
// Get al tasks to process
|
494 |
$tasks = self::get_db_update_callbacks();
|
@@ -512,14 +510,14 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
512 |
|
513 |
if ( count( $tasks_to_process ) > 0 ) {
|
514 |
|
515 |
-
self::$logger->info(
|
516 |
|
517 |
update_option( 'ig_es_update_tasks_to_process', $tasks_to_process );
|
518 |
|
519 |
self::dispatch();
|
520 |
|
521 |
} else {
|
522 |
-
self::$logger->info(
|
523 |
delete_transient( 'ig_es_updating' );
|
524 |
}
|
525 |
|
@@ -540,15 +538,18 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
540 |
|
541 |
if ( count( $batch ) > 0 ) {
|
542 |
|
543 |
-
$current_memory_limit = @ini_get( 'memory_limit' );
|
544 |
-
|
545 |
// We may require lots of memory
|
546 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
547 |
|
548 |
// It may take long time to process database update.
|
549 |
// So, increase execution time
|
550 |
@set_time_limit( 360 );
|
551 |
-
@ini_set( 'max_execution_time', 360 );
|
552 |
|
553 |
foreach ( $batch as $key => $value ) {
|
554 |
|
@@ -560,9 +561,9 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
560 |
// Check whether the tasks is already processed? If not, process it.
|
561 |
if ( ! in_array( $value, $ig_es_update_processed_tasks ) ) {
|
562 |
$is_value_exists = false;
|
563 |
-
$logger->info( sprintf(
|
564 |
$task = (bool) self::task( $value );
|
565 |
-
$logger->info( sprintf(
|
566 |
} else {
|
567 |
$logger->info( sprintf( "Task '%s' is already processed. Remove it from list", $value ), self::$logger_context );
|
568 |
unset( $batch[ $key ] );
|
@@ -581,8 +582,6 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
581 |
}
|
582 |
|
583 |
update_option( 'ig_es_update_tasks_to_process', $batch );
|
584 |
-
|
585 |
-
@ini_set( 'memory_limit', $current_memory_limit );
|
586 |
}
|
587 |
|
588 |
//Delete update transient
|
@@ -673,8 +672,8 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
673 |
$admin_email = get_option( 'admin_email', '' );
|
674 |
$blog_name = get_option( 'blogname', '' );
|
675 |
|
676 |
-
if (
|
677 |
-
$admin_email =
|
678 |
}
|
679 |
|
680 |
$sender_details['name'] = $blog_name;
|
@@ -718,35 +717,35 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
718 |
$sender_details = self::get_sender_details();
|
719 |
|
720 |
$home_url = home_url( '/' );
|
721 |
-
$optinlink = $home_url .
|
722 |
-
$unsublink = $home_url .
|
723 |
|
724 |
$guid = ES_Common::generate_guid( 6 );
|
725 |
-
$cronurl = $home_url .
|
726 |
|
727 |
-
$report
|
728 |
$report .= "Hi Admin,\n\n";
|
729 |
$report .= "Email has been sent successfully to {{COUNT}} email(s). Please find the details below:\n\n";
|
730 |
$report .= "Unique ID: {{UNIQUE}}\n";
|
731 |
$report .= "Start Time: {{STARTTIME}}\n";
|
732 |
$report .= "End Time: {{ENDTIME}}\n";
|
733 |
$report .= "For more information, login to your dashboard and go to Reports menu in Email Subscribers.\n\n";
|
734 |
-
$report .=
|
735 |
|
736 |
|
737 |
-
$new_contact_email_subject =
|
738 |
$new_contact_email_content = "Hi,\r\n\r\nYour friendly Email Subscribers notification bot here!\r\n\r\n{{NAME}} ({{EMAIL}}) joined our tribe just now.\r\n\r\nWhich list/s? {{LIST}}\r\n\r\nIf you know this person, or if they are an influencer, you may want to reach out to them personally!\r\n\r\nLater...";
|
739 |
|
740 |
-
$confirmation_email_subject =
|
741 |
$confirmation_email_content = "Hi {{NAME}},\r\n\r\nJust one more step before we share the awesomeness from {{SITENAME}}!\r\n\r\nPlease confirm your subscription by clicking on <a href='{{SUBSCRIBE-LINK}}'>this link</a>\r\n\r\nThanks!";
|
742 |
|
743 |
-
$welcome_email_subject =
|
744 |
$welcome_email_content = "Hi {{NAME}},\r\n\r\nJust wanted to send you a quick note...\r\n\r\nThank you for joining the awesome {{SITENAME}} tribe.\r\n\r\nOnly valuable emails from me, promise!\r\n\r\nThanks!";
|
745 |
|
746 |
$cron_admin_email = "Hi Admin,\r\n\r\nCron URL has been triggered successfully on {{DATE}} for the email '{{SUBJECT}}'. And it sent email to {{COUNT}} recipient(s).\r\n\r\nBest,\r\n" . $blogname;
|
747 |
$unsubscribe_link_content = "I'd be sad to see you go. But if you want to, you can unsubscribe from <a href='{{UNSUBSCRIBE-LINK}}'>here</a>";
|
748 |
|
749 |
-
$unsubscribe_message =
|
750 |
$subscription_error_message = "Hmm.. Something's amiss..\r\n\r\nCould not complete your request. That email address is probably already subscribed. Or worse blocked!!\r\n\r\nPlease try again after some time - or contact us if the problem persists.\r\n\r\n";
|
751 |
|
752 |
$unsubscribe_error_message = "Urrgh.. Something's wrong..\r\n\r\nAre you sure that email address is on our file? There was some problem in completing your request.\r\n\r\nPlease try again after some time - or contact us if the problem persists.\r\n\r\n";
|
@@ -766,7 +765,7 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
766 |
'ig_es_cron_admin_email' => array( 'default' => $cron_admin_email, 'old_option' => 'ig_es_cron_adminmail' ),
|
767 |
'ig_es_cronurl' => array( 'default' => $cronurl, 'old_option' => 'ig_es_cronurl' ),
|
768 |
'ig_es_hourly_email_send_limit' => array( 'default' => 300, 'old_option' => 'ig_es_cron_mailcount' ),
|
769 |
-
'ig_es_sent_report_subject' => array( 'default' =>
|
770 |
'ig_es_sent_report_content' => array( 'default' => $report, 'old_option' => 'ig_es_sentreport' ),
|
771 |
'ig_es_unsubscribe_link' => array( 'default' => $unsublink, 'old_option' => 'ig_es_unsublink' ),
|
772 |
'ig_es_optin_link' => array( 'default' => $optinlink, 'old_option' => 'ig_es_optinlink' ),
|
@@ -775,7 +774,7 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
775 |
'ig_es_notify_admin' => array( 'default' => 'yes', 'old_option' => 'ig_es_notifyadmin', 'action' => 'convert_space_to_underscore' ),
|
776 |
'ig_es_optin_type' => array( 'default' => 'double_opt_in', 'old_option' => 'ig_es_optintype', 'action' => 'convert_space_to_underscore' ),
|
777 |
'ig_es_subscription_error_messsage' => array( 'default' => $subscription_error_message, 'old_option' => 'ig_es_suberror' ),
|
778 |
-
'ig_es_subscription_success_message' => array( 'default' =>
|
779 |
'ig_es_unsubscribe_error_message' => array( 'default' => $unsubscribe_error_message, 'old_option' => 'ig_es_unsuberror' ),
|
780 |
'ig_es_unsubscribe_success_message' => array( 'default' => $unsubscribe_message, 'old_option' => 'ig_es_unsubtext' ),
|
781 |
'ig_es_post_image_size' => array( 'default' => 'thumbnail', 'old_option' => 'ig_es_post_image_size' ),
|
@@ -797,7 +796,7 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
797 |
'ig_es_db_update_history' => array( 'default' => $ig_es_db_update_history ),
|
798 |
'ig_es_email_sent_data' => array( 'default' => array() ),
|
799 |
'ig_es_mailer_settings' => array( 'default' => array( 'mailer' => 'wpmail' ), 'old_option' => '' ),
|
800 |
-
'ig_es_user_roles' => array( 'default' =>
|
801 |
'ig_es_cron_interval' => array( 'default' => IG_ES_CRON_INTERVAL, 'old_option' => '' ),
|
802 |
'ig_es_max_email_send_at_once' => array( 'default' => IG_ES_MAX_EMAIL_SEND_AT_ONCE, 'old_option' => '' ),
|
803 |
);
|
@@ -806,12 +805,14 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
806 |
}
|
807 |
|
808 |
/**
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
|
|
|
|
815 |
public static function create_tables( $version = null ) {
|
816 |
|
817 |
global $wpdb;
|
@@ -983,12 +984,14 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
983 |
}
|
984 |
|
985 |
/**
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
|
|
|
|
992 |
public static function get_ig_es_420_schema( $collate = '' ) {
|
993 |
global $wpdb;
|
994 |
|
@@ -1166,7 +1169,7 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
1166 |
*/
|
1167 |
private static function get_schema( $collate = '' ) {
|
1168 |
|
1169 |
-
$tables
|
1170 |
$tables .= self::get_ig_es_420_schema( $collate );
|
1171 |
$tables .= self::get_ig_es_421_schema( $collate );
|
1172 |
$tables .= self::get_ig_es_424_schema( $collate );
|
@@ -1190,7 +1193,8 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
1190 |
|
1191 |
if ( $list_id ) {
|
1192 |
|
1193 |
-
$admin_email =
|
|
|
1194 |
|
1195 |
$user = get_user_by( 'email', $admin_email );
|
1196 |
|
@@ -1261,7 +1265,7 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
1261 |
$from_email = ES_Common::get_ig_option( 'from_email' );
|
1262 |
|
1263 |
// Create Default Template
|
1264 |
-
$sample
|
1265 |
$sample .= ' You can also Import or Export subscribers from any list to Email Subscribers.</p>';
|
1266 |
$sample .= ' <strong style="color: #990000">Plugin Features</strong><ol>';
|
1267 |
$sample .= ' <li>Send notification emails to subscribers when new blog posts are published.</li>';
|
@@ -1301,8 +1305,10 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
1301 |
$data['slug'] = sanitize_title( $title );
|
1302 |
$data['name'] = $title;
|
1303 |
$data['type'] = 'newsletter';
|
1304 |
-
$data['from_email'] = $
|
1305 |
-
$data['
|
|
|
|
|
1306 |
$data['list_ids'] = $list_id;
|
1307 |
$data['base_template_id'] = $post_id;
|
1308 |
$data['status'] = 1;
|
@@ -1377,14 +1383,14 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
1377 |
$from_name = ES_Common::get_ig_option( 'from_name' );
|
1378 |
$from_email = ES_Common::get_ig_option( 'from_email' );
|
1379 |
|
1380 |
-
$content
|
1381 |
$content .= "We have published a new blog article on our website : {{POSTTITLE}}\r\n";
|
1382 |
$content .= "{{POSTIMAGE}}\r\n\r\n";
|
1383 |
-
$content .=
|
1384 |
$content .= "{{POSTLINK}}\r\n\r\n";
|
1385 |
$content .= "Thanks & Regards,\r\n";
|
1386 |
$content .= "Admin\r\n\r\n";
|
1387 |
-
$content .=
|
1388 |
|
1389 |
$title = 'New Post Published - {{POSTTITLE}}';
|
1390 |
// Create Post Notification object
|
@@ -1424,8 +1430,10 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
1424 |
$data['slug'] = sanitize_title( $title );
|
1425 |
$data['name'] = $title;
|
1426 |
$data['type'] = 'post_notification';
|
1427 |
-
$data['from_email'] = $
|
1428 |
-
$data['
|
|
|
|
|
1429 |
$data['categories'] = $categories_str;
|
1430 |
$data['list_ids'] = $list_id;
|
1431 |
$data['base_template_id'] = $post_id;
|
@@ -1606,10 +1614,9 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
1606 |
|
1607 |
$templates = array();
|
1608 |
$templates = apply_filters( 'ig_es_email_templates', $templates );
|
|
|
1609 |
|
1610 |
-
$
|
1611 |
-
|
1612 |
-
$imported_templ = $wpdb->get_col( $sSql );
|
1613 |
|
1614 |
if ( is_array( $templates ) && count( $templates ) > 0 ) {
|
1615 |
|
@@ -1672,7 +1679,7 @@ if ( ! class_exists( 'ES_Install' ) ) {
|
|
1672 |
'post_status' => 'inherit'
|
1673 |
);
|
1674 |
$attach_id = wp_insert_attachment( $attachment, $file, $post_id );
|
1675 |
-
require_once
|
1676 |
$attach_data = wp_generate_attachment_metadata( $attach_id, $file );
|
1677 |
$res1 = wp_update_attachment_metadata( $attach_id, $attach_data );
|
1678 |
$res2 = set_post_thumbnail( $post_id, $attach_id );
|
267 |
public static function install_actions() {
|
268 |
if ( ! empty( $_GET['do_update_ig_es'] ) ) {
|
269 |
check_admin_referer( 'ig_es_db_update', 'ig_es_db_update_nonce' );
|
270 |
+
$from_db_version = ! empty( $_GET['from_db_version'] ) ? sanitize_text_field( $_GET['from_db_version'] ) : '';
|
271 |
|
272 |
self::delete_update_transient();
|
273 |
|
274 |
if ( ! empty( $from_db_version ) ) {
|
275 |
+
self::$logger->info( sprintf( 'Forcefully update database from: %s', $from_db_version ), self::$logger_context );
|
276 |
|
277 |
self::update_db_version( $from_db_version );
|
278 |
}
|
373 |
$running_migration_queue_like = '%' . $wpdb->esc_like( '_running_migration_for_' ) . '%';
|
374 |
$db_migration_queue_like = '%' . $wpdb->esc_like( 'ig_es_updater_batch_' ) . '%';
|
375 |
|
376 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}options WHERE option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s", $transient_like, $updating_like, $last_sent_queue_like, $running_migration_queue_like, $db_migration_queue_like ) );
|
|
|
|
|
377 |
|
378 |
}
|
379 |
|
424 |
|
425 |
$latest_db_version_to_update = self::get_latest_db_version_to_update();
|
426 |
|
427 |
+
self::$logger->info( sprintf( 'Current DB Version: %s', $current_db_version ), self::$logger_context );
|
428 |
|
429 |
return ! is_null( $current_db_version ) && version_compare( $current_db_version, $latest_db_version_to_update, '<' );
|
430 |
}
|
486 |
// Get all tasks processed
|
487 |
$processed_tasks = get_option( 'ig_es_update_processed_tasks', array() );
|
488 |
|
489 |
+
self::$logger->info( sprintf( 'Current IG ES DB Version: %s', $current_db_version ), self::$logger_context );
|
490 |
|
491 |
// Get al tasks to process
|
492 |
$tasks = self::get_db_update_callbacks();
|
510 |
|
511 |
if ( count( $tasks_to_process ) > 0 ) {
|
512 |
|
513 |
+
self::$logger->info( 'Yes, we have tasks to process', self::$logger_context );
|
514 |
|
515 |
update_option( 'ig_es_update_tasks_to_process', $tasks_to_process );
|
516 |
|
517 |
self::dispatch();
|
518 |
|
519 |
} else {
|
520 |
+
self::$logger->info( 'Sorry, we do not have any tasks to process', self::$logger_context );
|
521 |
delete_transient( 'ig_es_updating' );
|
522 |
}
|
523 |
|
538 |
|
539 |
if ( count( $batch ) > 0 ) {
|
540 |
|
|
|
|
|
541 |
// We may require lots of memory
|
542 |
+
// Add filter to increase memory limit
|
543 |
+
add_filter( 'ig_es_memory_limit', 'ig_es_increase_memory_limit' );
|
544 |
+
|
545 |
+
wp_raise_memory_limit( 'ig_es' );
|
546 |
+
|
547 |
+
// Remove the added filter function so that it won't be called again if wp_raise_memory_limit called later on.
|
548 |
+
remove_filter( 'ig_es_memory_limit', 'ig_es_increase_memory_limit' );
|
549 |
|
550 |
// It may take long time to process database update.
|
551 |
// So, increase execution time
|
552 |
@set_time_limit( 360 );
|
|
|
553 |
|
554 |
foreach ( $batch as $key => $value ) {
|
555 |
|
561 |
// Check whether the tasks is already processed? If not, process it.
|
562 |
if ( ! in_array( $value, $ig_es_update_processed_tasks ) ) {
|
563 |
$is_value_exists = false;
|
564 |
+
$logger->info( sprintf( '[Processing] %s', $value ), self::$logger_context );
|
565 |
$task = (bool) self::task( $value );
|
566 |
+
$logger->info( sprintf( '[Processed] %s', $value ), self::$logger_context );
|
567 |
} else {
|
568 |
$logger->info( sprintf( "Task '%s' is already processed. Remove it from list", $value ), self::$logger_context );
|
569 |
unset( $batch[ $key ] );
|
582 |
}
|
583 |
|
584 |
update_option( 'ig_es_update_tasks_to_process', $batch );
|
|
|
|
|
585 |
}
|
586 |
|
587 |
//Delete update transient
|
672 |
$admin_email = get_option( 'admin_email', '' );
|
673 |
$blog_name = get_option( 'blogname', '' );
|
674 |
|
675 |
+
if ( '' == $admin_email ) {
|
676 |
+
$admin_email = 'support@icegram.com';
|
677 |
}
|
678 |
|
679 |
$sender_details['name'] = $blog_name;
|
717 |
$sender_details = self::get_sender_details();
|
718 |
|
719 |
$home_url = home_url( '/' );
|
720 |
+
$optinlink = $home_url . '?es=optin&db={{DBID}}&email={{EMAIL}}&guid={{GUID}}';
|
721 |
+
$unsublink = $home_url . '?es=unsubscribe&db={{DBID}}&email={{EMAIL}}&guid={{GUID}}';
|
722 |
|
723 |
$guid = ES_Common::generate_guid( 6 );
|
724 |
+
$cronurl = $home_url . '?es=cron&guid=' . $guid;
|
725 |
|
726 |
+
$report = '';
|
727 |
$report .= "Hi Admin,\n\n";
|
728 |
$report .= "Email has been sent successfully to {{COUNT}} email(s). Please find the details below:\n\n";
|
729 |
$report .= "Unique ID: {{UNIQUE}}\n";
|
730 |
$report .= "Start Time: {{STARTTIME}}\n";
|
731 |
$report .= "End Time: {{ENDTIME}}\n";
|
732 |
$report .= "For more information, login to your dashboard and go to Reports menu in Email Subscribers.\n\n";
|
733 |
+
$report .= 'Thank You.';
|
734 |
|
735 |
|
736 |
+
$new_contact_email_subject = 'One more contact joins our tribe!';
|
737 |
$new_contact_email_content = "Hi,\r\n\r\nYour friendly Email Subscribers notification bot here!\r\n\r\n{{NAME}} ({{EMAIL}}) joined our tribe just now.\r\n\r\nWhich list/s? {{LIST}}\r\n\r\nIf you know this person, or if they are an influencer, you may want to reach out to them personally!\r\n\r\nLater...";
|
738 |
|
739 |
+
$confirmation_email_subject = 'Thanks!';
|
740 |
$confirmation_email_content = "Hi {{NAME}},\r\n\r\nJust one more step before we share the awesomeness from {{SITENAME}}!\r\n\r\nPlease confirm your subscription by clicking on <a href='{{SUBSCRIBE-LINK}}'>this link</a>\r\n\r\nThanks!";
|
741 |
|
742 |
+
$welcome_email_subject = 'Welcome to {{SITENAME}}';
|
743 |
$welcome_email_content = "Hi {{NAME}},\r\n\r\nJust wanted to send you a quick note...\r\n\r\nThank you for joining the awesome {{SITENAME}} tribe.\r\n\r\nOnly valuable emails from me, promise!\r\n\r\nThanks!";
|
744 |
|
745 |
$cron_admin_email = "Hi Admin,\r\n\r\nCron URL has been triggered successfully on {{DATE}} for the email '{{SUBJECT}}'. And it sent email to {{COUNT}} recipient(s).\r\n\r\nBest,\r\n" . $blogname;
|
746 |
$unsubscribe_link_content = "I'd be sad to see you go. But if you want to, you can unsubscribe from <a href='{{UNSUBSCRIBE-LINK}}'>here</a>";
|
747 |
|
748 |
+
$unsubscribe_message = '<p>You will no longer hear from us. ☹️ Sorry to see you go!</p>';
|
749 |
$subscription_error_message = "Hmm.. Something's amiss..\r\n\r\nCould not complete your request. That email address is probably already subscribed. Or worse blocked!!\r\n\r\nPlease try again after some time - or contact us if the problem persists.\r\n\r\n";
|
750 |
|
751 |
$unsubscribe_error_message = "Urrgh.. Something's wrong..\r\n\r\nAre you sure that email address is on our file? There was some problem in completing your request.\r\n\r\nPlease try again after some time - or contact us if the problem persists.\r\n\r\n";
|
765 |
'ig_es_cron_admin_email' => array( 'default' => $cron_admin_email, 'old_option' => 'ig_es_cron_adminmail' ),
|
766 |
'ig_es_cronurl' => array( 'default' => $cronurl, 'old_option' => 'ig_es_cronurl' ),
|
767 |
'ig_es_hourly_email_send_limit' => array( 'default' => 300, 'old_option' => 'ig_es_cron_mailcount' ),
|
768 |
+
'ig_es_sent_report_subject' => array( 'default' => 'Your email has been sent', 'old_option' => 'ig_es_sentreport_subject' ),
|
769 |
'ig_es_sent_report_content' => array( 'default' => $report, 'old_option' => 'ig_es_sentreport' ),
|
770 |
'ig_es_unsubscribe_link' => array( 'default' => $unsublink, 'old_option' => 'ig_es_unsublink' ),
|
771 |
'ig_es_optin_link' => array( 'default' => $optinlink, 'old_option' => 'ig_es_optinlink' ),
|
774 |
'ig_es_notify_admin' => array( 'default' => 'yes', 'old_option' => 'ig_es_notifyadmin', 'action' => 'convert_space_to_underscore' ),
|
775 |
'ig_es_optin_type' => array( 'default' => 'double_opt_in', 'old_option' => 'ig_es_optintype', 'action' => 'convert_space_to_underscore' ),
|
776 |
'ig_es_subscription_error_messsage' => array( 'default' => $subscription_error_message, 'old_option' => 'ig_es_suberror' ),
|
777 |
+
'ig_es_subscription_success_message' => array( 'default' => 'You have been successfully subscribed.', 'old_option' => 'ig_es_successmsg' ),
|
778 |
'ig_es_unsubscribe_error_message' => array( 'default' => $unsubscribe_error_message, 'old_option' => 'ig_es_unsuberror' ),
|
779 |
'ig_es_unsubscribe_success_message' => array( 'default' => $unsubscribe_message, 'old_option' => 'ig_es_unsubtext' ),
|
780 |
'ig_es_post_image_size' => array( 'default' => 'thumbnail', 'old_option' => 'ig_es_post_image_size' ),
|
796 |
'ig_es_db_update_history' => array( 'default' => $ig_es_db_update_history ),
|
797 |
'ig_es_email_sent_data' => array( 'default' => array() ),
|
798 |
'ig_es_mailer_settings' => array( 'default' => array( 'mailer' => 'wpmail' ), 'old_option' => '' ),
|
799 |
+
'ig_es_user_roles' => array( 'default' => self::get_default_permissions(), 'old_option' => '' ),
|
800 |
'ig_es_cron_interval' => array( 'default' => IG_ES_CRON_INTERVAL, 'old_option' => '' ),
|
801 |
'ig_es_max_email_send_at_once' => array( 'default' => IG_ES_MAX_EMAIL_SEND_AT_ONCE, 'old_option' => '' ),
|
802 |
);
|
805 |
}
|
806 |
|
807 |
/**
|
808 |
+
* Create tables
|
809 |
+
*
|
810 |
+
* @param null $version
|
811 |
+
*
|
812 |
+
* @since 4.0.0
|
813 |
+
*
|
814 |
+
* @modify 4.4.9
|
815 |
+
*/
|
816 |
public static function create_tables( $version = null ) {
|
817 |
|
818 |
global $wpdb;
|
984 |
}
|
985 |
|
986 |
/**
|
987 |
+
* Create Contact Meta table
|
988 |
+
*
|
989 |
+
* @param string $collate
|
990 |
+
*
|
991 |
+
* @return string
|
992 |
+
*
|
993 |
+
* @since 4.2.0
|
994 |
+
*/
|
995 |
public static function get_ig_es_420_schema( $collate = '' ) {
|
996 |
global $wpdb;
|
997 |
|
1169 |
*/
|
1170 |
private static function get_schema( $collate = '' ) {
|
1171 |
|
1172 |
+
$tables = self::get_ig_es_400_schema( $collate );
|
1173 |
$tables .= self::get_ig_es_420_schema( $collate );
|
1174 |
$tables .= self::get_ig_es_421_schema( $collate );
|
1175 |
$tables .= self::get_ig_es_424_schema( $collate );
|
1193 |
|
1194 |
if ( $list_id ) {
|
1195 |
|
1196 |
+
$admin_email = get_option( 'admin_email' );
|
1197 |
+
$admin_name = get_option( 'admin_email' );
|
1198 |
|
1199 |
$user = get_user_by( 'email', $admin_email );
|
1200 |
|
1265 |
$from_email = ES_Common::get_ig_option( 'from_email' );
|
1266 |
|
1267 |
// Create Default Template
|
1268 |
+
$sample = '<strong style="color: #990000">What can you achieve using Email Subscribers?</strong><p>Add subscription forms on website, send HTML newsletters & automatically notify subscribers about new blog posts once it is published.';
|
1269 |
$sample .= ' You can also Import or Export subscribers from any list to Email Subscribers.</p>';
|
1270 |
$sample .= ' <strong style="color: #990000">Plugin Features</strong><ol>';
|
1271 |
$sample .= ' <li>Send notification emails to subscribers when new blog posts are published.</li>';
|
1305 |
$data['slug'] = sanitize_title( $title );
|
1306 |
$data['name'] = $title;
|
1307 |
$data['type'] = 'newsletter';
|
1308 |
+
$data['from_email'] = $from_email;
|
1309 |
+
$data['reply_to_email'] = $from_email;
|
1310 |
+
$data['from_name'] = $from_name;
|
1311 |
+
$data['reply_to_name'] = $from_name;
|
1312 |
$data['list_ids'] = $list_id;
|
1313 |
$data['base_template_id'] = $post_id;
|
1314 |
$data['status'] = 1;
|
1383 |
$from_name = ES_Common::get_ig_option( 'from_name' );
|
1384 |
$from_email = ES_Common::get_ig_option( 'from_email' );
|
1385 |
|
1386 |
+
$content = "Hello {{NAME}},\r\n\r\n";
|
1387 |
$content .= "We have published a new blog article on our website : {{POSTTITLE}}\r\n";
|
1388 |
$content .= "{{POSTIMAGE}}\r\n\r\n";
|
1389 |
+
$content .= 'You can view it from this link : ';
|
1390 |
$content .= "{{POSTLINK}}\r\n\r\n";
|
1391 |
$content .= "Thanks & Regards,\r\n";
|
1392 |
$content .= "Admin\r\n\r\n";
|
1393 |
+
$content .= 'You received this email because in the past you have provided us your email address : {{EMAIL}} to receive notifications when new updates are posted.';
|
1394 |
|
1395 |
$title = 'New Post Published - {{POSTTITLE}}';
|
1396 |
// Create Post Notification object
|
1430 |
$data['slug'] = sanitize_title( $title );
|
1431 |
$data['name'] = $title;
|
1432 |
$data['type'] = 'post_notification';
|
1433 |
+
$data['from_email'] = $from_name;
|
1434 |
+
$data['reply_to_email'] = $from_name;
|
1435 |
+
$data['from_name'] = $from_email;
|
1436 |
+
$data['reply_to_name'] = $from_email;
|
1437 |
$data['categories'] = $categories_str;
|
1438 |
$data['list_ids'] = $list_id;
|
1439 |
$data['base_template_id'] = $post_id;
|
1614 |
|
1615 |
$templates = array();
|
1616 |
$templates = apply_filters( 'ig_es_email_templates', $templates );
|
1617 |
+
$post_type = 'es_template';
|
1618 |
|
1619 |
+
$imported_templ = $wpdb->get_col( $wpdb->prepare( "SELECT post_name FROM {$wpdb->prefix}posts where post_type = %s", $post_type ) );
|
|
|
|
|
1620 |
|
1621 |
if ( is_array( $templates ) && count( $templates ) > 0 ) {
|
1622 |
|
1679 |
'post_status' => 'inherit'
|
1680 |
);
|
1681 |
$attach_id = wp_insert_attachment( $attachment, $file, $post_id );
|
1682 |
+
require_once ABSPATH . 'wp-admin/includes/image.php' ;
|
1683 |
$attach_data = wp_generate_attachment_metadata( $attach_id, $file );
|
1684 |
$res1 = wp_update_attachment_metadata( $attach_id, $attach_data );
|
1685 |
$res2 = set_post_thumbnail( $post_id, $attach_id );
|
lite/includes/class-ig-logger.php
CHANGED
@@ -22,8 +22,7 @@ if ( ! class_exists( 'IG_Logger' ) ) {
|
|
22 |
|
23 |
if ( is_object( $handler ) && is_array( $implements ) && in_array( 'IG_Log_Handler_Interface', $implements, true ) ) {
|
24 |
$register_handlers[] = $handler;
|
25 |
-
}
|
26 |
-
}
|
27 |
}
|
28 |
}
|
29 |
|
@@ -91,7 +90,7 @@ if ( ! class_exists( 'IG_Logger' ) ) {
|
|
91 |
public function log( $level, $message, $context = array() ) {
|
92 |
|
93 |
if ( $this->should_handle( $level ) ) {
|
94 |
-
$timestamp =
|
95 |
$message = apply_filters( 'ig_logger_log_message', $message, $level, $context );
|
96 |
|
97 |
foreach ( $this->handlers as $handler ) {
|
@@ -206,7 +205,7 @@ if ( ! class_exists( 'IG_Logger' ) ) {
|
|
206 |
}
|
207 |
|
208 |
|
209 |
-
function trace( $message, $context = array() ) {
|
210 |
|
211 |
$e = new \Exception();
|
212 |
|
22 |
|
23 |
if ( is_object( $handler ) && is_array( $implements ) && in_array( 'IG_Log_Handler_Interface', $implements, true ) ) {
|
24 |
$register_handlers[] = $handler;
|
25 |
+
}
|
|
|
26 |
}
|
27 |
}
|
28 |
|
90 |
public function log( $level, $message, $context = array() ) {
|
91 |
|
92 |
if ( $this->should_handle( $level ) ) {
|
93 |
+
$timestamp = time();
|
94 |
$message = apply_filters( 'ig_logger_log_message', $message, $level, $context );
|
95 |
|
96 |
foreach ( $this->handlers as $handler ) {
|
205 |
}
|
206 |
|
207 |
|
208 |
+
public function trace( $message, $context = array() ) {
|
209 |
|
210 |
$e = new \Exception();
|
211 |
|
lite/includes/classes/class-es-actions.php
CHANGED
@@ -27,7 +27,6 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
27 |
*
|
28 |
* @since 4.2.1
|
29 |
* @var $db
|
30 |
-
*
|
31 |
*/
|
32 |
protected $db;
|
33 |
|
@@ -45,19 +44,16 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
45 |
|
46 |
/**
|
47 |
* Init Actions
|
|
|
|
|
|
|
48 |
*/
|
49 |
public function init() {
|
50 |
-
/**
|
51 |
-
* @since 4.2.0
|
52 |
-
*/
|
53 |
add_action( 'ig_es_contact_subscribe', array( &$this, 'subscribe' ), 10, 2 );
|
54 |
add_action( 'ig_es_message_sent', array( &$this, 'sent' ), 10, 3 );
|
55 |
add_action( 'ig_es_message_open', array( &$this, 'open' ), 10, 3 );
|
56 |
add_action( 'ig_es_message_click', array( &$this, 'click' ), 10, 5 );
|
57 |
add_action( 'ig_es_contact_unsubscribe', array( &$this, 'unsubscribe' ), 10, 4 );
|
58 |
-
//add_action( 'ig_es_message_bounce', array( &$this, 'bounce' ), 10, 3 );
|
59 |
-
//add_action( 'ig_es_subscriber_error', array( &$this, 'error' ), 10, 3 );
|
60 |
-
//add_action( 'ig_es_contact_list_unsubscribe', array( &$this, 'list_unsubscribe' ), 10, 4 );
|
61 |
}
|
62 |
|
63 |
/**
|
@@ -67,7 +63,7 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
67 |
*/
|
68 |
public function get_fields( $fields = null, $where = null ) {
|
69 |
|
70 |
-
global $wpdb;
|
71 |
|
72 |
$fields = esc_sql( is_null( $fields ) ? '*' : ( is_array( $fields ) ? implode( ', ', $fields ) : $fields ) );
|
73 |
|
@@ -78,7 +74,7 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
78 |
}
|
79 |
}
|
80 |
|
81 |
-
return $
|
82 |
|
83 |
}
|
84 |
|
@@ -94,17 +90,20 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
94 |
*/
|
95 |
private function add( $args, $explicit = true ) {
|
96 |
|
97 |
-
$args = wp_parse_args(
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
108 |
|
109 |
return $this->db->add( $args, $explicit );
|
110 |
}
|
@@ -140,18 +139,20 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
140 |
* Track Subscribe Action
|
141 |
*
|
142 |
* @param $contact_id
|
143 |
-
* @param array
|
144 |
*
|
145 |
* @since 4.2.0
|
146 |
*/
|
147 |
public function subscribe( $contact_id, $list_ids = array() ) {
|
148 |
if ( is_array( $list_ids ) && count( $list_ids ) > 0 ) {
|
149 |
foreach ( $list_ids as $list_id ) {
|
150 |
-
$this->add_action(
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
|
|
|
|
155 |
}
|
156 |
}
|
157 |
|
@@ -169,12 +170,14 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
169 |
* @since 4.2.0
|
170 |
*/
|
171 |
public function sent( $contact_id, $campaign_id = 0, $message_id = 0 ) {
|
172 |
-
return $this->add_action(
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
|
|
|
|
178 |
}
|
179 |
|
180 |
/**
|
@@ -203,7 +206,7 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
203 |
);
|
204 |
|
205 |
$device_info = $this->get_user_device_info();
|
206 |
-
$action_data = array_merge( $action_data, $device_info);
|
207 |
|
208 |
return $this->add_action( $action_data, $explicit );
|
209 |
}
|
@@ -247,7 +250,7 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
247 |
* @param $contact_id
|
248 |
* @param $message_id
|
249 |
* @param $campaign_id
|
250 |
-
* @param array
|
251 |
*
|
252 |
* @since 4.2.0
|
253 |
*/
|
@@ -255,13 +258,15 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
255 |
if ( is_array( $list_ids ) && count( $list_ids ) > 0 ) {
|
256 |
foreach ( $list_ids as $list_id ) {
|
257 |
|
258 |
-
$this->add_action(
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
|
|
|
|
265 |
}
|
266 |
}
|
267 |
}
|
@@ -272,16 +277,18 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
272 |
* @param $contact_id
|
273 |
* @param $message_id
|
274 |
* @param $campaign_id
|
275 |
-
* @param bool
|
276 |
*
|
277 |
* @since 4.2.0
|
278 |
*/
|
279 |
public function bounce( $contact_id, $campaign_id, $hard = false ) {
|
280 |
-
$this->add_action(
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
|
|
|
|
285 |
}
|
286 |
|
287 |
/**
|
@@ -299,14 +306,13 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
299 |
|
300 |
global $wpdb;
|
301 |
|
302 |
-
$
|
303 |
-
|
304 |
-
$sql = "SELECT count(*) FROM $ig_actions_table WHERE contact_id = %d AND message_id = %d AND campaign_id = %d AND type = %d";
|
305 |
-
|
306 |
-
return $wpdb->get_var( $wpdb->prepare( $sql, $contact_id, $message_id, $campaign_id, IG_MESSAGE_SENT ) );
|
307 |
}
|
308 |
|
309 |
/**
|
|
|
|
|
310 |
* @param int $conact_id
|
311 |
* @param int $campaign_id
|
312 |
* @param int $message_id
|
@@ -323,33 +329,32 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
323 |
}
|
324 |
|
325 |
$current_date = ig_get_current_date_time();
|
|
|
326 |
|
327 |
-
$
|
328 |
-
|
329 |
-
|
330 |
-
return $wpdb->query( $sql );
|
331 |
}
|
332 |
|
333 |
/**
|
334 |
* Method to get current device information
|
335 |
-
*
|
336 |
* @since 4.5.0
|
337 |
-
|
338 |
public function get_user_device_info() {
|
339 |
|
340 |
$browser = new ES_Browser();
|
341 |
$device_info = array();
|
342 |
|
343 |
-
if( $browser->isMobile() ) {
|
344 |
$device_info['device'] = 'mobile';
|
345 |
-
}
|
346 |
$device_info['device'] = 'tablet';
|
347 |
} else {
|
348 |
$device_info['device'] = 'desktop';
|
349 |
}
|
350 |
|
351 |
$device_ip_address = ig_es_get_ip();
|
352 |
-
if( ! empty( $device_ip_address ) && 'UNKNOWN' !== $device_ip_address ) {
|
353 |
$device_location_data = ES_Geolocation::geolocate_ip( $device_ip_address );
|
354 |
$device_country_code = ! empty( $device_location_data['country_code'] ) ? $device_location_data['country_code'] : '';
|
355 |
$device_info['country'] = $device_country_code;
|
@@ -358,11 +363,11 @@ if ( ! class_exists( 'ES_Actions' ) ) {
|
|
358 |
$device_info['country'] = '';
|
359 |
}
|
360 |
|
361 |
-
$device_info['ip']
|
362 |
$device_info['browser'] = $browser->getBrowser();
|
363 |
$device_info['os'] = $browser->getPlatform();
|
364 |
$device_info['email_client'] = $browser->get_email_client();
|
365 |
-
|
366 |
return $device_info;
|
367 |
}
|
368 |
}
|
27 |
*
|
28 |
* @since 4.2.1
|
29 |
* @var $db
|
|
|
30 |
*/
|
31 |
protected $db;
|
32 |
|
44 |
|
45 |
/**
|
46 |
* Init Actions
|
47 |
+
*
|
48 |
+
* @since 4.2.0
|
49 |
+
*
|
50 |
*/
|
51 |
public function init() {
|
|
|
|
|
|
|
52 |
add_action( 'ig_es_contact_subscribe', array( &$this, 'subscribe' ), 10, 2 );
|
53 |
add_action( 'ig_es_message_sent', array( &$this, 'sent' ), 10, 3 );
|
54 |
add_action( 'ig_es_message_open', array( &$this, 'open' ), 10, 3 );
|
55 |
add_action( 'ig_es_message_click', array( &$this, 'click' ), 10, 5 );
|
56 |
add_action( 'ig_es_contact_unsubscribe', array( &$this, 'unsubscribe' ), 10, 4 );
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
/**
|
63 |
*/
|
64 |
public function get_fields( $fields = null, $where = null ) {
|
65 |
|
66 |
+
global $wpdb, $wpbd;
|
67 |
|
68 |
$fields = esc_sql( is_null( $fields ) ? '*' : ( is_array( $fields ) ? implode( ', ', $fields ) : $fields ) );
|
69 |
|
74 |
}
|
75 |
}
|
76 |
|
77 |
+
return $wpbd->get_results( $sql, ARRAY_A );
|
78 |
|
79 |
}
|
80 |
|
90 |
*/
|
91 |
private function add( $args, $explicit = true ) {
|
92 |
|
93 |
+
$args = wp_parse_args(
|
94 |
+
$args,
|
95 |
+
array(
|
96 |
+
'created_at' => ig_es_get_current_gmt_timestamp(),
|
97 |
+
'updated_at' => ig_es_get_current_gmt_timestamp(),
|
98 |
+
'count' => 1,
|
99 |
+
'ip' => '',
|
100 |
+
'country' => '',
|
101 |
+
'browser' => '',
|
102 |
+
'device' => '',
|
103 |
+
'os' => '',
|
104 |
+
'email_client' => '',
|
105 |
+
)
|
106 |
+
);
|
107 |
|
108 |
return $this->db->add( $args, $explicit );
|
109 |
}
|
139 |
* Track Subscribe Action
|
140 |
*
|
141 |
* @param $contact_id
|
142 |
+
* @param array $list_ids
|
143 |
*
|
144 |
* @since 4.2.0
|
145 |
*/
|
146 |
public function subscribe( $contact_id, $list_ids = array() ) {
|
147 |
if ( is_array( $list_ids ) && count( $list_ids ) > 0 ) {
|
148 |
foreach ( $list_ids as $list_id ) {
|
149 |
+
$this->add_action(
|
150 |
+
array(
|
151 |
+
'contact_id' => $contact_id,
|
152 |
+
'list_id' => $list_id,
|
153 |
+
'type' => IG_CONTACT_SUBSCRIBE,
|
154 |
+
)
|
155 |
+
);
|
156 |
}
|
157 |
}
|
158 |
|
170 |
* @since 4.2.0
|
171 |
*/
|
172 |
public function sent( $contact_id, $campaign_id = 0, $message_id = 0 ) {
|
173 |
+
return $this->add_action(
|
174 |
+
array(
|
175 |
+
'contact_id' => $contact_id,
|
176 |
+
'campaign_id' => $campaign_id,
|
177 |
+
'message_id' => $message_id,
|
178 |
+
'type' => IG_MESSAGE_SENT,
|
179 |
+
)
|
180 |
+
);
|
181 |
}
|
182 |
|
183 |
/**
|
206 |
);
|
207 |
|
208 |
$device_info = $this->get_user_device_info();
|
209 |
+
$action_data = array_merge( $action_data, $device_info );
|
210 |
|
211 |
return $this->add_action( $action_data, $explicit );
|
212 |
}
|
250 |
* @param $contact_id
|
251 |
* @param $message_id
|
252 |
* @param $campaign_id
|
253 |
+
* @param array $list_ids
|
254 |
*
|
255 |
* @since 4.2.0
|
256 |
*/
|
258 |
if ( is_array( $list_ids ) && count( $list_ids ) > 0 ) {
|
259 |
foreach ( $list_ids as $list_id ) {
|
260 |
|
261 |
+
$this->add_action(
|
262 |
+
array(
|
263 |
+
'contact_id' => $contact_id,
|
264 |
+
'message_id' => $message_id,
|
265 |
+
'campaign_id' => $campaign_id,
|
266 |
+
'list_id' => $list_id,
|
267 |
+
'type' => IG_CONTACT_UNSUBSCRIBE,
|
268 |
+
)
|
269 |
+
);
|
270 |
}
|
271 |
}
|
272 |
}
|
277 |
* @param $contact_id
|
278 |
* @param $message_id
|
279 |
* @param $campaign_id
|
280 |
+
* @param bool $hard
|
281 |
*
|
282 |
* @since 4.2.0
|
283 |
*/
|
284 |
public function bounce( $contact_id, $campaign_id, $hard = false ) {
|
285 |
+
$this->add_action(
|
286 |
+
array(
|
287 |
+
'contact_id' => $contact_id,
|
288 |
+
'campaign_id' => $campaign_id,
|
289 |
+
'type' => $hard ? IG_MESSAGE_HARD_BOUNCE : IG_MESSAGE_SOFT_BOUNCE,
|
290 |
+
)
|
291 |
+
);
|
292 |
}
|
293 |
|
294 |
/**
|
306 |
|
307 |
global $wpdb;
|
308 |
|
309 |
+
$sql = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM {$wpdb->prefix}ig_actions WHERE contact_id = %d AND message_id = %d AND campaign_id = %d AND type = %d ", $contact_id, $message_id, $campaign_id, IG_MESSAGE_SENT ) );
|
310 |
+
return $sql;
|
|
|
|
|
|
|
311 |
}
|
312 |
|
313 |
/**
|
314 |
+
* Method to update campaign viewed/opened_at status
|
315 |
+
*
|
316 |
* @param int $conact_id
|
317 |
* @param int $campaign_id
|
318 |
* @param int $message_id
|
329 |
}
|
330 |
|
331 |
$current_date = ig_get_current_date_time();
|
332 |
+
$sql = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}ig_sending_queue SET opened_at = %s, opened = %d WHERE contact_id = %d AND campaign_id = %d AND mailing_queue_id = %d", $current_date, 1, $conact_id, $campaign_id, $message_id ) );
|
333 |
|
334 |
+
return $sql;
|
335 |
+
|
|
|
|
|
336 |
}
|
337 |
|
338 |
/**
|
339 |
* Method to get current device information
|
340 |
+
*
|
341 |
* @since 4.5.0
|
342 |
+
*/
|
343 |
public function get_user_device_info() {
|
344 |
|
345 |
$browser = new ES_Browser();
|
346 |
$device_info = array();
|
347 |
|
348 |
+
if ( $browser->isMobile() ) {
|
349 |
$device_info['device'] = 'mobile';
|
350 |
+
} elseif ( $browser->isTablet() ) {
|
351 |
$device_info['device'] = 'tablet';
|
352 |
} else {
|
353 |
$device_info['device'] = 'desktop';
|
354 |
}
|
355 |
|
356 |
$device_ip_address = ig_es_get_ip();
|
357 |
+
if ( ! empty( $device_ip_address ) && 'UNKNOWN' !== $device_ip_address ) {
|
358 |
$device_location_data = ES_Geolocation::geolocate_ip( $device_ip_address );
|
359 |
$device_country_code = ! empty( $device_location_data['country_code'] ) ? $device_location_data['country_code'] : '';
|
360 |
$device_info['country'] = $device_country_code;
|
363 |
$device_info['country'] = '';
|
364 |
}
|
365 |
|
366 |
+
$device_info['ip'] = $device_ip_address;
|
367 |
$device_info['browser'] = $browser->getBrowser();
|
368 |
$device_info['os'] = $browser->getPlatform();
|
369 |
$device_info['email_client'] = $browser->get_email_client();
|
370 |
+
|
371 |
return $device_info;
|
372 |
}
|
373 |
}
|
lite/includes/classes/class-es-admin-settings.php
CHANGED
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
16 |
*/
|
17 |
class ES_Admin_Settings {
|
18 |
|
19 |
-
static $instance;
|
20 |
|
21 |
public $subscribers_obj;
|
22 |
|
@@ -63,7 +63,7 @@ class ES_Admin_Settings {
|
|
63 |
'ig_es_cron_admin_email_subject',
|
64 |
'ig_es_cronurl',
|
65 |
'ig_es_hourly_email_send_limit',
|
66 |
-
'ig_es_disable_wp_cron'
|
67 |
);
|
68 |
|
69 |
$textarea_fields_to_sanitize = array(
|
@@ -77,26 +77,26 @@ class ES_Admin_Settings {
|
|
77 |
'ig_es_admin_new_contact_email_content',
|
78 |
'ig_es_cron_admin_email',
|
79 |
'ig_es_blocked_domains',
|
80 |
-
'ig_es_form_submission_success_message'
|
81 |
);
|
82 |
|
83 |
$email_fields_to_sanitize = array(
|
84 |
-
'ig_es_from_email'
|
85 |
);
|
86 |
-
|
87 |
foreach ( $options as $key => $value ) {
|
88 |
if ( substr( $key, 0, 6 ) === 'ig_es_' ) {
|
89 |
|
90 |
$value = stripslashes_deep( $value );
|
91 |
|
92 |
-
if ( in_array( $key, $text_fields_to_sanitize ) ) {
|
93 |
$value = sanitize_text_field( $value );
|
94 |
-
} elseif ( in_array( $key, $textarea_fields_to_sanitize ) ) {
|
95 |
$value = wp_kses_post( $value );
|
96 |
-
} elseif ( in_array( $key, $email_fields_to_sanitize ) ) {
|
97 |
$value = sanitize_email( $value );
|
98 |
}
|
99 |
-
|
100 |
update_option( $key, wp_unslash( $value ), false );
|
101 |
}
|
102 |
}
|
@@ -107,10 +107,8 @@ class ES_Admin_Settings {
|
|
107 |
$status = 'success';
|
108 |
ES_Common::show_message( $message, $status );
|
109 |
}
|
110 |
-
|
111 |
}
|
112 |
|
113 |
-
|
114 |
?>
|
115 |
|
116 |
<div class="wrap">
|
@@ -119,12 +117,25 @@ class ES_Admin_Settings {
|
|
119 |
</span>
|
120 |
<form action="" method="post" id="email_tabs_form" class="sticky font-sans bg-white rounded-lg shadow-md">
|
121 |
<div class="flex flex-wrap mt-6">
|
122 |
-
<?php
|
|
|
123 |
$es_settings_tabs = array(
|
124 |
-
'general' => array(
|
125 |
-
|
126 |
-
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
);
|
129 |
$es_settings_tabs = apply_filters( 'ig_es_settings_tabs', $es_settings_tabs );
|
130 |
?>
|
@@ -135,19 +146,20 @@ class ES_Admin_Settings {
|
|
135 |
foreach ( $es_settings_tabs as $key => $value ) {
|
136 |
?>
|
137 |
<li id="menu-content" class="h-10 py-1 mx-2 border border-transparent rounded settings-menu-change md:my-2 hover:rounded-lg hover:border-gray-200">
|
138 |
-
<a href="#tabs-<?php echo $key ?>" id="menu-content-change" class="block px-4 pt-1 text-base font-medium text-gray-900 no-underline align-middle hover:text-gray-800"><i class="py-0.5 dashicons dashicons-<?php echo $value['icon'] ?>"></i> <?php echo $value['name'] ?></a></li>
|
139 |
<?php
|
140 |
-
|
141 |
-
|
142 |
</ul>
|
143 |
</div>
|
144 |
</div>
|
145 |
|
146 |
<div class="w-4/5" id="es-menu-tab-content">
|
147 |
-
<?php
|
|
|
148 |
foreach ( $settings as $key => $value ) {
|
149 |
?>
|
150 |
-
<div id="tabs-<?php echo $key ?>" class="setting-content"><?php $this->render_settings_fields( $value ); ?></div>
|
151 |
<?php
|
152 |
}
|
153 |
?>
|
@@ -163,17 +175,17 @@ class ES_Admin_Settings {
|
|
163 |
|
164 |
$general_settings = array(
|
165 |
|
166 |
-
'sender_information'
|
167 |
'id' => 'sender_information',
|
168 |
'name' => __( 'Sender', 'email-subscribers' ),
|
169 |
'sub_fields' => array(
|
170 |
-
'from_name'
|
171 |
'id' => 'ig_es_from_name',
|
172 |
'name' => __( 'Name', 'email-subscribers' ),
|
173 |
'desc' => __( 'Choose a FROM name for all the emails to be sent from this plugin.', 'email-subscribers' ),
|
174 |
'type' => 'text',
|
175 |
'placeholder' => __( 'Name', 'email-subscribers' ),
|
176 |
-
'default' => ''
|
177 |
),
|
178 |
|
179 |
'from_email' => array(
|
@@ -182,42 +194,42 @@ class ES_Admin_Settings {
|
|
182 |
'desc' => __( 'Choose a FROM email address for all the emails to be sent from this plugin', 'email-subscribers' ),
|
183 |
'type' => 'text',
|
184 |
'placeholder' => __( 'Email Address', 'email-subscribers' ),
|
185 |
-
'default' => ''
|
186 |
),
|
187 |
-
)
|
188 |
),
|
189 |
|
190 |
-
'admin_email'
|
191 |
'id' => 'ig_es_admin_emails',
|
192 |
'name' => __( 'Email Addresses', 'email-subscribers' ),
|
193 |
'type' => 'text',
|
194 |
'desc' => __( 'Enter the admin email addresses that should receive notifications (separated by comma).', 'email-subscribers' ),
|
195 |
-
'default' => ''
|
196 |
),
|
197 |
|
198 |
-
'ig_es_optin_type'
|
199 |
'id' => 'ig_es_optin_type',
|
200 |
'name' => __( 'Opt-in Type', 'email-subscribers' ),
|
201 |
'desc' => '',
|
202 |
'type' => 'select',
|
203 |
'options' => ES_Common::get_optin_types(),
|
204 |
-
'default' => ''
|
205 |
),
|
206 |
|
207 |
-
'ig_es_post_image_size'
|
208 |
'id' => 'ig_es_post_image_size',
|
209 |
'name' => __( 'Image Size', 'email-subscribers' ),
|
210 |
'type' => 'select',
|
211 |
'options' => ES_Common::get_image_sizes(),
|
212 |
'desc' => __( 'Select image size for {{POSTIMAGE}} to be shown in the Post Notification Emails.', 'email-subscribers' ),
|
213 |
-
'default' => 'full'
|
214 |
),
|
215 |
|
216 |
-
'ig_es_track_email_opens'
|
217 |
'id' => 'ig_es_track_email_opens',
|
218 |
'name' => __( 'Track Opens', 'email-subscribers' ),
|
219 |
'type' => 'checkbox',
|
220 |
-
'default' => 'yes'
|
221 |
),
|
222 |
|
223 |
'ig_es_form_submission_success_message' => array(
|
@@ -241,9 +253,7 @@ class ES_Admin_Settings {
|
|
241 |
'desc' => __( 'Add text which you want your contact to see in footer to unsubscribe. Use {{UNSUBSCRIBE-LINK}} keyword to add unsubscribe link.', 'email-subscribers' ),
|
242 |
),
|
243 |
|
244 |
-
|
245 |
-
|
246 |
-
'subscription_messages' => array(
|
247 |
'id' => 'subscription_messages',
|
248 |
'name' => __( 'Subscription Success/ Error Messages', 'email-subscribers' ),
|
249 |
'sub_fields' => array(
|
@@ -255,10 +265,10 @@ class ES_Admin_Settings {
|
|
255 |
'default' => __( 'You have been subscribed successfully!', 'email-subscribers' ),
|
256 |
'id' => 'ig_es_subscription_success_message',
|
257 |
'name' => __( 'Success Message', 'email-subscribers' ),
|
258 |
-
'desc' => __( 'Show this message if contact is successfully subscribed from Double Opt-In (Confirmation) Email', 'email-subscribers' )
|
259 |
),
|
260 |
|
261 |
-
'ig_es_subscription_error_messsage'
|
262 |
'type' => 'textarea',
|
263 |
'options' => false,
|
264 |
'placeholder' => '',
|
@@ -266,13 +276,13 @@ class ES_Admin_Settings {
|
|
266 |
'default' => __( 'Oops.. Your request couldn\'t be completed. This email address seems to be already subscribed / blocked.', 'email-subscribers' ),
|
267 |
'id' => 'ig_es_subscription_error_messsage',
|
268 |
'name' => __( 'Error Message', 'email-subscribers' ),
|
269 |
-
'desc' => __( 'Show this message if any error occured after clicking confirmation link from Double Opt-In (Confirmation) Email.', 'email-subscribers' )
|
270 |
),
|
271 |
|
272 |
-
)
|
273 |
),
|
274 |
|
275 |
-
'unsubscription_messages'
|
276 |
'id' => 'unsubscription_messages',
|
277 |
'name' => __( 'Unsubscribe Success/ Error Messages', 'email-subscribers' ),
|
278 |
'sub_fields' => array(
|
@@ -285,11 +295,10 @@ class ES_Admin_Settings {
|
|
285 |
'default' => __( 'Thank You, You have been successfully unsubscribed. You will no longer hear from us.', 'email-subscribers' ),
|
286 |
'id' => 'ig_es_unsubscribe_success_message',
|
287 |
'name' => __( 'Success Message', 'email-subscribers' ),
|
288 |
-
'desc' => __( 'Once contact clicks on unsubscribe link, he/she will be redirected to a page where this message will be shown.', 'email-subscribers' )
|
289 |
),
|
290 |
|
291 |
-
|
292 |
-
'ig_es_unsubscribe_error_message' => array(
|
293 |
'type' => 'textarea',
|
294 |
'options' => false,
|
295 |
'placeholder' => '',
|
@@ -297,327 +306,304 @@ class ES_Admin_Settings {
|
|
297 |
'default' => 'Oops.. There was some technical error. Please try again later or contact us.',
|
298 |
'id' => 'ig_es_unsubscribe_error_message',
|
299 |
'name' => __( 'Error Message', 'email-subscribers' ),
|
300 |
-
'desc' => __( 'Show this message if any error occured after clicking on unsubscribe link.', 'email-subscribers' )
|
301 |
-
)
|
302 |
-
)
|
303 |
),
|
304 |
|
|
|
305 |
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
'
|
312 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
),
|
314 |
|
315 |
-
'
|
316 |
-
'id'
|
317 |
-
'name'
|
318 |
-
'
|
319 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
),
|
321 |
-
*/
|
322 |
-
);
|
323 |
|
324 |
-
|
325 |
|
326 |
-
|
|
|
|
|
|
|
327 |
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
|
|
333 |
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
'desc' => '',
|
351 |
),
|
352 |
-
|
353 |
-
|
354 |
-
'
|
355 |
-
'
|
356 |
-
'
|
357 |
-
'
|
358 |
-
|
359 |
-
|
360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
),
|
362 |
-
)
|
363 |
-
),
|
364 |
|
365 |
-
|
366 |
-
'id' => 'confirmation_notifications',
|
367 |
-
'name' => __( 'Confirmation Email', 'email-subscribers' ),
|
368 |
-
'sub_fields' => array(
|
369 |
|
370 |
-
|
|
|
371 |
'type' => 'text',
|
372 |
-
'options' => false,
|
373 |
'placeholder' => '',
|
374 |
'supplemental' => '',
|
375 |
'default' => '',
|
376 |
-
'
|
377 |
-
'
|
378 |
-
'
|
|
|
|
|
379 |
),
|
380 |
-
|
381 |
-
|
382 |
-
'type' => 'textarea',
|
383 |
-
'options' => false,
|
384 |
'placeholder' => '',
|
385 |
'supplemental' => '',
|
386 |
-
'default' => '',
|
387 |
-
'id' => '
|
388 |
-
'name' => __( '
|
389 |
-
'
|
390 |
-
)
|
391 |
-
)
|
392 |
-
),
|
393 |
-
|
394 |
-
'admin_notifications' => array(
|
395 |
-
|
396 |
-
'id' => 'admin_notifications',
|
397 |
-
'name' => __( 'Admin Notification On New Subscription', 'email-subscribers' ),
|
398 |
-
'info' => __( 'Notify admin(s) for new contact signup.', 'email-subscribers' ),
|
399 |
-
'sub_fields' => array(
|
400 |
-
|
401 |
-
'notify_admin' => array(
|
402 |
-
'id' => 'ig_es_notify_admin',
|
403 |
-
'name' => __( 'Notify?', 'email-subscribers' ),
|
404 |
-
'type' => 'checkbox',
|
405 |
-
//'desc' => __( 'Set this option to "Yes" to notify admin(s) for new contact signup.', 'email-subscribers' ),
|
406 |
-
'default' => 'yes'
|
407 |
-
),
|
408 |
-
|
409 |
-
|
410 |
-
'new_contact_email_subject' => array(
|
411 |
-
'id' => 'ig_es_admin_new_contact_email_subject',
|
412 |
-
'name' => __( 'Subject', 'email-subscribers' ),
|
413 |
-
'type' => 'text',
|
414 |
-
'desc' => __( 'Subject for the admin email whenever a new contact signs up and is confirmed', 'email-subscribers' ),
|
415 |
-
'default' => __( 'New email subscription', 'email-subscribers' )
|
416 |
),
|
417 |
|
418 |
-
'
|
419 |
-
'id' => '
|
420 |
-
'name' => __( '
|
421 |
-
'type' => '
|
422 |
-
'
|
423 |
-
'
|
|
|
424 |
),
|
425 |
-
)
|
426 |
-
),
|
427 |
-
|
428 |
-
'ig_es_cron_report' => array(
|
429 |
-
'id' => 'ig_es_cron_report',
|
430 |
-
'name' => __( 'Admin Notification On Every Campaign Sent', 'email-subscribers' ),
|
431 |
-
'info' => __( 'Notify admin(s) on every campaign sent.', 'email-subscribers' ),
|
432 |
-
'sub_fields' => array(
|
433 |
|
434 |
-
'
|
435 |
-
'
|
436 |
-
'
|
437 |
-
'
|
438 |
-
|
439 |
-
'
|
|
|
|
|
440 |
),
|
441 |
|
442 |
-
'
|
443 |
-
'type' => '
|
444 |
-
'options' => false,
|
445 |
'placeholder' => '',
|
446 |
'supplemental' => '',
|
447 |
-
'default' =>
|
448 |
-
'id' => '
|
449 |
-
'name' => __( '
|
450 |
-
'desc' => '',
|
451 |
),
|
452 |
|
453 |
-
'
|
454 |
-
'type' => '
|
455 |
-
|
|
|
456 |
'placeholder' => '',
|
457 |
'supplemental' => '',
|
458 |
'default' => '',
|
459 |
-
'id' => '
|
460 |
-
'name' => __( '
|
461 |
-
'desc' => __( '
|
462 |
-
)
|
463 |
-
|
464 |
-
)
|
465 |
-
)
|
466 |
-
);
|
467 |
-
|
468 |
-
$signup_confirmation_settings = apply_filters( 'ig_es_registered_signup_confirmation_settings', $signup_confirmation_settings );
|
469 |
-
|
470 |
-
$email_sending_settings = array(
|
471 |
-
'ig_es_cronurl' => array(
|
472 |
-
'type' => 'text',
|
473 |
-
'placeholder' => '',
|
474 |
-
'supplemental' => '',
|
475 |
-
'default' => '',
|
476 |
-
'readonly' => 'readonly',
|
477 |
-
'id' => 'ig_es_cronurl',
|
478 |
-
'name' => __( 'Cron URL', 'email-subscribers' ),
|
479 |
-
'desc' => sprintf( __( "You need to visit this URL to send email notifications. Know <a href='%s' target='_blank'>how to run this in background</a>", 'email-subscribers' ), "https://www.icegram.com/documentation/es-how-to-schedule-cron-emails-in-cpanel/?utm_source=es&utm_medium=in_app&utm_campaign=view_docs_help_page" )
|
480 |
-
),
|
481 |
-
'ig_es_disable_wp_cron' => array(
|
482 |
-
'type' => 'checkbox',
|
483 |
-
'placeholder' => '',
|
484 |
-
'supplemental' => '',
|
485 |
-
'default' => 'no',
|
486 |
-
'id' => 'ig_es_disable_wp_cron',
|
487 |
-
'name' => __( 'Disable WordPress Cron', 'email-subscribers' ),
|
488 |
-
'info' => __( 'Check this if you do not want Email Subscribers to use WP Cron to send emails.', 'email-subscribers' )
|
489 |
-
),
|
490 |
-
|
491 |
-
'ig_es_cron_interval' => array(
|
492 |
-
'id' => 'ig_es_cron_interval',
|
493 |
-
'name' => __( 'Send Emails At Most Every', 'email-subscribers' ),
|
494 |
-
'type' => 'select',
|
495 |
-
'options' => ES()->cron->cron_intervals(),
|
496 |
-
'desc' => __( 'Optional if a real cron service is used', 'email-subscribers' ),
|
497 |
-
'default' => IG_ES_CRON_INTERVAL
|
498 |
-
),
|
499 |
-
|
500 |
-
'ig_es_hourly_email_send_limit' => array(
|
501 |
-
'type' => 'number',
|
502 |
-
'placeholder' => '',
|
503 |
-
'supplemental' => '',
|
504 |
-
'default' => 50,
|
505 |
-
'id' => 'ig_es_hourly_email_send_limit',
|
506 |
-
'name' => __( 'Maximum Emails To Send In An Hour', 'email-subscribers' ),
|
507 |
-
'desc' => __( 'Total emails your host can send in an hour.', 'email-subscribers' )
|
508 |
-
),
|
509 |
-
|
510 |
-
|
511 |
-
'ig_es_max_email_send_at_once' => array(
|
512 |
-
'type' => 'number',
|
513 |
-
'placeholder' => '',
|
514 |
-
'supplemental' => '',
|
515 |
-
'default' => IG_ES_MAX_EMAIL_SEND_AT_ONCE,
|
516 |
-
'id' => 'ig_es_max_email_send_at_once',
|
517 |
-
'name' => __( 'Maximum Emails To Send At once', 'email-subscribers' ),
|
518 |
-
'desc' => __( 'Maximum emails you want to send on every cron request.', 'email-subscribers' )
|
519 |
-
),
|
520 |
-
|
521 |
-
'ig_es_test_send_email' => array(
|
522 |
-
'type' => 'html',
|
523 |
-
'html' => '<input id="es-test-email" class="mt-3 mb-1 border-gray-400 form-input h-9"/><input type="submit" name="submit" id="es-send-test" class="ig-es-primary-button" value="Send Email"><span class="es_spinner_image_admin" id="spinner-image" style="display:none"><img src="' . ES_PLUGIN_URL . 'lite/public/images/spinner.gif' . '" alt="Loading..."/></span>',
|
524 |
-
'placeholder' => '',
|
525 |
-
'supplemental' => '',
|
526 |
-
'default' => '',
|
527 |
-
'id' => 'ig_es_test_send_email',
|
528 |
-
'name' => __( 'Send Test Email', 'email-subscribers' ),
|
529 |
-
'desc' => __( 'Enter email address to send test email.', 'email-subscribers' )
|
530 |
-
),
|
531 |
-
|
532 |
-
|
533 |
-
'ig_es_mailer_settings' => array(
|
534 |
-
'type' => 'html',
|
535 |
-
// 'html' => ES_Admin_Settings::mailers_html(),
|
536 |
-
'sub_fields' => array(
|
537 |
-
'mailer' => array(
|
538 |
-
'id' => 'ig_es_mailer_settings[mailer]',
|
539 |
-
'name' => __( 'Select Mailer', 'email-subscribers' ),
|
540 |
-
'type' => 'html',
|
541 |
-
'html' => ES_Admin_Settings::mailers_html(),
|
542 |
-
'desc' => '',
|
543 |
),
|
544 |
-
|
545 |
-
|
546 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
547 |
'placeholder' => '',
|
548 |
'supplemental' => '',
|
549 |
'default' => '',
|
550 |
-
'id' =>
|
551 |
-
'name' => __( '
|
552 |
'desc' => '',
|
553 |
-
'class' => 'pepipost'
|
554 |
),
|
555 |
-
|
556 |
-
'type' => 'html',
|
557 |
-
'html' => ES_Admin_Settings::pepipost_doc_block(),
|
558 |
-
'id' => 'ig_es_pepipost_docblock',
|
559 |
-
// 'class' => 'ig_es_docblock',
|
560 |
-
'name' => ''
|
561 |
-
)
|
562 |
-
|
563 |
-
),
|
564 |
-
'placeholder' => '',
|
565 |
-
'supplemental' => '',
|
566 |
-
'default' => '',
|
567 |
-
'id' => 'ig_es_mailer_settings',
|
568 |
-
'name' => __( 'Select a mailer to send mail', 'email-subscribers' ),
|
569 |
-
'desc' => ''
|
570 |
-
)
|
571 |
-
);
|
572 |
-
|
573 |
-
$email_sending_settings = apply_filters( 'ig_es_registered_email_sending_settings', $email_sending_settings );
|
574 |
-
|
575 |
-
$security_settings = array(
|
576 |
-
'blocked_domains' => array(
|
577 |
-
'id' => 'ig_es_blocked_domains',
|
578 |
-
'name' => __( 'Blocked Domain(s)', 'email-subscribers' ),
|
579 |
-
'type' => 'textarea',
|
580 |
-
'info' => __( 'Seeing spam signups from particular domains? Enter domains names (one per line) that you want to block here.', 'email-subscribers' ),
|
581 |
-
'default' => '',
|
582 |
-
'rows' => 3
|
583 |
-
),
|
584 |
-
|
585 |
-
);
|
586 |
-
|
587 |
-
|
588 |
-
$security_settings = apply_filters( 'ig_es_registered_security_settings', $security_settings );
|
589 |
-
|
590 |
-
$es_settings = array(
|
591 |
-
'general' => $general_settings,
|
592 |
-
'signup_confirmation' => $signup_confirmation_settings,
|
593 |
-
'email_sending' => $email_sending_settings,
|
594 |
-
'security_settings' => $security_settings
|
595 |
-
);
|
596 |
-
|
597 |
-
return apply_filters( 'ig_es_registered_settings', $es_settings );
|
598 |
-
}
|
599 |
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
620 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
621 |
$value = get_option( $arguments['id'] ); // Get the current value, if there is one
|
622 |
}
|
623 |
}
|
@@ -639,66 +625,69 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
639 |
// Check which type of field we want
|
640 |
switch ( $arguments['type'] ) {
|
641 |
case 'text': // If it is a text field
|
642 |
-
|
643 |
-
|
644 |
case 'password': // If it is a text field
|
645 |
-
|
646 |
-
|
647 |
|
648 |
case 'number': // If it is a number field
|
649 |
-
|
650 |
-
|
651 |
|
652 |
case 'email':
|
653 |
-
|
654 |
-
|
655 |
|
656 |
case 'textarea':
|
657 |
-
|
658 |
-
|
659 |
|
660 |
case 'file':
|
661 |
-
|
662 |
-
|
663 |
|
664 |
-
case 'checkbox'
|
665 |
-
|
666 |
-
$field_html = '<label for="' . $id_key . '" class="inline-flex items-center mt-4 mb-1 cursor-pointer">
|
667 |
<span class="relative">';
|
668 |
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
|
673 |
-
|
674 |
<span class="block w-10 h-6 bg-gray-300 rounded-full shadow-inner es-mail-toggle-line "></span>
|
675 |
<span class="absolute inset-y-0 left-0 block w-4 h-4 mt-1 ml-1 transition-all duration-300 ease-in-out bg-white rounded-full shadow es-mail-toggle-dot focus-within:shadow-outline"></span>
|
676 |
</span>
|
677 |
</label>';
|
678 |
-
|
679 |
|
680 |
case 'select':
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
}
|
687 |
-
|
688 |
-
}
|
689 |
-
break;
|
690 |
|
691 |
-
case 'html'
|
692 |
default:
|
693 |
-
|
694 |
-
|
695 |
}
|
696 |
|
697 |
$field_html .= '<br />';
|
698 |
|
699 |
-
//If there is help text
|
700 |
if ( ! empty( $arguments['desc'] ) ) {
|
701 |
-
$helper
|
702 |
$field_html .= sprintf( '<p class="mb-2 text-xs italic font-normal leading-snug text-gray-500 helper"> %s</p>', $helper ); // Show it
|
703 |
}
|
704 |
|
@@ -713,9 +702,9 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
713 |
return self::$instance;
|
714 |
}
|
715 |
|
716 |
-
function render_settings_fields( $fields ) {
|
717 |
-
$html
|
718 |
-
$html .=
|
719 |
foreach ( $fields as $key => $field ) {
|
720 |
if ( ! empty( $field['name'] ) ) {
|
721 |
$html .= "<tr class='py-4 ml-4 border-b border-gray-100 '><th scope='row' class='block pt-3 pb-8 pr-4 ml-6 text-left pt-7'><span class='pb-2 text-sm font-semibold text-gray-600'>";
|
@@ -725,20 +714,20 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
725 |
$html .= '<a href="' . $field['link'] . '" target="_blank"><span class="inline-flex px-2 text-xs font-semibold leading-5 text-green-800 bg-green-100 rounded-full">' . __( 'Premium', 'email-subscribers' ) . '</span></a>';
|
726 |
}
|
727 |
|
728 |
-
//If there is help text
|
729 |
if ( ! empty( $field['info'] ) ) {
|
730 |
$helper = $field['info'];
|
731 |
-
$html
|
732 |
}
|
733 |
-
$button_html =
|
734 |
|
735 |
-
$html .=
|
736 |
}
|
737 |
|
738 |
$html .= "<td class='w-4/6 py-2 pl-5 bg-white rounded-lg '>";
|
739 |
|
740 |
if ( ! empty( $field['upgrade_desc'] ) ) {
|
741 |
-
$html .="<div class='flex'><div class='flex-none w-2/5'>";
|
742 |
}
|
743 |
|
744 |
if ( ! empty( $field['sub_fields'] ) ) {
|
@@ -752,17 +741,17 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
752 |
}
|
753 |
$sub_field['option_value'] = is_array( $option_value ) ? $option_value : '';
|
754 |
}
|
755 |
-
$class = ( ! empty( $sub_field['class'] ) ) ? $sub_field['class'] :
|
756 |
-
$html
|
757 |
-
$html
|
758 |
-
$html
|
759 |
}
|
760 |
} else {
|
761 |
$html .= $this->field_callback( $field );
|
762 |
}
|
763 |
|
764 |
if ( ! empty( $field['upgrade_desc'] ) ) {
|
765 |
-
$html
|
766 |
<div class='w-3/5'>
|
767 |
<div class='px-3 py-2 mr-2 rounded-md bg-teal-50'>
|
768 |
<div class='flex'>
|
@@ -773,32 +762,34 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
773 |
</div>
|
774 |
<div class='ml-3'>
|
775 |
<h3 class='text-sm font-medium leading-5 text-teal-700'>";
|
776 |
-
$html .= $field['upgrade_title'] .
|
777 |
$html .= "<div class='mt-2 text-sm leading-5 text-teal-500'>
|
778 |
-
<p>". $field['upgrade_desc'] .
|
779 |
</div>
|
780 |
</div>
|
781 |
</div>
|
782 |
</div>
|
783 |
-
</div>
|
784 |
}
|
785 |
|
786 |
-
$html .=
|
787 |
}
|
788 |
|
789 |
-
$button_html = empty( $button_html ) ?
|
790 |
-
|
791 |
-
$nonce_field = wp_nonce_field( 'update-settings', 'update-settings', true, false );
|
792 |
-
$html
|
793 |
-
$html
|
794 |
-
$html
|
795 |
-
$html
|
796 |
-
$html
|
797 |
-
$html
|
798 |
-
$html
|
799 |
-
$html
|
800 |
-
|
801 |
-
|
|
|
|
|
802 |
}
|
803 |
|
804 |
/**
|
@@ -820,10 +811,10 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
820 |
$php_email_type_values = array(
|
821 |
'php_html_mail',
|
822 |
'php_plaintext_mail',
|
823 |
-
'phpmail'
|
824 |
);
|
825 |
|
826 |
-
if ( in_array( $es_email_type, $php_email_type_values ) ) {
|
827 |
$selected_mailer = 'phpmail';
|
828 |
}
|
829 |
}
|
@@ -831,9 +822,19 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
831 |
$pepipost_doc_block = '';
|
832 |
|
833 |
$mailers = array(
|
834 |
-
'wpmail' => array(
|
835 |
-
|
836 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
837 |
);
|
838 |
|
839 |
$mailers = apply_filters( 'ig_es_mailers', $mailers );
|
@@ -869,9 +870,9 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
869 |
?>
|
870 |
<div class="es_sub_headline ig_es_docblock ig_es_pepipost_div_wrapper pepipost">
|
871 |
<ul>
|
872 |
-
<li><a class="" href="https://app.pepipost.com/index.php/signup/icegram?fpr=icegram" target="_blank"><?php
|
873 |
-
<li><?php
|
874 |
-
<li><a href="https://www.icegram.com/email-subscribers-integrates-with-pepipost?utm_source=es_inapp&utm_medium=es_upsale&utm_campaign=upsale" target="_blank"><?php
|
875 |
</ul>
|
876 |
</div>
|
877 |
|
@@ -883,21 +884,21 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
883 |
}
|
884 |
|
885 |
/**
|
886 |
-
* Register ES cron info
|
887 |
-
*
|
888 |
* @return array $email_sending_settings ES send email settings.
|
889 |
-
*
|
890 |
* @since 4.4.9
|
891 |
*/
|
892 |
public function show_cron_info( $email_sending_settings ) {
|
893 |
$es_cron_enabled = ES()->cron->is_wp_cron_enable();
|
894 |
-
if( $es_cron_enabled ) {
|
895 |
-
$es_cron_info
|
896 |
'ig_es_cron_info' => array(
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
),
|
902 |
);
|
903 |
$email_sending_settings = ig_es_array_insert_after( $email_sending_settings, 'ig_es_cronurl', $es_cron_info );
|
@@ -916,13 +917,13 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
916 |
public static function render_cron_info_html() {
|
917 |
$site_crons = get_option( 'cron' );
|
918 |
|
919 |
-
if( empty( $site_crons ) ) {
|
920 |
return;
|
921 |
}
|
922 |
|
923 |
$es_cron_enabled = ES()->cron->is_wp_cron_enable();
|
924 |
|
925 |
-
$es_crons_data
|
926 |
$es_cron_events = array(
|
927 |
'ig_es_cron',
|
928 |
'ig_es_cron_worker',
|
@@ -935,16 +936,16 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
935 |
$time_format = get_option( 'time_format' );
|
936 |
|
937 |
foreach ( $site_crons as $next_scheduled_time => $scheduled_crons ) {
|
938 |
-
if( ! empty( $scheduled_crons ) && is_array( $scheduled_crons ) ) {
|
939 |
-
foreach( $scheduled_crons as $cron_event => $cron_data ) {
|
940 |
-
if( ! in_array( $cron_event, $es_cron_events, true ) ) {
|
941 |
continue;
|
942 |
}
|
943 |
-
foreach( $cron_data as $cron_info ) {
|
944 |
-
if( ! empty( $cron_info['schedule'] ) ) {
|
945 |
-
$cron_schedule
|
946 |
-
$cron_interval
|
947 |
-
$es_crons_data[$cron_event]
|
948 |
'cron_interval' => $cron_interval,
|
949 |
'next_scheduled_time' => $next_scheduled_time,
|
950 |
);
|
@@ -955,7 +956,7 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
955 |
}
|
956 |
|
957 |
$html = '';
|
958 |
-
if( ! empty( $es_crons_data ) ) {
|
959 |
ob_start();
|
960 |
?>
|
961 |
<table class="min-w-full rounded-lg">
|
@@ -968,29 +969,29 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
968 |
</thead>
|
969 |
<tbody class="bg-blue-50">
|
970 |
<?php
|
971 |
-
foreach( $es_cron_events as $cron_event ) {
|
972 |
$cron_interval = '';
|
973 |
$next_scheduled_time = '';
|
974 |
-
if( ! empty( $es_crons_data[ $cron_event ] ) ) {
|
975 |
-
$es_cron_data
|
976 |
$cron_interval = $es_cron_data['cron_interval'];
|
977 |
$next_scheduled_time = $es_cron_data['next_scheduled_time'];
|
978 |
} else {
|
979 |
-
if( 'ig_es_cron_auto_responder' === $cron_event ) {
|
980 |
wp_schedule_event( floor( time() / 300 ) * 300 - 120, 'ig_es_cron_interval', 'ig_es_cron_auto_responder' );
|
981 |
-
}
|
982 |
wp_schedule_event( floor( time() / 300 ) * 300, 'ig_es_cron_interval', 'ig_es_cron_worker' );
|
983 |
-
}
|
984 |
wp_schedule_event( strtotime( 'midnight' ) - 300, 'hourly', 'ig_es_cron' );
|
985 |
}
|
986 |
$next_scheduled_time = wp_next_scheduled( $cron_event );
|
987 |
-
if( 'ig_es_cron' === $cron_event ) {
|
988 |
-
$cron_interval
|
989 |
} else {
|
990 |
-
$cron_interval
|
991 |
}
|
992 |
}
|
993 |
-
if( empty( $cron_interval ) || empty( $next_scheduled_time )
|
994 |
continue;
|
995 |
}
|
996 |
?>
|
@@ -998,19 +999,20 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
998 |
<td class="pl-8 py-4 ">
|
999 |
<div class="flex items-center">
|
1000 |
<div class="flex-shrink-0">
|
1001 |
-
<span class="text-sm leading-5 font-medium text-center text-gray-800"><?php echo $cron_event; ?></span>
|
1002 |
</div>
|
1003 |
</div>
|
1004 |
</td>
|
1005 |
<td class="whitespace-no-wrap text-center">
|
1006 |
-
<?php
|
1007 |
-
echo ig_es_get_human_interval( $cron_interval );
|
1008 |
?>
|
1009 |
</td>
|
1010 |
<td class="whitespace-no-wrap text-center">
|
1011 |
-
|
|
|
1012 |
<span title="<?php echo esc_attr( 'UTC: ' . date_i18n( $date_format . ' ' . $time_format, $next_scheduled_time ) ); ?>">
|
1013 |
-
<?php echo date_i18n( $date_format . ' ' . $time_format, $next_scheduled_time + $time_offset ); ?>
|
1014 |
</span>
|
1015 |
</td>
|
1016 |
</tr>
|
@@ -1026,4 +1028,4 @@ public function field_callback( $arguments, $id_key = '' ) {
|
|
1026 |
return $html;
|
1027 |
}
|
1028 |
|
1029 |
-
}
|
16 |
*/
|
17 |
class ES_Admin_Settings {
|
18 |
|
19 |
+
public static $instance;
|
20 |
|
21 |
public $subscribers_obj;
|
22 |
|
63 |
'ig_es_cron_admin_email_subject',
|
64 |
'ig_es_cronurl',
|
65 |
'ig_es_hourly_email_send_limit',
|
66 |
+
'ig_es_disable_wp_cron',
|
67 |
);
|
68 |
|
69 |
$textarea_fields_to_sanitize = array(
|
77 |
'ig_es_admin_new_contact_email_content',
|
78 |
'ig_es_cron_admin_email',
|
79 |
'ig_es_blocked_domains',
|
80 |
+
'ig_es_form_submission_success_message',
|
81 |
);
|
82 |
|
83 |
$email_fields_to_sanitize = array(
|
84 |
+
'ig_es_from_email',
|
85 |
);
|
86 |
+
|
87 |
foreach ( $options as $key => $value ) {
|
88 |
if ( substr( $key, 0, 6 ) === 'ig_es_' ) {
|
89 |
|
90 |
$value = stripslashes_deep( $value );
|
91 |
|
92 |
+
if ( in_array( $key, $text_fields_to_sanitize, true ) ) {
|
93 |
$value = sanitize_text_field( $value );
|
94 |
+
} elseif ( in_array( $key, $textarea_fields_to_sanitize, true ) ) {
|
95 |
$value = wp_kses_post( $value );
|
96 |
+
} elseif ( in_array( $key, $email_fields_to_sanitize, true ) ) {
|
97 |
$value = sanitize_email( $value );
|
98 |
}
|
99 |
+
|
100 |
update_option( $key, wp_unslash( $value ), false );
|
101 |
}
|
102 |
}
|
107 |
$status = 'success';
|
108 |
ES_Common::show_message( $message, $status );
|
109 |
}
|
|
|
110 |
}
|
111 |
|
|
|
112 |
?>
|
113 |
|
114 |
<div class="wrap">
|
117 |
</span>
|
118 |
<form action="" method="post" id="email_tabs_form" class="sticky font-sans bg-white rounded-lg shadow-md">
|
119 |
<div class="flex flex-wrap mt-6">
|
120 |
+
<?php
|
121 |
+
settings_fields( 'email_subscribers_settings' );
|
122 |
$es_settings_tabs = array(
|
123 |
+
'general' => array(
|
124 |
+
'icon' => 'admin-generic',
|
125 |
+
'name' => __( 'General', 'email-subscribers' ),
|
126 |
+
),
|
127 |
+
'signup_confirmation' => array(
|
128 |
+
'icon' => 'format-chat',
|
129 |
+
'name' => __( 'Notifications', 'email-subscribers' ),
|
130 |
+
),
|
131 |
+
'email_sending' => array(
|
132 |
+
'icon' => 'email-alt',
|
133 |
+
'name' => __( 'Email Sending', 'email-subscribers' ),
|
134 |
+
),
|
135 |
+
'security_settings' => array(
|
136 |
+
'icon' => 'lock',
|
137 |
+
'name' => __( 'Security', 'email-subscribers' ),
|
138 |
+
),
|
139 |
);
|
140 |
$es_settings_tabs = apply_filters( 'ig_es_settings_tabs', $es_settings_tabs );
|
141 |
?>
|
146 |
foreach ( $es_settings_tabs as $key => $value ) {
|
147 |
?>
|
148 |
<li id="menu-content" class="h-10 py-1 mx-2 border border-transparent rounded settings-menu-change md:my-2 hover:rounded-lg hover:border-gray-200">
|
149 |
+
<a href="#tabs-<?php echo esc_attr( $key ); ?>" id="menu-content-change" class="block px-4 pt-1 text-base font-medium text-gray-900 no-underline align-middle hover:text-gray-800"><i class="py-0.5 dashicons dashicons-<?php echo esc_attr( $value['icon'] ); ?>"></i> <?php echo esc_html( $value['name'] ); ?></a></li>
|
150 |
<?php
|
151 |
+
}
|
152 |
+
?>
|
153 |
</ul>
|
154 |
</div>
|
155 |
</div>
|
156 |
|
157 |
<div class="w-4/5" id="es-menu-tab-content">
|
158 |
+
<?php
|
159 |
+
$settings = self::get_registered_settings();
|
160 |
foreach ( $settings as $key => $value ) {
|
161 |
?>
|
162 |
+
<div id="tabs-<?php echo esc_attr( $key ); ?>" class="setting-content"><?php $this->render_settings_fields( $value ); ?></div>
|
163 |
<?php
|
164 |
}
|
165 |
?>
|
175 |
|
176 |
$general_settings = array(
|
177 |
|
178 |
+
'sender_information' => array(
|
179 |
'id' => 'sender_information',
|
180 |
'name' => __( 'Sender', 'email-subscribers' ),
|
181 |
'sub_fields' => array(
|
182 |
+
'from_name' => array(
|
183 |
'id' => 'ig_es_from_name',
|
184 |
'name' => __( 'Name', 'email-subscribers' ),
|
185 |
'desc' => __( 'Choose a FROM name for all the emails to be sent from this plugin.', 'email-subscribers' ),
|
186 |
'type' => 'text',
|
187 |
'placeholder' => __( 'Name', 'email-subscribers' ),
|
188 |
+
'default' => '',
|
189 |
),
|
190 |
|
191 |
'from_email' => array(
|
194 |
'desc' => __( 'Choose a FROM email address for all the emails to be sent from this plugin', 'email-subscribers' ),
|
195 |
'type' => 'text',
|
196 |
'placeholder' => __( 'Email Address', 'email-subscribers' ),
|
197 |
+
'default' => '',
|
198 |
),
|
199 |
+
),
|
200 |
),
|
201 |
|
202 |
+
'admin_email' => array(
|
203 |
'id' => 'ig_es_admin_emails',
|
204 |
'name' => __( 'Email Addresses', 'email-subscribers' ),
|
205 |
'type' => 'text',
|
206 |
'desc' => __( 'Enter the admin email addresses that should receive notifications (separated by comma).', 'email-subscribers' ),
|
207 |
+
'default' => '',
|
208 |
),
|
209 |
|
210 |
+
'ig_es_optin_type' => array(
|
211 |
'id' => 'ig_es_optin_type',
|
212 |
'name' => __( 'Opt-in Type', 'email-subscribers' ),
|
213 |
'desc' => '',
|
214 |
'type' => 'select',
|
215 |
'options' => ES_Common::get_optin_types(),
|
216 |
+
'default' => '',
|
217 |
),
|
218 |
|
219 |
+
'ig_es_post_image_size' => array(
|
220 |
'id' => 'ig_es_post_image_size',
|
221 |
'name' => __( 'Image Size', 'email-subscribers' ),
|
222 |
'type' => 'select',
|
223 |
'options' => ES_Common::get_image_sizes(),
|
224 |
'desc' => __( 'Select image size for {{POSTIMAGE}} to be shown in the Post Notification Emails.', 'email-subscribers' ),
|
225 |
+
'default' => 'full',
|
226 |
),
|
227 |
|
228 |
+
'ig_es_track_email_opens' => array(
|
229 |
'id' => 'ig_es_track_email_opens',
|
230 |
'name' => __( 'Track Opens', 'email-subscribers' ),
|
231 |
'type' => 'checkbox',
|
232 |
+
'default' => 'yes',
|
233 |
),
|
234 |
|
235 |
'ig_es_form_submission_success_message' => array(
|
253 |
'desc' => __( 'Add text which you want your contact to see in footer to unsubscribe. Use {{UNSUBSCRIBE-LINK}} keyword to add unsubscribe link.', 'email-subscribers' ),
|
254 |
),
|
255 |
|
256 |
+
'subscription_messages' => array(
|
|
|
|
|
257 |
'id' => 'subscription_messages',
|
258 |
'name' => __( 'Subscription Success/ Error Messages', 'email-subscribers' ),
|
259 |
'sub_fields' => array(
|
265 |
'default' => __( 'You have been subscribed successfully!', 'email-subscribers' ),
|
266 |
'id' => 'ig_es_subscription_success_message',
|
267 |
'name' => __( 'Success Message', 'email-subscribers' ),
|
268 |
+
'desc' => __( 'Show this message if contact is successfully subscribed from Double Opt-In (Confirmation) Email', 'email-subscribers' ),
|
269 |
),
|
270 |
|
271 |
+
'ig_es_subscription_error_messsage' => array(
|
272 |
'type' => 'textarea',
|
273 |
'options' => false,
|
274 |
'placeholder' => '',
|
276 |
'default' => __( 'Oops.. Your request couldn\'t be completed. This email address seems to be already subscribed / blocked.', 'email-subscribers' ),
|
277 |
'id' => 'ig_es_subscription_error_messsage',
|
278 |
'name' => __( 'Error Message', 'email-subscribers' ),
|
279 |
+
'desc' => __( 'Show this message if any error occured after clicking confirmation link from Double Opt-In (Confirmation) Email.', 'email-subscribers' ),
|
280 |
),
|
281 |
|
282 |
+
),
|
283 |
),
|
284 |
|
285 |
+
'unsubscription_messages' => array(
|
286 |
'id' => 'unsubscription_messages',
|
287 |
'name' => __( 'Unsubscribe Success/ Error Messages', 'email-subscribers' ),
|
288 |
'sub_fields' => array(
|
295 |
'default' => __( 'Thank You, You have been successfully unsubscribed. You will no longer hear from us.', 'email-subscribers' ),
|
296 |
'id' => 'ig_es_unsubscribe_success_message',
|
297 |
'name' => __( 'Success Message', 'email-subscribers' ),
|
298 |
+
'desc' => __( 'Once contact clicks on unsubscribe link, he/she will be redirected to a page where this message will be shown.', 'email-subscribers' ),
|
299 |
),
|
300 |
|
301 |
+
'ig_es_unsubscribe_error_message' => array(
|
|
|
302 |
'type' => 'textarea',
|
303 |
'options' => false,
|
304 |
'placeholder' => '',
|
306 |
'default' => 'Oops.. There was some technical error. Please try again later or contact us.',
|
307 |
'id' => 'ig_es_unsubscribe_error_message',
|
308 |
'name' => __( 'Error Message', 'email-subscribers' ),
|
309 |
+
'desc' => __( 'Show this message if any error occured after clicking on unsubscribe link.', 'email-subscribers' ),
|
310 |
+
),
|
311 |
+
),
|
312 |
),
|
313 |
|
314 |
+
);
|
315 |
|
316 |
+
$general_settings = apply_filters( 'ig_es_registered_general_settings', $general_settings );
|
317 |
+
|
318 |
+
$signup_confirmation_settings = array(
|
319 |
+
|
320 |
+
'welcome_emails' => array(
|
321 |
+
'id' => 'welcome_emails',
|
322 |
+
'name' => __( 'Welcome Email', 'email-subscribers' ),
|
323 |
+
'info' => __( 'Send welcome email to new contact after signup.', 'email-subscribers' ),
|
324 |
+
'sub_fields' => array(
|
325 |
+
|
326 |
+
'ig_es_enable_welcome_email' => array(
|
327 |
+
'id' => 'ig_es_enable_welcome_email',
|
328 |
+
'name' => __( 'Enable?', 'email-subscribers' ),
|
329 |
+
'type' => 'checkbox',
|
330 |
+
'default' => 'yes',
|
331 |
+
),
|
332 |
+
|
333 |
+
'ig_es_welcome_email_subject' => array(
|
334 |
+
'type' => 'text',
|
335 |
+
'options' => false,
|
336 |
+
'placeholder' => '',
|
337 |
+
'supplemental' => '',
|
338 |
+
'default' => '',
|
339 |
+
'id' => 'ig_es_welcome_email_subject',
|
340 |
+
'name' => __( 'Subject', 'email-subscribers' ),
|
341 |
+
'desc' => '',
|
342 |
+
),
|
343 |
+
'ig_es_welcome_email_content' => array(
|
344 |
+
'type' => 'textarea',
|
345 |
+
'options' => false,
|
346 |
+
'placeholder' => '',
|
347 |
+
'supplemental' => '',
|
348 |
+
'default' => '',
|
349 |
+
'id' => 'ig_es_welcome_email_content',
|
350 |
+
'name' => __( 'Content', 'email-subscribers' ),
|
351 |
+
'desc' => __( 'Available keywords. {{FIRSTNAME}}, {{LASTNAME}}, {{NAME}}, {{EMAIL}}, {{LIST}}, {{UNSUBSCRIBE-LINK}}', 'email-subscribers' ),
|
352 |
+
),
|
353 |
+
),
|
354 |
),
|
355 |
|
356 |
+
'confirmation_notifications' => array(
|
357 |
+
'id' => 'confirmation_notifications',
|
358 |
+
'name' => __( 'Confirmation Email', 'email-subscribers' ),
|
359 |
+
'sub_fields' => array(
|
360 |
+
|
361 |
+
'ig_es_confirmation_mail_subject' => array(
|
362 |
+
'type' => 'text',
|
363 |
+
'options' => false,
|
364 |
+
'placeholder' => '',
|
365 |
+
'supplemental' => '',
|
366 |
+
'default' => '',
|
367 |
+
'id' => 'ig_es_confirmation_mail_subject',
|
368 |
+
'name' => __( 'Subject', 'email-subscribers' ),
|
369 |
+
'desc' => '',
|
370 |
+
),
|
371 |
+
|
372 |
+
'ig_es_confirmation_mail_content' => array(
|
373 |
+
'type' => 'textarea',
|
374 |
+
'options' => false,
|
375 |
+
'placeholder' => '',
|
376 |
+
'supplemental' => '',
|
377 |
+
'default' => '',
|
378 |
+
'id' => 'ig_es_confirmation_mail_content',
|
379 |
+
'name' => __( 'Content', 'email-subscribers' ),
|
380 |
+
'desc' => __( 'If Double Optin is set, contact will receive confirmation email with above content. You can use {{FIRSTNAME}}, {{LASTNAME}}, {{NAME}}, {{EMAIL}}, {{SUBSCRIBE-LINK}} keywords', 'email-subscribers' ),
|
381 |
+
),
|
382 |
+
),
|
383 |
),
|
|
|
|
|
384 |
|
385 |
+
'admin_notifications' => array(
|
386 |
|
387 |
+
'id' => 'admin_notifications',
|
388 |
+
'name' => __( 'Admin Notification On New Subscription', 'email-subscribers' ),
|
389 |
+
'info' => __( 'Notify admin(s) for new contact signup.', 'email-subscribers' ),
|
390 |
+
'sub_fields' => array(
|
391 |
|
392 |
+
'notify_admin' => array(
|
393 |
+
'id' => 'ig_es_notify_admin',
|
394 |
+
'name' => __( 'Notify?', 'email-subscribers' ),
|
395 |
+
'type' => 'checkbox',
|
396 |
+
'default' => 'yes',
|
397 |
+
),
|
398 |
|
399 |
+
'new_contact_email_subject' => array(
|
400 |
+
'id' => 'ig_es_admin_new_contact_email_subject',
|
401 |
+
'name' => __( 'Subject', 'email-subscribers' ),
|
402 |
+
'type' => 'text',
|
403 |
+
'desc' => __( 'Subject for the admin email whenever a new contact signs up and is confirmed', 'email-subscribers' ),
|
404 |
+
'default' => __( 'New email subscription', 'email-subscribers' ),
|
405 |
+
),
|
406 |
|
407 |
+
'new_contact_email_content' => array(
|
408 |
+
'id' => 'ig_es_admin_new_contact_email_content',
|
409 |
+
'name' => __( 'Content', 'email-subscribers' ),
|
410 |
+
'type' => 'textarea',
|
411 |
+
'desc' => __( 'Content for the admin email whenever a new subscriber signs up and is confirmed. Available Keywords: {{NAME}}, {{EMAIL}}, {{LIST}}', 'email-subscribers' ),
|
412 |
+
'default' => '',
|
413 |
+
),
|
414 |
+
),
|
|
|
415 |
),
|
416 |
+
|
417 |
+
'ig_es_cron_report' => array(
|
418 |
+
'id' => 'ig_es_cron_report',
|
419 |
+
'name' => __( 'Admin Notification On Every Campaign Sent', 'email-subscribers' ),
|
420 |
+
'info' => __( 'Notify admin(s) on every campaign sent.', 'email-subscribers' ),
|
421 |
+
'sub_fields' => array(
|
422 |
+
|
423 |
+
'ig_es_enable_cron_admin_email' => array(
|
424 |
+
'id' => 'ig_es_enable_cron_admin_email',
|
425 |
+
'name' => __( 'Notify?', 'email-subscribers' ),
|
426 |
+
'type' => 'checkbox',
|
427 |
+
|
428 |
+
'default' => 'yes',
|
429 |
+
),
|
430 |
+
|
431 |
+
'ig_es_cron_admin_email_subject' => array(
|
432 |
+
'type' => 'text',
|
433 |
+
'options' => false,
|
434 |
+
'placeholder' => '',
|
435 |
+
'supplemental' => '',
|
436 |
+
'default' => __( 'Campaign Sent!', 'email-subscribers' ),
|
437 |
+
'id' => 'ig_es_cron_admin_email_subject',
|
438 |
+
'name' => __( 'Subject', 'email-subscribers' ),
|
439 |
+
'desc' => '',
|
440 |
+
),
|
441 |
+
|
442 |
+
'ig_es_cron_admin_email' => array(
|
443 |
+
'type' => 'textarea',
|
444 |
+
'options' => false,
|
445 |
+
'placeholder' => '',
|
446 |
+
'supplemental' => '',
|
447 |
+
'default' => '',
|
448 |
+
'id' => 'ig_es_cron_admin_email',
|
449 |
+
'name' => __( 'Content', 'email-subscribers' ),
|
450 |
+
'desc' => __( 'Send report to admin(s) whenever campaign is successfully sent to all contacts. Available Keywords: {{DATE}}, {{SUBJECT}}, {{COUNT}}', 'email-subscribers' ),
|
451 |
+
),
|
452 |
+
|
453 |
+
),
|
454 |
),
|
455 |
+
);
|
|
|
456 |
|
457 |
+
$signup_confirmation_settings = apply_filters( 'ig_es_registered_signup_confirmation_settings', $signup_confirmation_settings );
|
|
|
|
|
|
|
458 |
|
459 |
+
$email_sending_settings = array(
|
460 |
+
'ig_es_cronurl' => array(
|
461 |
'type' => 'text',
|
|
|
462 |
'placeholder' => '',
|
463 |
'supplemental' => '',
|
464 |
'default' => '',
|
465 |
+
'readonly' => 'readonly',
|
466 |
+
'id' => 'ig_es_cronurl',
|
467 |
+
'name' => __( 'Cron URL', 'email-subscribers' ),
|
468 |
+
/* translators: %s: Link to Icegram documentation */
|
469 |
+
'desc' => sprintf( __( "You need to visit this URL to send email notifications. Know <a href='%s' target='_blank'>how to run this in background</a>", 'email-subscribers' ), 'https://www.icegram.com/documentation/es-how-to-schedule-cron-emails-in-cpanel/?utm_source=es&utm_medium=in_app&utm_campaign=view_docs_help_page' ),
|
470 |
),
|
471 |
+
'ig_es_disable_wp_cron' => array(
|
472 |
+
'type' => 'checkbox',
|
|
|
|
|
473 |
'placeholder' => '',
|
474 |
'supplemental' => '',
|
475 |
+
'default' => 'no',
|
476 |
+
'id' => 'ig_es_disable_wp_cron',
|
477 |
+
'name' => __( 'Disable WordPress Cron', 'email-subscribers' ),
|
478 |
+
'info' => __( 'Check this if you do not want Email Subscribers to use WP Cron to send emails.', 'email-subscribers' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
),
|
480 |
|
481 |
+
'ig_es_cron_interval' => array(
|
482 |
+
'id' => 'ig_es_cron_interval',
|
483 |
+
'name' => __( 'Send Emails At Most Every', 'email-subscribers' ),
|
484 |
+
'type' => 'select',
|
485 |
+
'options' => ES()->cron->cron_intervals(),
|
486 |
+
'desc' => __( 'Optional if a real cron service is used', 'email-subscribers' ),
|
487 |
+
'default' => IG_ES_CRON_INTERVAL,
|
488 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
|
490 |
+
'ig_es_hourly_email_send_limit' => array(
|
491 |
+
'type' => 'number',
|
492 |
+
'placeholder' => '',
|
493 |
+
'supplemental' => '',
|
494 |
+
'default' => 50,
|
495 |
+
'id' => 'ig_es_hourly_email_send_limit',
|
496 |
+
'name' => __( 'Maximum Emails To Send In An Hour', 'email-subscribers' ),
|
497 |
+
'desc' => __( 'Total emails your host can send in an hour.', 'email-subscribers' ),
|
498 |
),
|
499 |
|
500 |
+
'ig_es_max_email_send_at_once' => array(
|
501 |
+
'type' => 'number',
|
|
|
502 |
'placeholder' => '',
|
503 |
'supplemental' => '',
|
504 |
+
'default' => IG_ES_MAX_EMAIL_SEND_AT_ONCE,
|
505 |
+
'id' => 'ig_es_max_email_send_at_once',
|
506 |
+
'name' => __( 'Maximum Emails To Send At once', 'email-subscribers' ),
|
507 |
+
'desc' => __( 'Maximum emails you want to send on every cron request.', 'email-subscribers' ),
|
508 |
),
|
509 |
|
510 |
+
'ig_es_test_send_email' => array(
|
511 |
+
'type' => 'html',
|
512 |
+
/* translators: %s: Spinner image path */
|
513 |
+
'html' => sprintf( __( '<input id="es-test-email" class="mt-3 mb-1 border-gray-400 form-input h-9"/><input type="submit" name="submit" id="es-send-test" class="ig-es-primary-button" value="Send Email"><span class="es_spinner_image_admin" id="spinner-image" style="display:none"><img src="%s" alt="Loading..."/></span>'), ES_PLUGIN_URL . 'lite/public/images/spinner.gif' ),
|
514 |
'placeholder' => '',
|
515 |
'supplemental' => '',
|
516 |
'default' => '',
|
517 |
+
'id' => 'ig_es_test_send_email',
|
518 |
+
'name' => __( 'Send Test Email', 'email-subscribers' ),
|
519 |
+
'desc' => __( 'Enter email address to send test email.', 'email-subscribers' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
520 |
),
|
521 |
+
|
522 |
+
'ig_es_mailer_settings' => array(
|
523 |
+
'type' => 'html',
|
524 |
+
'sub_fields' => array(
|
525 |
+
'mailer' => array(
|
526 |
+
'id' => 'ig_es_mailer_settings[mailer]',
|
527 |
+
'name' => __( 'Select Mailer', 'email-subscribers' ),
|
528 |
+
'type' => 'html',
|
529 |
+
'html' => self::mailers_html(),
|
530 |
+
'desc' => '',
|
531 |
+
),
|
532 |
+
'ig_es_pepipost_api_key' => array(
|
533 |
+
'type' => 'password',
|
534 |
+
'options' => false,
|
535 |
+
'placeholder' => '',
|
536 |
+
'supplemental' => '',
|
537 |
+
'default' => '',
|
538 |
+
'id' => 'ig_es_mailer_settings[pepipost][api_key]',
|
539 |
+
'name' => __( 'Pepipost API key', 'email-subscribers' ),
|
540 |
+
'desc' => '',
|
541 |
+
'class' => 'pepipost',
|
542 |
+
),
|
543 |
+
'ig_es_pepipost_docblock' => array(
|
544 |
+
'type' => 'html',
|
545 |
+
'html' => self::pepipost_doc_block(),
|
546 |
+
'id' => 'ig_es_pepipost_docblock',
|
547 |
+
'name' => '',
|
548 |
+
),
|
549 |
+
|
550 |
+
),
|
551 |
'placeholder' => '',
|
552 |
'supplemental' => '',
|
553 |
'default' => '',
|
554 |
+
'id' => 'ig_es_mailer_settings',
|
555 |
+
'name' => __( 'Select a mailer to send mail', 'email-subscribers' ),
|
556 |
'desc' => '',
|
|
|
557 |
),
|
558 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
559 |
|
560 |
+
$email_sending_settings = apply_filters( 'ig_es_registered_email_sending_settings', $email_sending_settings );
|
561 |
+
|
562 |
+
$security_settings = array(
|
563 |
+
'blocked_domains' => array(
|
564 |
+
'id' => 'ig_es_blocked_domains',
|
565 |
+
'name' => __( 'Blocked Domain(s)', 'email-subscribers' ),
|
566 |
+
'type' => 'textarea',
|
567 |
+
'info' => __( 'Seeing spam signups from particular domains? Enter domains names (one per line) that you want to block here.', 'email-subscribers' ),
|
568 |
+
'default' => '',
|
569 |
+
'rows' => 3,
|
570 |
+
),
|
571 |
+
|
572 |
+
);
|
573 |
+
|
574 |
+
$security_settings = apply_filters( 'ig_es_registered_security_settings', $security_settings );
|
575 |
+
|
576 |
+
$es_settings = array(
|
577 |
+
'general' => $general_settings,
|
578 |
+
'signup_confirmation' => $signup_confirmation_settings,
|
579 |
+
'email_sending' => $email_sending_settings,
|
580 |
+
'security_settings' => $security_settings,
|
581 |
+
);
|
582 |
+
|
583 |
+
return apply_filters( 'ig_es_registered_settings', $es_settings );
|
584 |
+
}
|
585 |
+
|
586 |
+
public function field_callback( $arguments, $id_key = '' ) {
|
587 |
+
$field_html = '';
|
588 |
+
if ( 'ig_es_cronurl' === $arguments['id'] ) {
|
589 |
+
$value = ES()->cron->url();
|
590 |
} else {
|
591 |
+
if ( ! empty( $arguments['option_value'] ) ) {
|
592 |
+
preg_match( '(\[.*$)', $arguments['id'], $m );
|
593 |
+
$n = explode( '][', $m[0] );
|
594 |
+
$n = str_replace( '[', '', $n );
|
595 |
+
$n = str_replace( ']', '', $n );
|
596 |
+
$count = count( $n );
|
597 |
+
$id = '';
|
598 |
+
foreach ( $n as $key => $val ) {
|
599 |
+
if ( '' == $id ) {
|
600 |
+
$id = ! empty( $arguments['option_value'][ $val ] ) ? $arguments['option_value'][ $val ] : '';
|
601 |
+
} else {
|
602 |
+
$id = $id[ $val ];
|
603 |
+
}
|
604 |
+
}
|
605 |
+
$value = $id;
|
606 |
+
} else {
|
607 |
$value = get_option( $arguments['id'] ); // Get the current value, if there is one
|
608 |
}
|
609 |
}
|
625 |
// Check which type of field we want
|
626 |
switch ( $arguments['type'] ) {
|
627 |
case 'text': // If it is a text field
|
628 |
+
$field_html = sprintf( '<input name="%1$s" id="%2$s" placeholder="%4$s" value="%5$s" %6$s class="%7$s form-input h-9 mt-2 mb-1 text-sm border-gray-400 w-3/5"/>', $uid, $id_key, $type, $placeholder, $value, $readonly, $class );
|
629 |
+
break;
|
630 |
case 'password': // If it is a text field
|
631 |
+
$field_html = sprintf( '<input name="%1$s" id="%2$s" type="%3$s" placeholder="%4$s" value="%5$s" %6$s class="form-input h-9 mt-2 mb-1 text-sm border-gray-400 w-3/5 %7$s"/>', $uid, $id_key, $type, $placeholder, $value, $readonly, $class );
|
632 |
+
break;
|
633 |
|
634 |
case 'number': // If it is a number field
|
635 |
+
$field_html = sprintf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" %5$s min="0" class="w-2/5 mt-2 mb-1 text-sm border-gray-400 h-9 "/>', $uid, $type, $placeholder, $value, $readonly );
|
636 |
+
break;
|
637 |
|
638 |
case 'email':
|
639 |
+
$field_html = sprintf( '<input name="%1$s" id="%2$s" type="%3$s" placeholder="%4$s" value="%5$s" class="%6$s form-input w-2/3 mt-2 mb-1 h-9 text-sm border-gray-400 w-3/5"/>', $uid, $id_key, $type, $placeholder, $value, $class );
|
640 |
+
break;
|
641 |
|
642 |
case 'textarea':
|
643 |
+
$field_html = sprintf( '<textarea name="%1$s" id="%2$s" placeholder="%3$s" size="100" rows="%6$s" cols="58" class="%5$s form-textarea text-sm w-2/3 mt-3 mb-1 border-gray-400 w-3/5">%4$s</textarea>', $uid, $id_key, $placeholder, $value, $class, $rows );
|
644 |
+
break;
|
645 |
|
646 |
case 'file':
|
647 |
+
$field_html = '<input type="text" id="logo_url" name="' . $uid . '" value="' . $value . '" class="w-2/3 w-3/5 mt-2 mb-1 text-sm border-gray-400 form-input h-9' . $class . '"/> <input id="upload_logo_button" type="button" class="button" value="Upload Logo" />';
|
648 |
+
break;
|
649 |
|
650 |
+
case 'checkbox':
|
651 |
+
$field_html = '<label for="' . $id_key . '" class="inline-flex items-center mt-4 mb-1 cursor-pointer">
|
|
|
652 |
<span class="relative">';
|
653 |
|
654 |
+
if ( ! $disabled ) {
|
655 |
+
$field_html .= '<input id="' . $id_key . '" type="checkbox" name="' . $uid . '" value="yes" ' . checked( $value, 'yes', false ) . ' class="absolute w-0 h-0 mt-6 opacity-0 es-check-toggle ' . $class . '" />';
|
656 |
+
}
|
657 |
|
658 |
+
$field_html .= $placeholder . '</input>
|
659 |
<span class="block w-10 h-6 bg-gray-300 rounded-full shadow-inner es-mail-toggle-line "></span>
|
660 |
<span class="absolute inset-y-0 left-0 block w-4 h-4 mt-1 ml-1 transition-all duration-300 ease-in-out bg-white rounded-full shadow es-mail-toggle-dot focus-within:shadow-outline"></span>
|
661 |
</span>
|
662 |
</label>';
|
663 |
+
break;
|
664 |
|
665 |
case 'select':
|
666 |
+
if ( ! empty( $arguments['options'] ) && is_array( $arguments['options'] ) ) {
|
667 |
+
$options_markup = '';
|
668 |
+
foreach ( $arguments['options'] as $key => $label ) {
|
669 |
+
$options_markup .= sprintf(
|
670 |
+
'<option value="%s" %s>%s</option>',
|
671 |
+
$key,
|
672 |
+
selected( $value, $key, false ),
|
673 |
+
$label
|
674 |
+
);
|
675 |
+
}
|
676 |
+
$field_html = sprintf( '<select name="%1$s" id="%2$s" class="%4$s form-select rounded-lg w-2/5 h-9 mt-2 mb-1 border-gray-400">%3$s</select>', $uid, $id_key, $options_markup, $class );
|
677 |
}
|
678 |
+
break;
|
|
|
|
|
679 |
|
680 |
+
case 'html':
|
681 |
default:
|
682 |
+
$field_html = $html;
|
683 |
+
break;
|
684 |
}
|
685 |
|
686 |
$field_html .= '<br />';
|
687 |
|
688 |
+
// If there is help text
|
689 |
if ( ! empty( $arguments['desc'] ) ) {
|
690 |
+
$helper = $arguments['desc'];
|
691 |
$field_html .= sprintf( '<p class="mb-2 text-xs italic font-normal leading-snug text-gray-500 helper"> %s</p>', $helper ); // Show it
|
692 |
}
|
693 |
|
702 |
return self::$instance;
|
703 |
}
|
704 |
|
705 |
+
public function render_settings_fields( $fields ) {
|
706 |
+
$html = "<table class='mt-4 mr-4 overflow-hidden bg-white rounded-lg lg:mx-5 xl:mx-7'>";
|
707 |
+
$html .= '<tbody>';
|
708 |
foreach ( $fields as $key => $field ) {
|
709 |
if ( ! empty( $field['name'] ) ) {
|
710 |
$html .= "<tr class='py-4 ml-4 border-b border-gray-100 '><th scope='row' class='block pt-3 pb-8 pr-4 ml-6 text-left pt-7'><span class='pb-2 text-sm font-semibold text-gray-600'>";
|
714 |
$html .= '<a href="' . $field['link'] . '" target="_blank"><span class="inline-flex px-2 text-xs font-semibold leading-5 text-green-800 bg-green-100 rounded-full">' . __( 'Premium', 'email-subscribers' ) . '</span></a>';
|
715 |
}
|
716 |
|
717 |
+
// If there is help text
|
718 |
if ( ! empty( $field['info'] ) ) {
|
719 |
$helper = $field['info'];
|
720 |
+
$html .= '<br />' . sprintf( '<p class="mt-1 text-xs italic font-normal leading-snug text-gray-500">%s</p>', $helper ); // Show it
|
721 |
}
|
722 |
+
$button_html = '<tr>';
|
723 |
|
724 |
+
$html .= '</th>';
|
725 |
}
|
726 |
|
727 |
$html .= "<td class='w-4/6 py-2 pl-5 bg-white rounded-lg '>";
|
728 |
|
729 |
if ( ! empty( $field['upgrade_desc'] ) ) {
|
730 |
+
$html .= "<div class='flex'><div class='flex-none w-2/5'>";
|
731 |
}
|
732 |
|
733 |
if ( ! empty( $field['sub_fields'] ) ) {
|
741 |
}
|
742 |
$sub_field['option_value'] = is_array( $option_value ) ? $option_value : '';
|
743 |
}
|
744 |
+
$class = ( ! empty( $sub_field['class'] ) ) ? $sub_field['class'] : '';
|
745 |
+
$html .= ( reset( $field['sub_fields'] ) !== $sub_field ) ? '<br/>' : '';
|
746 |
+
$html .= '<div class="es_sub_headline ' . $class . '" ><strong>' . $sub_field['name'] . '</strong></div>';
|
747 |
+
$html .= $this->field_callback( $sub_field, $field_key );
|
748 |
}
|
749 |
} else {
|
750 |
$html .= $this->field_callback( $field );
|
751 |
}
|
752 |
|
753 |
if ( ! empty( $field['upgrade_desc'] ) ) {
|
754 |
+
$html .= "</div>
|
755 |
<div class='w-3/5'>
|
756 |
<div class='px-3 py-2 mr-2 rounded-md bg-teal-50'>
|
757 |
<div class='flex'>
|
762 |
</div>
|
763 |
<div class='ml-3'>
|
764 |
<h3 class='text-sm font-medium leading-5 text-teal-700'>";
|
765 |
+
$html .= $field['upgrade_title'] . '</h3>';
|
766 |
$html .= "<div class='mt-2 text-sm leading-5 text-teal-500'>
|
767 |
+
<p>" . $field['upgrade_desc'] . '</p>
|
768 |
</div>
|
769 |
</div>
|
770 |
</div>
|
771 |
</div>
|
772 |
+
</div>';
|
773 |
}
|
774 |
|
775 |
+
$html .= '</td></tr>';
|
776 |
}
|
777 |
|
778 |
+
$button_html = empty( $button_html ) ? '<tr>' : $button_html;
|
779 |
+
|
780 |
+
$nonce_field = wp_nonce_field( 'update-settings', 'update-settings', true, false );
|
781 |
+
$html .= $button_html . "<td class='es-settings-submit-btn'>";
|
782 |
+
$html .= '<input type="hidden" name="submitted" value="submitted" />';
|
783 |
+
$html .= '<input type="hidden" name="submit_action" value="ig-es-save-admin-settings" />';
|
784 |
+
$html .= $nonce_field;
|
785 |
+
$html .= '<input type="submit" name="submit" class="mx-6 my-2 cursor-pointer ig-es-primary-button" value="' . __( 'Save Settings', 'email-subscribers' ) . '">';
|
786 |
+
$html .= '</td></tr>';
|
787 |
+
$html .= '</tbody>';
|
788 |
+
$html .= '</table>';
|
789 |
+
|
790 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
791 |
+
add_filter( 'safe_style_css', 'ig_es_allowed_css_style' );
|
792 |
+
echo wp_kses( $html , $allowedtags );
|
793 |
}
|
794 |
|
795 |
/**
|
811 |
$php_email_type_values = array(
|
812 |
'php_html_mail',
|
813 |
'php_plaintext_mail',
|
814 |
+
'phpmail',
|
815 |
);
|
816 |
|
817 |
+
if ( in_array( $es_email_type, $php_email_type_values, true ) ) {
|
818 |
$selected_mailer = 'phpmail';
|
819 |
}
|
820 |
}
|
822 |
$pepipost_doc_block = '';
|
823 |
|
824 |
$mailers = array(
|
825 |
+
'wpmail' => array(
|
826 |
+
'name' => 'WP Mail',
|
827 |
+
'logo' => ES_PLUGIN_URL . 'lite/admin/images/wpmail.png',
|
828 |
+
),
|
829 |
+
'phpmail' => array(
|
830 |
+
'name' => 'PHP mail',
|
831 |
+
'logo' => ES_PLUGIN_URL . 'lite/admin/images/phpmail.png',
|
832 |
+
),
|
833 |
+
'pepipost' => array(
|
834 |
+
'name' => 'Pepipost',
|
835 |
+
'logo' => ES_PLUGIN_URL . 'lite/admin/images/pepipost.png',
|
836 |
+
'docblock' => $pepipost_doc_block,
|
837 |
+
),
|
838 |
);
|
839 |
|
840 |
$mailers = apply_filters( 'ig_es_mailers', $mailers );
|
870 |
?>
|
871 |
<div class="es_sub_headline ig_es_docblock ig_es_pepipost_div_wrapper pepipost">
|
872 |
<ul>
|
873 |
+
<li><a class="" href="https://app.pepipost.com/index.php/signup/icegram?fpr=icegram" target="_blank"><?php esc_html_e( 'Signup for Pepipost', 'email-subscribers' ); ?></a></li>
|
874 |
+
<li><?php esc_html_e( 'How to find', 'email-subscribers' ); ?> <a href="https://developers.pepipost.com/api/getstarted/overview?utm_source=icegram&utm_medium=es_inapp&utm_campaign=pepipost" target="_blank"> <?php esc_html_e( 'Pepipost API key', 'email-subscribers' ); ?></a></li>
|
875 |
+
<li><a href="https://www.icegram.com/email-subscribers-integrates-with-pepipost?utm_source=es_inapp&utm_medium=es_upsale&utm_campaign=upsale" target="_blank"><?php esc_html_e( 'Why to choose Pepipost', 'email-subscribers' ); ?></a></li>
|
876 |
</ul>
|
877 |
</div>
|
878 |
|
884 |
}
|
885 |
|
886 |
/**
|
887 |
+
* Register ES cron info
|
888 |
+
*
|
889 |
* @return array $email_sending_settings ES send email settings.
|
890 |
+
*
|
891 |
* @since 4.4.9
|
892 |
*/
|
893 |
public function show_cron_info( $email_sending_settings ) {
|
894 |
$es_cron_enabled = ES()->cron->is_wp_cron_enable();
|
895 |
+
if ( $es_cron_enabled ) {
|
896 |
+
$es_cron_info = array(
|
897 |
'ig_es_cron_info' => array(
|
898 |
+
'id' => 'ig_es_cron_info',
|
899 |
+
'name' => __( 'Cron Info', 'email-subscribers' ),
|
900 |
+
'type' => 'html',
|
901 |
+
'html' => self::render_cron_info_html(),
|
902 |
),
|
903 |
);
|
904 |
$email_sending_settings = ig_es_array_insert_after( $email_sending_settings, 'ig_es_cronurl', $es_cron_info );
|
917 |
public static function render_cron_info_html() {
|
918 |
$site_crons = get_option( 'cron' );
|
919 |
|
920 |
+
if ( empty( $site_crons ) ) {
|
921 |
return;
|
922 |
}
|
923 |
|
924 |
$es_cron_enabled = ES()->cron->is_wp_cron_enable();
|
925 |
|
926 |
+
$es_crons_data = array();
|
927 |
$es_cron_events = array(
|
928 |
'ig_es_cron',
|
929 |
'ig_es_cron_worker',
|
936 |
$time_format = get_option( 'time_format' );
|
937 |
|
938 |
foreach ( $site_crons as $next_scheduled_time => $scheduled_crons ) {
|
939 |
+
if ( ! empty( $scheduled_crons ) && is_array( $scheduled_crons ) ) {
|
940 |
+
foreach ( $scheduled_crons as $cron_event => $cron_data ) {
|
941 |
+
if ( ! in_array( $cron_event, $es_cron_events, true ) ) {
|
942 |
continue;
|
943 |
}
|
944 |
+
foreach ( $cron_data as $cron_info ) {
|
945 |
+
if ( ! empty( $cron_info['schedule'] ) ) {
|
946 |
+
$cron_schedule = $cron_info['schedule'];
|
947 |
+
$cron_interval = ! empty( $cron_schedules[ $cron_schedule ]['interval'] ) ? $cron_schedules[ $cron_schedule ]['interval'] : 0;
|
948 |
+
$es_crons_data[ $cron_event ] = array(
|
949 |
'cron_interval' => $cron_interval,
|
950 |
'next_scheduled_time' => $next_scheduled_time,
|
951 |
);
|
956 |
}
|
957 |
|
958 |
$html = '';
|
959 |
+
if ( ! empty( $es_crons_data ) ) {
|
960 |
ob_start();
|
961 |
?>
|
962 |
<table class="min-w-full rounded-lg">
|
969 |
</thead>
|
970 |
<tbody class="bg-blue-50">
|
971 |
<?php
|
972 |
+
foreach ( $es_cron_events as $cron_event ) {
|
973 |
$cron_interval = '';
|
974 |
$next_scheduled_time = '';
|
975 |
+
if ( ! empty( $es_crons_data[ $cron_event ] ) ) {
|
976 |
+
$es_cron_data = $es_crons_data[ $cron_event ];
|
977 |
$cron_interval = $es_cron_data['cron_interval'];
|
978 |
$next_scheduled_time = $es_cron_data['next_scheduled_time'];
|
979 |
} else {
|
980 |
+
if ( 'ig_es_cron_auto_responder' === $cron_event ) {
|
981 |
wp_schedule_event( floor( time() / 300 ) * 300 - 120, 'ig_es_cron_interval', 'ig_es_cron_auto_responder' );
|
982 |
+
} elseif ( 'ig_es_cron_worker' === $cron_event ) {
|
983 |
wp_schedule_event( floor( time() / 300 ) * 300, 'ig_es_cron_interval', 'ig_es_cron_worker' );
|
984 |
+
} elseif ( 'ig_es_cron' === $cron_event ) {
|
985 |
wp_schedule_event( strtotime( 'midnight' ) - 300, 'hourly', 'ig_es_cron' );
|
986 |
}
|
987 |
$next_scheduled_time = wp_next_scheduled( $cron_event );
|
988 |
+
if ( 'ig_es_cron' === $cron_event ) {
|
989 |
+
$cron_interval = 3600; // Hourly interval for ig_es_cron.
|
990 |
} else {
|
991 |
+
$cron_interval = ES()->cron->get_cron_interval();
|
992 |
}
|
993 |
}
|
994 |
+
if ( empty( $cron_interval ) || empty( $next_scheduled_time ) ) {
|
995 |
continue;
|
996 |
}
|
997 |
?>
|
999 |
<td class="pl-8 py-4 ">
|
1000 |
<div class="flex items-center">
|
1001 |
<div class="flex-shrink-0">
|
1002 |
+
<span class="text-sm leading-5 font-medium text-center text-gray-800"><?php echo esc_html( $cron_event ); ?></span>
|
1003 |
</div>
|
1004 |
</div>
|
1005 |
</td>
|
1006 |
<td class="whitespace-no-wrap text-center">
|
1007 |
+
<?php
|
1008 |
+
echo esc_html( ig_es_get_human_interval( $cron_interval ) );
|
1009 |
?>
|
1010 |
</td>
|
1011 |
<td class="whitespace-no-wrap text-center">
|
1012 |
+
<?php /* translators: %s: Next scheduled time */ ?>
|
1013 |
+
<b><?php echo esc_html( sprintf( __( 'In %s', 'email-subscribers' ), human_time_diff( time(), $next_scheduled_time ) ) ); ?></b><br>
|
1014 |
<span title="<?php echo esc_attr( 'UTC: ' . date_i18n( $date_format . ' ' . $time_format, $next_scheduled_time ) ); ?>">
|
1015 |
+
<?php echo esc_html( date_i18n( $date_format . ' ' . $time_format, $next_scheduled_time + $time_offset ) ); ?>
|
1016 |
</span>
|
1017 |
</td>
|
1018 |
</tr>
|
1028 |
return $html;
|
1029 |
}
|
1030 |
|
1031 |
+
}
|
lite/includes/classes/class-es-browser.php
CHANGED
@@ -1,12 +1,19 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* File: Browser.php
|
4 |
* Author: Chris Schuld (http://chrisschuld.com/)
|
5 |
* Last Modified: April 14th, 2020
|
|
|
6 |
* @version 1.9.6
|
7 |
*
|
8 |
* Copyright 2019 Chris Schuld
|
9 |
-
*
|
10 |
* Permission is hereby granted, free of charge, to any person obtaining a
|
11 |
* copy of this software and associated documentation files (the "Software"),
|
12 |
* to deal in the Software without restriction, including without
|
@@ -14,13 +21,13 @@
|
|
14 |
* sublicense, and/or sell copies of the Software, and to permit persons to
|
15 |
* whom the Software is furnished to do so, subject to the following
|
16 |
* conditions:
|
17 |
-
*
|
18 |
* The above copyright notice and this permission notice shall be included
|
19 |
* in all copies or substantial portions of the Software.
|
20 |
-
*
|
21 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
22 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
23 |
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
24 |
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
25 |
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
26 |
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
@@ -37,1808 +44,1802 @@
|
|
37 |
*
|
38 |
* This implementation is based on the original work from Gary White
|
39 |
* http://apptools.com/phptools/browser/
|
40 |
-
*
|
41 |
*/
|
42 |
class ES_Browser {
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
$this->_platform = self::PLATFORM_I_FRAME;
|
1838 |
-
}
|
1839 |
-
}
|
1840 |
-
|
1841 |
-
/**
|
1842 |
* Method to get email client.
|
1843 |
*
|
1844 |
* @return string $email_client Email client name.
|
@@ -1851,54 +1852,54 @@ class ES_Browser {
|
|
1851 |
|
1852 |
if ( preg_match( '# Thunderbird/([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1853 |
$email_client = 'Thunderbird';
|
1854 |
-
}
|
1855 |
$email_client = 'Airmail';
|
1856 |
-
}
|
1857 |
$email_client = 'Gmail App (Android)';
|
1858 |
-
}
|
1859 |
$email_client = 'Gmail';
|
1860 |
-
}
|
1861 |
$email_client = 'iPod Touch';
|
1862 |
-
}
|
1863 |
$email_client = $hit[1];
|
1864 |
-
}
|
1865 |
$email_client = $hit[1];
|
1866 |
-
}
|
1867 |
$email_client = $hit[1];
|
1868 |
-
}
|
1869 |
$email_client = str_replace( '-', ' ', $hit[1] );
|
1870 |
-
}
|
1871 |
$email_client = 'Windows Live Mail';
|
1872 |
-
}
|
1873 |
$email_client = 'Outlook Express';
|
1874 |
-
}
|
1875 |
$email_client = 'Windows Live Mail';
|
1876 |
-
}
|
1877 |
$email_client = 'Microsoft Outlook';
|
1878 |
-
}
|
1879 |
$email_client = 'Web Client (' . $hit[1] . ')';
|
1880 |
-
}
|
1881 |
$email_client = 'Web Client (Internet Explorer ' . (int) $hit[1] . ')';
|
1882 |
-
}
|
1883 |
$version = (int) $hit[1];
|
1884 |
if ( $version <= 7 ) {
|
1885 |
-
//most likly Outlook 2000-2003
|
1886 |
$email_client = 'Microsoft Outlook';
|
1887 |
} else {
|
1888 |
$email_client = 'Web Client (Internet Explorer ' . $version . ')';
|
1889 |
}
|
1890 |
-
}
|
1891 |
if ( preg_match( '#Mac OS X 10_(\d+)#i', $this->_agent, $versionhit ) ) {
|
1892 |
$email_client = 'Apple Mail';
|
1893 |
} else {
|
1894 |
$email_client = 'Web Client (WebKit based)';
|
1895 |
}
|
1896 |
-
}
|
1897 |
$email_client = 'Web Client (Mozilla based)';
|
1898 |
} else {
|
1899 |
-
$email_client = 'Web Client ('
|
1900 |
}
|
1901 |
|
1902 |
return $email_client;
|
1903 |
}
|
1904 |
-
}
|
1 |
<?php
|
2 |
+
|
3 |
+
// Exit if accessed directly
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit;
|
6 |
+
}
|
7 |
+
|
8 |
/**
|
9 |
* File: Browser.php
|
10 |
* Author: Chris Schuld (http://chrisschuld.com/)
|
11 |
* Last Modified: April 14th, 2020
|
12 |
+
*
|
13 |
* @version 1.9.6
|
14 |
*
|
15 |
* Copyright 2019 Chris Schuld
|
16 |
+
*
|
17 |
* Permission is hereby granted, free of charge, to any person obtaining a
|
18 |
* copy of this software and associated documentation files (the "Software"),
|
19 |
* to deal in the Software without restriction, including without
|
21 |
* sublicense, and/or sell copies of the Software, and to permit persons to
|
22 |
* whom the Software is furnished to do so, subject to the following
|
23 |
* conditions:
|
24 |
+
*
|
25 |
* The above copyright notice and this permission notice shall be included
|
26 |
* in all copies or substantial portions of the Software.
|
27 |
+
*
|
28 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
29 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
30 |
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
31 |
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
32 |
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
33 |
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
44 |
*
|
45 |
* This implementation is based on the original work from Gary White
|
46 |
* http://apptools.com/phptools/browser/
|
|
|
47 |
*/
|
48 |
class ES_Browser {
|
49 |
+
private $_agent = '';
|
50 |
+
private $_browser_name = '';
|
51 |
+
private $_version = '';
|
52 |
+
private $_platform = '';
|
53 |
+
private $_os = '';
|
54 |
+
private $_is_aol = false;
|
55 |
+
private $_is_mobile = false;
|
56 |
+
private $_is_tablet = false;
|
57 |
+
private $_is_robot = false;
|
58 |
+
private $_is_facebook = false;
|
59 |
+
private $_aol_version = '';
|
60 |
+
|
61 |
+
const BROWSER_UNKNOWN = 'unknown';
|
62 |
+
const VERSION_UNKNOWN = 'unknown';
|
63 |
+
|
64 |
+
const BROWSER_OPERA = 'Opera'; // http://www.opera.com/
|
65 |
+
const BROWSER_OPERA_MINI = 'Opera Mini'; // http://www.opera.com/mini/
|
66 |
+
const BROWSER_WEBTV = 'WebTV'; // http://www.webtv.net/pc/
|
67 |
+
const BROWSER_EDGE = 'Edge'; // https://www.microsoft.com/edge
|
68 |
+
const BROWSER_IE = 'Internet Explorer'; // http://www.microsoft.com/ie/
|
69 |
+
const BROWSER_POCKET_IE = 'Pocket Internet Explorer'; // http://en.wikipedia.org/wiki/Internet_Explorer_Mobile
|
70 |
+
const BROWSER_KONQUEROR = 'Konqueror'; // http://www.konqueror.org/
|
71 |
+
const BROWSER_ICAB = 'iCab'; // http://www.icab.de/
|
72 |
+
const BROWSER_OMNIWEB = 'OmniWeb'; // http://www.omnigroup.com/applications/omniweb/
|
73 |
+
const BROWSER_FIREBIRD = 'Firebird'; // http://www.ibphoenix.com/
|
74 |
+
const BROWSER_FIREFOX = 'Firefox'; // https://www.mozilla.org/en-US/firefox/
|
75 |
+
const BROWSER_BRAVE = 'Brave'; // https://brave.com/
|
76 |
+
const BROWSER_PALEMOON = 'Palemoon'; // https://www.palemoon.org/
|
77 |
+
const BROWSER_ICEWEASEL = 'Iceweasel'; // http://www.geticeweasel.org/
|
78 |
+
const BROWSER_SHIRETOKO = 'Shiretoko'; // http://wiki.mozilla.org/Projects/shiretoko
|
79 |
+
const BROWSER_MOZILLA = 'Mozilla'; // http://www.mozilla.com/en-US/
|
80 |
+
const BROWSER_AMAYA = 'Amaya'; // http://www.w3.org/Amaya/
|
81 |
+
const BROWSER_LYNX = 'Lynx'; // http://en.wikipedia.org/wiki/Lynx
|
82 |
+
const BROWSER_SAFARI = 'Safari'; // http://apple.com
|
83 |
+
const BROWSER_IPHONE = 'iPhone'; // http://apple.com
|
84 |
+
const BROWSER_IPOD = 'iPod'; // http://apple.com
|
85 |
+
const BROWSER_IPAD = 'iPad'; // http://apple.com
|
86 |
+
const BROWSER_CHROME = 'Chrome'; // http://www.google.com/chrome
|
87 |
+
const BROWSER_ANDROID = 'Android'; // http://www.android.com/
|
88 |
+
const BROWSER_GOOGLEBOT = 'GoogleBot'; // http://en.wikipedia.org/wiki/Googlebot
|
89 |
+
const BROWSER_CURL = 'cURL'; // https://en.wikipedia.org/wiki/CURL
|
90 |
+
const BROWSER_WGET = 'Wget'; // https://en.wikipedia.org/wiki/Wget
|
91 |
+
const BROWSER_UCBROWSER = 'UCBrowser'; // https://www.ucweb.com/
|
92 |
+
|
93 |
+
|
94 |
+
const BROWSER_YANDEXBOT = 'YandexBot'; // http://yandex.com/bots
|
95 |
+
const BROWSER_YANDEXIMAGERESIZER_BOT = 'YandexImageResizer'; // http://yandex.com/bots
|
96 |
+
const BROWSER_YANDEXIMAGES_BOT = 'YandexImages'; // http://yandex.com/bots
|
97 |
+
const BROWSER_YANDEXVIDEO_BOT = 'YandexVideo'; // http://yandex.com/bots
|
98 |
+
const BROWSER_YANDEXMEDIA_BOT = 'YandexMedia'; // http://yandex.com/bots
|
99 |
+
const BROWSER_YANDEXBLOGS_BOT = 'YandexBlogs'; // http://yandex.com/bots
|
100 |
+
const BROWSER_YANDEXFAVICONS_BOT = 'YandexFavicons'; // http://yandex.com/bots
|
101 |
+
const BROWSER_YANDEXWEBMASTER_BOT = 'YandexWebmaster'; // http://yandex.com/bots
|
102 |
+
const BROWSER_YANDEXDIRECT_BOT = 'YandexDirect'; // http://yandex.com/bots
|
103 |
+
const BROWSER_YANDEXMETRIKA_BOT = 'YandexMetrika'; // http://yandex.com/bots
|
104 |
+
const BROWSER_YANDEXNEWS_BOT = 'YandexNews'; // http://yandex.com/bots
|
105 |
+
const BROWSER_YANDEXCATALOG_BOT = 'YandexCatalog'; // http://yandex.com/bots
|
106 |
+
|
107 |
+
const BROWSER_SLURP = 'Yahoo! Slurp'; // http://en.wikipedia.org/wiki/Yahoo!_Slurp
|
108 |
+
const BROWSER_W3CVALIDATOR = 'W3C Validator'; // http://validator.w3.org/
|
109 |
+
const BROWSER_BLACKBERRY = 'BlackBerry'; // http://www.blackberry.com/
|
110 |
+
const BROWSER_ICECAT = 'IceCat'; // http://en.wikipedia.org/wiki/GNU_IceCat
|
111 |
+
const BROWSER_NOKIA_S60 = 'Nokia S60 OSS Browser'; // http://en.wikipedia.org/wiki/Web_Browser_for_S60
|
112 |
+
const BROWSER_NOKIA = 'Nokia Browser'; // * all other WAP-based browsers on the Nokia Platform
|
113 |
+
const BROWSER_MSN = 'MSN Browser'; // http://explorer.msn.com/
|
114 |
+
const BROWSER_MSNBOT = 'MSN Bot'; // http://search.msn.com/msnbot.htm
|
115 |
+
const BROWSER_BINGBOT = 'Bing Bot'; // http://en.wikipedia.org/wiki/Bingbot
|
116 |
+
const BROWSER_VIVALDI = 'Vivaldi'; // https://vivaldi.com/
|
117 |
+
const BROWSER_YANDEX = 'Yandex'; // https://browser.yandex.ua/
|
118 |
+
|
119 |
+
const BROWSER_NETSCAPE_NAVIGATOR = 'Netscape Navigator'; // http://browser.netscape.com/ (DEPRECATED)
|
120 |
+
const BROWSER_GALEON = 'Galeon'; // http://galeon.sourceforge.net/ (DEPRECATED)
|
121 |
+
const BROWSER_NETPOSITIVE = 'NetPositive'; // http://en.wikipedia.org/wiki/NetPositive (DEPRECATED)
|
122 |
+
const BROWSER_PHOENIX = 'Phoenix'; // http://en.wikipedia.org/wiki/History_of_Mozilla_Firefox (DEPRECATED)
|
123 |
+
const BROWSER_PLAYSTATION = 'PlayStation';
|
124 |
+
const BROWSER_SAMSUNG = 'SamsungBrowser';
|
125 |
+
const BROWSER_SILK = 'Silk';
|
126 |
+
const BROWSER_I_FRAME = 'Iframely';
|
127 |
+
const BROWSER_COCOA = 'CocoaRestClient';
|
128 |
+
|
129 |
+
const PLATFORM_UNKNOWN = 'unknown';
|
130 |
+
const PLATFORM_WINDOWS = 'Windows';
|
131 |
+
const PLATFORM_WINDOWS_CE = 'Windows CE';
|
132 |
+
const PLATFORM_APPLE = 'Apple';
|
133 |
+
const PLATFORM_LINUX = 'Linux';
|
134 |
+
const PLATFORM_OS2 = 'OS/2';
|
135 |
+
const PLATFORM_BEOS = 'BeOS';
|
136 |
+
const PLATFORM_IPHONE = 'iPhone';
|
137 |
+
const PLATFORM_IPOD = 'iPod';
|
138 |
+
const PLATFORM_IPAD = 'iPad';
|
139 |
+
const PLATFORM_BLACKBERRY = 'BlackBerry';
|
140 |
+
const PLATFORM_NOKIA = 'Nokia';
|
141 |
+
const PLATFORM_FREEBSD = 'FreeBSD';
|
142 |
+
const PLATFORM_OPENBSD = 'OpenBSD';
|
143 |
+
const PLATFORM_NETBSD = 'NetBSD';
|
144 |
+
const PLATFORM_SUNOS = 'SunOS';
|
145 |
+
const PLATFORM_OPENSOLARIS = 'OpenSolaris';
|
146 |
+
const PLATFORM_ANDROID = 'Android';
|
147 |
+
const PLATFORM_PLAYSTATION = 'Sony PlayStation';
|
148 |
+
const PLATFORM_ROKU = 'Roku';
|
149 |
+
const PLATFORM_APPLE_TV = 'Apple TV';
|
150 |
+
const PLATFORM_TERMINAL = 'Terminal';
|
151 |
+
const PLATFORM_FIRE_OS = 'Fire OS';
|
152 |
+
const PLATFORM_SMART_TV = 'SMART-TV';
|
153 |
+
const PLATFORM_CHROME_OS = 'Chrome OS';
|
154 |
+
const PLATFORM_JAVA_ANDROID = 'Java/Android';
|
155 |
+
const PLATFORM_POSTMAN = 'Postman';
|
156 |
+
const PLATFORM_I_FRAME = 'Iframely';
|
157 |
+
|
158 |
+
const OPERATING_SYSTEM_UNKNOWN = 'unknown';
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Class constructor
|
162 |
+
*
|
163 |
+
* @param string $userAgent
|
164 |
+
*/
|
165 |
+
public function __construct( $userAgent = '') {
|
166 |
+
if ( '' != $userAgent ) {
|
167 |
+
$this->setUserAgent($userAgent);
|
168 |
+
} else {
|
169 |
+
$this->reset();
|
170 |
+
$this->determine();
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Reset all properties
|
176 |
+
*/
|
177 |
+
public function reset() {
|
178 |
+
$this->_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( $_SERVER['HTTP_USER_AGENT'] ) : '';
|
179 |
+
$this->_browser_name = self::BROWSER_UNKNOWN;
|
180 |
+
$this->_version = self::VERSION_UNKNOWN;
|
181 |
+
$this->_platform = self::PLATFORM_UNKNOWN;
|
182 |
+
$this->_os = self::OPERATING_SYSTEM_UNKNOWN;
|
183 |
+
$this->_is_aol = false;
|
184 |
+
$this->_is_mobile = false;
|
185 |
+
$this->_is_tablet = false;
|
186 |
+
$this->_is_robot = false;
|
187 |
+
$this->_is_facebook = false;
|
188 |
+
$this->_aol_version = self::VERSION_UNKNOWN;
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Check to see if the specific browser is valid
|
193 |
+
*
|
194 |
+
* @param string $browserName
|
195 |
+
* @return bool True if the browser is the specified browser
|
196 |
+
*/
|
197 |
+
public function isBrowser( $browserName) {
|
198 |
+
return ( 0 == strcasecmp($this->_browser_name, trim($browserName)) );
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* The name of the browser. All return types are from the class contants
|
203 |
+
*
|
204 |
+
* @return string Name of the browser
|
205 |
+
*/
|
206 |
+
public function getBrowser() {
|
207 |
+
return $this->_browser_name;
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Set the name of the browser
|
212 |
+
*
|
213 |
+
* @param $browser string The name of the Browser
|
214 |
+
*/
|
215 |
+
public function setBrowser( $browser) {
|
216 |
+
$this->_browser_name = $browser;
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* The name of the platform. All return types are from the class contants
|
221 |
+
*
|
222 |
+
* @return string Name of the browser
|
223 |
+
*/
|
224 |
+
public function getPlatform() {
|
225 |
+
return $this->_platform;
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Set the name of the platform
|
230 |
+
*
|
231 |
+
* @param string $platform The name of the Platform
|
232 |
+
*/
|
233 |
+
public function setPlatform( $platform) {
|
234 |
+
$this->_platform = $platform;
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* The version of the browser.
|
239 |
+
*
|
240 |
+
* @return string Version of the browser (will only contain alpha-numeric characters and a period)
|
241 |
+
*/
|
242 |
+
public function getVersion() {
|
243 |
+
return $this->_version;
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Set the version of the browser
|
248 |
+
*
|
249 |
+
* @param string $version The version of the Browser
|
250 |
+
*/
|
251 |
+
public function setVersion( $version) {
|
252 |
+
$this->_version = preg_replace('/[^0-9,.,a-z,A-Z-]/', '', $version);
|
253 |
+
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* The version of AOL.
|
257 |
+
*
|
258 |
+
* @return string Version of AOL (will only contain alpha-numeric characters and a period)
|
259 |
+
*/
|
260 |
+
public function getAolVersion() {
|
261 |
+
return $this->_aol_version;
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Set the version of AOL
|
266 |
+
*
|
267 |
+
* @param string $version The version of AOL
|
268 |
+
*/
|
269 |
+
public function setAolVersion( $version) {
|
270 |
+
$this->_aol_version = preg_replace('/[^0-9,.,a-z,A-Z]/', '', $version);
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* Is the browser from AOL?
|
275 |
+
*
|
276 |
+
* @return boolean True if the browser is from AOL otherwise false
|
277 |
+
*/
|
278 |
+
public function isAol() {
|
279 |
+
return $this->_is_aol;
|
280 |
+
}
|
281 |
+
|
282 |
+
/**
|
283 |
+
* Is the browser from a mobile device?
|
284 |
+
*
|
285 |
+
* @return boolean True if the browser is from a mobile device otherwise false
|
286 |
+
*/
|
287 |
+
public function isMobile() {
|
288 |
+
return $this->_is_mobile;
|
289 |
+
}
|
290 |
+
|
291 |
+
/**
|
292 |
+
* Is the browser from a tablet device?
|
293 |
+
*
|
294 |
+
* @return boolean True if the browser is from a tablet device otherwise false
|
295 |
+
*/
|
296 |
+
public function isTablet() {
|
297 |
+
return $this->_is_tablet;
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Is the browser from a robot (ex Slurp,GoogleBot)?
|
302 |
+
*
|
303 |
+
* @return boolean True if the browser is from a robot otherwise false
|
304 |
+
*/
|
305 |
+
public function isRobot() {
|
306 |
+
return $this->_is_robot;
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Is the browser from facebook?
|
311 |
+
*
|
312 |
+
* @return boolean True if the browser is from facebook otherwise false
|
313 |
+
*/
|
314 |
+
public function isFacebook() {
|
315 |
+
return $this->_is_facebook;
|
316 |
+
}
|
317 |
+
|
318 |
+
/**
|
319 |
+
* Set the browser to be from AOL
|
320 |
+
*
|
321 |
+
* @param $isAol
|
322 |
+
*/
|
323 |
+
public function setAol( $isAol) {
|
324 |
+
$this->_is_aol = $isAol;
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Set the Browser to be mobile
|
329 |
+
*
|
330 |
+
* @param boolean $value is the browser a mobile browser or not
|
331 |
+
*/
|
332 |
+
protected function setMobile( $value = true) {
|
333 |
+
$this->_is_mobile = $value;
|
334 |
+
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* Set the Browser to be tablet
|
338 |
+
*
|
339 |
+
* @param boolean $value is the browser a tablet browser or not
|
340 |
+
*/
|
341 |
+
protected function setTablet( $value = true) {
|
342 |
+
$this->_is_tablet = $value;
|
343 |
+
}
|
344 |
+
|
345 |
+
/**
|
346 |
+
* Set the Browser to be a robot
|
347 |
+
*
|
348 |
+
* @param boolean $value is the browser a robot or not
|
349 |
+
*/
|
350 |
+
protected function setRobot( $value = true) {
|
351 |
+
$this->_is_robot = $value;
|
352 |
+
}
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Set the Browser to be a Facebook request
|
356 |
+
*
|
357 |
+
* @param boolean $value is the browser a robot or not
|
358 |
+
*/
|
359 |
+
protected function setFacebook( $value = true) {
|
360 |
+
$this->_is_facebook = $value;
|
361 |
+
}
|
362 |
+
|
363 |
+
/**
|
364 |
+
* Get the user agent value in use to determine the browser
|
365 |
+
*
|
366 |
+
* @return string The user agent from the HTTP header
|
367 |
+
*/
|
368 |
+
public function getUserAgent() {
|
369 |
+
return $this->_agent;
|
370 |
+
}
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Set the user agent value (the construction will use the HTTP header value - this will overwrite it)
|
374 |
+
*
|
375 |
+
* @param string $agent_string The value for the User Agent
|
376 |
+
*/
|
377 |
+
public function setUserAgent( $agent_string) {
|
378 |
+
$this->reset();
|
379 |
+
$this->_agent = $agent_string;
|
380 |
+
$this->determine();
|
381 |
+
}
|
382 |
+
|
383 |
+
/**
|
384 |
+
* Used to determine if the browser is actually "chromeframe"
|
385 |
+
*
|
386 |
+
* @since 1.7
|
387 |
+
* @return boolean True if the browser is using chromeframe
|
388 |
+
*/
|
389 |
+
public function isChromeFrame() {
|
390 |
+
return ( strpos($this->_agent, 'chromeframe') !== false );
|
391 |
+
}
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Returns a formatted string with a summary of the details of the browser.
|
395 |
+
*
|
396 |
+
* @return string formatted string with a summary of the browser
|
397 |
+
*/
|
398 |
+
public function __toString() {
|
399 |
+
return "<strong>Browser Name:</strong> {$this->getBrowser()}<br/>\n" .
|
400 |
+
"<strong>Browser Version:</strong> {$this->getVersion()}<br/>\n" .
|
401 |
+
"<strong>Browser User Agent String:</strong> {$this->getUserAgent()}<br/>\n" .
|
402 |
+
"<strong>Platform:</strong> {$this->getPlatform()}<br/>";
|
403 |
+
}
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Protected routine to calculate and determine what the browser is in use (including platform)
|
407 |
+
*/
|
408 |
+
protected function determine() {
|
409 |
+
$this->checkPlatform();
|
410 |
+
$this->checkBrowsers();
|
411 |
+
$this->checkForAol();
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Protected routine to determine the browser type
|
416 |
+
*
|
417 |
+
* @return boolean True if the browser was detected otherwise false
|
418 |
+
*/
|
419 |
+
protected function checkBrowsers() {
|
420 |
+
return (
|
421 |
+
// well-known, well-used
|
422 |
+
// Special Notes:
|
423 |
+
// (1) Opera must be checked before FireFox due to the odd
|
424 |
+
// user agents used in some older versions of Opera
|
425 |
+
// (2) WebTV is strapped onto Internet Explorer so we must
|
426 |
+
// check for WebTV before IE
|
427 |
+
// (3) (deprecated) Galeon is based on Firefox and needs to be
|
428 |
+
// tested before Firefox is tested
|
429 |
+
// (4) OmniWeb is based on Safari so OmniWeb check must occur
|
430 |
+
// before Safari
|
431 |
+
// (5) Netscape 9+ is based on Firefox so Netscape checks
|
432 |
+
// before FireFox are necessary
|
433 |
+
// (6) Vivaldi is UA contains both Firefox and Chrome so Vivaldi checks
|
434 |
+
// before Firefox and Chrome
|
435 |
+
$this->checkBrowserWebTv() ||
|
436 |
+
$this->checkBrowserBrave() ||
|
437 |
+
$this->checkBrowserUCBrowser() ||
|
438 |
+
$this->checkBrowserEdge() ||
|
439 |
+
$this->checkBrowserInternetExplorer() ||
|
440 |
+
$this->checkBrowserOpera() ||
|
441 |
+
$this->checkBrowserGaleon() ||
|
442 |
+
$this->checkBrowserNetscapeNavigator9Plus() ||
|
443 |
+
$this->checkBrowserVivaldi() ||
|
444 |
+
$this->checkBrowserYandex() ||
|
445 |
+
$this->checkBrowserPalemoon() ||
|
446 |
+
$this->checkBrowserFirefox() ||
|
447 |
+
$this->checkBrowserChrome() ||
|
448 |
+
$this->checkBrowserOmniWeb() ||
|
449 |
+
|
450 |
+
// common mobile
|
451 |
+
$this->checkBrowserAndroid() ||
|
452 |
+
$this->checkBrowseriPad() ||
|
453 |
+
$this->checkBrowseriPod() ||
|
454 |
+
$this->checkBrowseriPhone() ||
|
455 |
+
$this->checkBrowserBlackBerry() ||
|
456 |
+
$this->checkBrowserNokia() ||
|
457 |
+
|
458 |
+
// common bots
|
459 |
+
$this->checkBrowserGoogleBot() ||
|
460 |
+
$this->checkBrowserMSNBot() ||
|
461 |
+
$this->checkBrowserBingBot() ||
|
462 |
+
$this->checkBrowserSlurp() ||
|
463 |
+
|
464 |
+
// Yandex bots
|
465 |
+
$this->checkBrowserYandexBot() ||
|
466 |
+
$this->checkBrowserYandexImageResizerBot() ||
|
467 |
+
$this->checkBrowserYandexBlogsBot() ||
|
468 |
+
$this->checkBrowserYandexCatalogBot() ||
|
469 |
+
$this->checkBrowserYandexDirectBot() ||
|
470 |
+
$this->checkBrowserYandexFaviconsBot() ||
|
471 |
+
$this->checkBrowserYandexImagesBot() ||
|
472 |
+
$this->checkBrowserYandexMediaBot() ||
|
473 |
+
$this->checkBrowserYandexMetrikaBot() ||
|
474 |
+
$this->checkBrowserYandexNewsBot() ||
|
475 |
+
$this->checkBrowserYandexVideoBot() ||
|
476 |
+
$this->checkBrowserYandexWebmasterBot() ||
|
477 |
+
|
478 |
+
// check for facebook external hit when loading URL
|
479 |
+
$this->checkFacebookExternalHit() ||
|
480 |
+
|
481 |
+
// WebKit base check (post mobile and others)
|
482 |
+
$this->checkBrowserSamsung() ||
|
483 |
+
$this->checkBrowserSilk() ||
|
484 |
+
$this->checkBrowserSafari() ||
|
485 |
+
|
486 |
+
// everyone else
|
487 |
+
$this->checkBrowserNetPositive() ||
|
488 |
+
$this->checkBrowserFirebird() ||
|
489 |
+
$this->checkBrowserKonqueror() ||
|
490 |
+
$this->checkBrowserIcab() ||
|
491 |
+
$this->checkBrowserPhoenix() ||
|
492 |
+
$this->checkBrowserAmaya() ||
|
493 |
+
$this->checkBrowserLynx() ||
|
494 |
+
$this->checkBrowserShiretoko() ||
|
495 |
+
$this->checkBrowserIceCat() ||
|
496 |
+
$this->checkBrowserIceweasel() ||
|
497 |
+
$this->checkBrowserW3CValidator() ||
|
498 |
+
$this->checkBrowserCurl() ||
|
499 |
+
$this->checkBrowserWget() ||
|
500 |
+
$this->checkBrowserPlayStation() ||
|
501 |
+
$this->checkBrowserIframely() ||
|
502 |
+
$this->checkBrowserCocoa() ||
|
503 |
+
$this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */ );
|
504 |
+
}
|
505 |
+
|
506 |
+
/**
|
507 |
+
* Determine if the user is using a BlackBerry (last updated 1.7)
|
508 |
+
*
|
509 |
+
* @return boolean True if the browser is the BlackBerry browser otherwise false
|
510 |
+
*/
|
511 |
+
protected function checkBrowserBlackBerry() {
|
512 |
+
if (stripos($this->_agent, 'blackberry') !== false) {
|
513 |
+
$aresult = explode('/', stristr($this->_agent, 'BlackBerry'));
|
514 |
+
if (isset($aresult[1])) {
|
515 |
+
$aversion = explode(' ', $aresult[1]);
|
516 |
+
$this->setVersion($aversion[0]);
|
517 |
+
$this->_browser_name = self::BROWSER_BLACKBERRY;
|
518 |
+
$this->setMobile(true);
|
519 |
+
return true;
|
520 |
+
}
|
521 |
+
}
|
522 |
+
return false;
|
523 |
+
}
|
524 |
+
|
525 |
+
/**
|
526 |
+
* Determine if the user is using an AOL User Agent (last updated 1.7)
|
527 |
+
*
|
528 |
+
* @return boolean True if the browser is from AOL otherwise false
|
529 |
+
*/
|
530 |
+
protected function checkForAol() {
|
531 |
+
$this->setAol(false);
|
532 |
+
$this->setAolVersion(self::VERSION_UNKNOWN);
|
533 |
+
|
534 |
+
if (stripos($this->_agent, 'aol') !== false) {
|
535 |
+
$aversion = explode(' ', stristr($this->_agent, 'AOL'));
|
536 |
+
if (isset($aversion[1])) {
|
537 |
+
$this->setAol(true);
|
538 |
+
$this->setAolVersion(preg_replace('/[^0-9\.a-z]/i', '', $aversion[1]));
|
539 |
+
return true;
|
540 |
+
}
|
541 |
+
}
|
542 |
+
return false;
|
543 |
+
}
|
544 |
+
|
545 |
+
/**
|
546 |
+
* Determine if the browser is the GoogleBot or not (last updated 1.7)
|
547 |
+
*
|
548 |
+
* @return boolean True if the browser is the GoogletBot otherwise false
|
549 |
+
*/
|
550 |
+
protected function checkBrowserGoogleBot() {
|
551 |
+
if (stripos($this->_agent, 'googlebot') !== false) {
|
552 |
+
$aresult = explode('/', stristr($this->_agent, 'googlebot'));
|
553 |
+
if (isset($aresult[1])) {
|
554 |
+
$aversion = explode(' ', $aresult[1]);
|
555 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
556 |
+
$this->_browser_name = self::BROWSER_GOOGLEBOT;
|
557 |
+
$this->setRobot(true);
|
558 |
+
return true;
|
559 |
+
}
|
560 |
+
}
|
561 |
+
return false;
|
562 |
+
}
|
563 |
+
|
564 |
+
/**
|
565 |
+
* Determine if the browser is the YandexBot or not
|
566 |
+
*
|
567 |
+
* @return boolean True if the browser is the YandexBot otherwise false
|
568 |
+
*/
|
569 |
+
protected function checkBrowserYandexBot() {
|
570 |
+
if (stripos($this->_agent, 'YandexBot') !== false) {
|
571 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexBot'));
|
572 |
+
if (isset($aresult[1])) {
|
573 |
+
$aversion = explode(' ', $aresult[1]);
|
574 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
575 |
+
$this->_browser_name = self::BROWSER_YANDEXBOT;
|
576 |
+
$this->setRobot(true);
|
577 |
+
return true;
|
578 |
+
}
|
579 |
+
}
|
580 |
+
return false;
|
581 |
+
}
|
582 |
+
|
583 |
+
/**
|
584 |
+
* Determine if the browser is the YandexImageResizer or not
|
585 |
+
*
|
586 |
+
* @return boolean True if the browser is the YandexImageResizer otherwise false
|
587 |
+
*/
|
588 |
+
protected function checkBrowserYandexImageResizerBot() {
|
589 |
+
if (stripos($this->_agent, 'YandexImageResizer') !== false) {
|
590 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexImageResizer'));
|
591 |
+
if (isset($aresult[1])) {
|
592 |
+
$aversion = explode(' ', $aresult[1]);
|
593 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
594 |
+
$this->_browser_name = self::BROWSER_YANDEXIMAGERESIZER_BOT;
|
595 |
+
$this->setRobot(true);
|
596 |
+
return true;
|
597 |
+
}
|
598 |
+
}
|
599 |
+
return false;
|
600 |
+
}
|
601 |
+
|
602 |
+
/**
|
603 |
+
* Determine if the browser is the YandexCatalog or not
|
604 |
+
*
|
605 |
+
* @return boolean True if the browser is the YandexCatalog otherwise false
|
606 |
+
*/
|
607 |
+
protected function checkBrowserYandexCatalogBot() {
|
608 |
+
if (stripos($this->_agent, 'YandexCatalog') !== false) {
|
609 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexCatalog'));
|
610 |
+
if (isset($aresult[1])) {
|
611 |
+
$aversion = explode(' ', $aresult[1]);
|
612 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
613 |
+
$this->_browser_name = self::BROWSER_YANDEXCATALOG_BOT;
|
614 |
+
$this->setRobot(true);
|
615 |
+
return true;
|
616 |
+
}
|
617 |
+
}
|
618 |
+
return false;
|
619 |
+
}
|
620 |
+
|
621 |
+
/**
|
622 |
+
* Determine if the browser is the YandexNews or not
|
623 |
+
*
|
624 |
+
* @return boolean True if the browser is the YandexNews otherwise false
|
625 |
+
*/
|
626 |
+
protected function checkBrowserYandexNewsBot() {
|
627 |
+
if (stripos($this->_agent, 'YandexNews') !== false) {
|
628 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexNews'));
|
629 |
+
if (isset($aresult[1])) {
|
630 |
+
$aversion = explode(' ', $aresult[1]);
|
631 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
632 |
+
$this->_browser_name = self::BROWSER_YANDEXNEWS_BOT;
|
633 |
+
$this->setRobot(true);
|
634 |
+
return true;
|
635 |
+
}
|
636 |
+
}
|
637 |
+
return false;
|
638 |
+
}
|
639 |
+
|
640 |
+
/**
|
641 |
+
* Determine if the browser is the YandexMetrika or not
|
642 |
+
*
|
643 |
+
* @return boolean True if the browser is the YandexMetrika otherwise false
|
644 |
+
*/
|
645 |
+
protected function checkBrowserYandexMetrikaBot() {
|
646 |
+
if (stripos($this->_agent, 'YandexMetrika') !== false) {
|
647 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexMetrika'));
|
648 |
+
if (isset($aresult[1])) {
|
649 |
+
$aversion = explode(' ', $aresult[1]);
|
650 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
651 |
+
$this->_browser_name = self::BROWSER_YANDEXMETRIKA_BOT;
|
652 |
+
$this->setRobot(true);
|
653 |
+
return true;
|
654 |
+
}
|
655 |
+
}
|
656 |
+
return false;
|
657 |
+
}
|
658 |
+
|
659 |
+
/**
|
660 |
+
* Determine if the browser is the YandexDirect or not
|
661 |
+
*
|
662 |
+
* @return boolean True if the browser is the YandexDirect otherwise false
|
663 |
+
*/
|
664 |
+
protected function checkBrowserYandexDirectBot() {
|
665 |
+
if (stripos($this->_agent, 'YandexDirect') !== false) {
|
666 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexDirect'));
|
667 |
+
if (isset($aresult[1])) {
|
668 |
+
$aversion = explode(' ', $aresult[1]);
|
669 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
670 |
+
$this->_browser_name = self::BROWSER_YANDEXDIRECT_BOT;
|
671 |
+
$this->setRobot(true);
|
672 |
+
return true;
|
673 |
+
}
|
674 |
+
}
|
675 |
+
return false;
|
676 |
+
}
|
677 |
+
|
678 |
+
/**
|
679 |
+
* Determine if the browser is the YandexWebmaster or not
|
680 |
+
*
|
681 |
+
* @return boolean True if the browser is the YandexWebmaster otherwise false
|
682 |
+
*/
|
683 |
+
protected function checkBrowserYandexWebmasterBot() {
|
684 |
+
if (stripos($this->_agent, 'YandexWebmaster') !== false) {
|
685 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexWebmaster'));
|
686 |
+
if (isset($aresult[1])) {
|
687 |
+
$aversion = explode(' ', $aresult[1]);
|
688 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
689 |
+
$this->_browser_name = self::BROWSER_YANDEXWEBMASTER_BOT;
|
690 |
+
$this->setRobot(true);
|
691 |
+
return true;
|
692 |
+
}
|
693 |
+
}
|
694 |
+
return false;
|
695 |
+
}
|
696 |
+
|
697 |
+
/**
|
698 |
+
* Determine if the browser is the YandexFavicons or not
|
699 |
+
*
|
700 |
+
* @return boolean True if the browser is the YandexFavicons otherwise false
|
701 |
+
*/
|
702 |
+
protected function checkBrowserYandexFaviconsBot() {
|
703 |
+
if (stripos($this->_agent, 'YandexFavicons') !== false) {
|
704 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexFavicons'));
|
705 |
+
if (isset($aresult[1])) {
|
706 |
+
$aversion = explode(' ', $aresult[1]);
|
707 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
708 |
+
$this->_browser_name = self::BROWSER_YANDEXFAVICONS_BOT;
|
709 |
+
$this->setRobot(true);
|
710 |
+
return true;
|
711 |
+
}
|
712 |
+
}
|
713 |
+
return false;
|
714 |
+
}
|
715 |
+
|
716 |
+
/**
|
717 |
+
* Determine if the browser is the YandexBlogs or not
|
718 |
+
*
|
719 |
+
* @return boolean True if the browser is the YandexBlogs otherwise false
|
720 |
+
*/
|
721 |
+
protected function checkBrowserYandexBlogsBot() {
|
722 |
+
if (stripos($this->_agent, 'YandexBlogs') !== false) {
|
723 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexBlogs'));
|
724 |
+
if (isset($aresult[1])) {
|
725 |
+
$aversion = explode(' ', $aresult[1]);
|
726 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
727 |
+
$this->_browser_name = self::BROWSER_YANDEXBLOGS_BOT;
|
728 |
+
$this->setRobot(true);
|
729 |
+
return true;
|
730 |
+
}
|
731 |
+
}
|
732 |
+
return false;
|
733 |
+
}
|
734 |
+
|
735 |
+
/**
|
736 |
+
* Determine if the browser is the YandexMedia or not
|
737 |
+
*
|
738 |
+
* @return boolean True if the browser is the YandexMedia otherwise false
|
739 |
+
*/
|
740 |
+
protected function checkBrowserYandexMediaBot() {
|
741 |
+
if (stripos($this->_agent, 'YandexMedia') !== false) {
|
742 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexMedia'));
|
743 |
+
if (isset($aresult[1])) {
|
744 |
+
$aversion = explode(' ', $aresult[1]);
|
745 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
746 |
+
$this->_browser_name = self::BROWSER_YANDEXMEDIA_BOT;
|
747 |
+
$this->setRobot(true);
|
748 |
+
return true;
|
749 |
+
}
|
750 |
+
}
|
751 |
+
return false;
|
752 |
+
}
|
753 |
+
|
754 |
+
/**
|
755 |
+
* Determine if the browser is the YandexVideo or not
|
756 |
+
*
|
757 |
+
* @return boolean True if the browser is the YandexVideo otherwise false
|
758 |
+
*/
|
759 |
+
protected function checkBrowserYandexVideoBot() {
|
760 |
+
if (stripos($this->_agent, 'YandexVideo') !== false) {
|
761 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexVideo'));
|
762 |
+
if (isset($aresult[1])) {
|
763 |
+
$aversion = explode(' ', $aresult[1]);
|
764 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
765 |
+
$this->_browser_name = self::BROWSER_YANDEXVIDEO_BOT;
|
766 |
+
$this->setRobot(true);
|
767 |
+
return true;
|
768 |
+
}
|
769 |
+
}
|
770 |
+
return false;
|
771 |
+
}
|
772 |
+
|
773 |
+
/**
|
774 |
+
* Determine if the browser is the YandexImages or not
|
775 |
+
*
|
776 |
+
* @return boolean True if the browser is the YandexImages otherwise false
|
777 |
+
*/
|
778 |
+
protected function checkBrowserYandexImagesBot() {
|
779 |
+
if (stripos($this->_agent, 'YandexImages') !== false) {
|
780 |
+
$aresult = explode('/', stristr($this->_agent, 'YandexImages'));
|
781 |
+
if (isset($aresult[1])) {
|
782 |
+
$aversion = explode(' ', $aresult[1]);
|
783 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
784 |
+
$this->_browser_name = self::BROWSER_YANDEXIMAGES_BOT;
|
785 |
+
$this->setRobot(true);
|
786 |
+
return true;
|
787 |
+
}
|
788 |
+
}
|
789 |
+
return false;
|
790 |
+
}
|
791 |
+
|
792 |
+
/**
|
793 |
+
* Determine if the browser is the MSNBot or not (last updated 1.9)
|
794 |
+
*
|
795 |
+
* @return boolean True if the browser is the MSNBot otherwise false
|
796 |
+
*/
|
797 |
+
protected function checkBrowserMSNBot() {
|
798 |
+
if (stripos($this->_agent, 'msnbot') !== false) {
|
799 |
+
$aresult = explode('/', stristr($this->_agent, 'msnbot'));
|
800 |
+
if (isset($aresult[1])) {
|
801 |
+
$aversion = explode(' ', $aresult[1]);
|
802 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
803 |
+
$this->_browser_name = self::BROWSER_MSNBOT;
|
804 |
+
$this->setRobot(true);
|
805 |
+
return true;
|
806 |
+
}
|
807 |
+
}
|
808 |
+
return false;
|
809 |
+
}
|
810 |
+
|
811 |
+
/**
|
812 |
+
* Determine if the browser is the BingBot or not (last updated 1.9)
|
813 |
+
*
|
814 |
+
* @return boolean True if the browser is the BingBot otherwise false
|
815 |
+
*/
|
816 |
+
protected function checkBrowserBingBot() {
|
817 |
+
if (stripos($this->_agent, 'bingbot') !== false) {
|
818 |
+
$aresult = explode('/', stristr($this->_agent, 'bingbot'));
|
819 |
+
if (isset($aresult[1])) {
|
820 |
+
$aversion = explode(' ', $aresult[1]);
|
821 |
+
$this->setVersion(str_replace(';', '', $aversion[0]));
|
822 |
+
$this->_browser_name = self::BROWSER_BINGBOT;
|
823 |
+
$this->setRobot(true);
|
824 |
+
return true;
|
825 |
+
}
|
826 |
+
}
|
827 |
+
return false;
|
828 |
+
}
|
829 |
+
|
830 |
+
/**
|
831 |
+
* Determine if the browser is the W3C Validator or not (last updated 1.7)
|
832 |
+
*
|
833 |
+
* @return boolean True if the browser is the W3C Validator otherwise false
|
834 |
+
*/
|
835 |
+
protected function checkBrowserW3CValidator() {
|
836 |
+
if (stripos($this->_agent, 'W3C-checklink') !== false) {
|
837 |
+
$aresult = explode('/', stristr($this->_agent, 'W3C-checklink'));
|
838 |
+
if (isset($aresult[1])) {
|
839 |
+
$aversion = explode(' ', $aresult[1]);
|
840 |
+
$this->setVersion($aversion[0]);
|
841 |
+
$this->_browser_name = self::BROWSER_W3CVALIDATOR;
|
842 |
+
return true;
|
843 |
+
}
|
844 |
+
} elseif (stripos($this->_agent, 'W3C_Validator') !== false) {
|
845 |
+
// Some of the Validator versions do not delineate w/ a slash - add it back in
|
846 |
+
$ua = str_replace('W3C_Validator ', 'W3C_Validator/', $this->_agent);
|
847 |
+
$aresult = explode('/', stristr($ua, 'W3C_Validator'));
|
848 |
+
if (isset($aresult[1])) {
|
849 |
+
$aversion = explode(' ', $aresult[1]);
|
850 |
+
$this->setVersion($aversion[0]);
|
851 |
+
$this->_browser_name = self::BROWSER_W3CVALIDATOR;
|
852 |
+
return true;
|
853 |
+
}
|
854 |
+
} elseif (stripos($this->_agent, 'W3C-mobileOK') !== false) {
|
855 |
+
$this->_browser_name = self::BROWSER_W3CVALIDATOR;
|
856 |
+
$this->setMobile(true);
|
857 |
+
return true;
|
858 |
+
}
|
859 |
+
return false;
|
860 |
+
}
|
861 |
+
|
862 |
+
/**
|
863 |
+
* Determine if the browser is the Yahoo! Slurp Robot or not (last updated 1.7)
|
864 |
+
*
|
865 |
+
* @return boolean True if the browser is the Yahoo! Slurp Robot otherwise false
|
866 |
+
*/
|
867 |
+
protected function checkBrowserSlurp() {
|
868 |
+
if (stripos($this->_agent, 'slurp') !== false) {
|
869 |
+
$aresult = explode('/', stristr($this->_agent, 'Slurp'));
|
870 |
+
if (isset($aresult[1])) {
|
871 |
+
$aversion = explode(' ', $aresult[1]);
|
872 |
+
$this->setVersion($aversion[0]);
|
873 |
+
$this->_browser_name = self::BROWSER_SLURP;
|
874 |
+
$this->setRobot(true);
|
875 |
+
$this->setMobile(false);
|
876 |
+
return true;
|
877 |
+
}
|
878 |
+
}
|
879 |
+
return false;
|
880 |
+
}
|
881 |
+
|
882 |
+
/**
|
883 |
+
* Determine if the browser is Brave or not
|
884 |
+
*
|
885 |
+
* @return boolean True if the browser is Brave otherwise false
|
886 |
+
*/
|
887 |
+
protected function checkBrowserBrave() {
|
888 |
+
if (stripos($this->_agent, 'Brave/') !== false) {
|
889 |
+
$aResult = explode('/', stristr($this->_agent, 'Brave'));
|
890 |
+
if (isset($aResult[1])) {
|
891 |
+
$aversion = explode(' ', $aResult[1]);
|
892 |
+
$this->setVersion($aversion[0]);
|
893 |
+
$this->setBrowser(self::BROWSER_BRAVE);
|
894 |
+
return true;
|
895 |
+
}
|
896 |
+
} elseif (stripos($this->_agent, ' Brave ') !== false) {
|
897 |
+
$this->setBrowser(self::BROWSER_BRAVE);
|
898 |
+
// this version of the UA did not ship with a version marker
|
899 |
+
// e.g. Mozilla/5.0 (Linux; Android 7.0; SM-G955F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Brave Chrome/68.0.3440.91 Mobile Safari/537.36
|
900 |
+
$this->setVersion('');
|
901 |
+
return true;
|
902 |
+
}
|
903 |
+
return false;
|
904 |
+
}
|
905 |
+
|
906 |
+
/**
|
907 |
+
* Determine if the browser is Edge or not
|
908 |
+
*
|
909 |
+
* @return boolean True if the browser is Edge otherwise false
|
910 |
+
*/
|
911 |
+
protected function checkBrowserEdge() {
|
912 |
+
$short_edg = stripos($this->_agent, 'Edg/') !== false || stripos($this->_agent, 'EdgA/') !== false ? 'Edg' : false;
|
913 |
+
$name = stripos($this->_agent, 'Edge/') !== false ? 'Edge' : $short_edg;
|
914 |
+
if ( $name ) {
|
915 |
+
$aresult = explode('/', stristr($this->_agent, $name));
|
916 |
+
if (isset($aresult[1])) {
|
917 |
+
$aversion = explode(' ', $aresult[1]);
|
918 |
+
$this->setVersion($aversion[0]);
|
919 |
+
$this->setBrowser(self::BROWSER_EDGE);
|
920 |
+
if (stripos($this->_agent, 'Windows Phone') !== false || stripos($this->_agent, 'Android') !== false) {
|
921 |
+
$this->setMobile(true);
|
922 |
+
}
|
923 |
+
return true;
|
924 |
+
}
|
925 |
+
}
|
926 |
+
return false;
|
927 |
+
}
|
928 |
+
|
929 |
+
/**
|
930 |
+
* Determine if the browser is Internet Explorer or not (last updated 1.7)
|
931 |
+
*
|
932 |
+
* @return boolean True if the browser is Internet Explorer otherwise false
|
933 |
+
*/
|
934 |
+
protected function checkBrowserInternetExplorer() {
|
935 |
+
// Test for IE11
|
936 |
+
if (stripos($this->_agent, 'Trident/7.0; rv:11.0') !== false) {
|
937 |
+
$this->setBrowser(self::BROWSER_IE);
|
938 |
+
$this->setVersion('11.0');
|
939 |
+
return true;
|
940 |
+
} elseif (stripos($this->_agent, 'microsoft internet explorer') !== false) {
|
941 |
+
// Test for v1 - v1.5 IE
|
942 |
+
$this->setBrowser(self::BROWSER_IE);
|
943 |
+
$this->setVersion('1.0');
|
944 |
+
$aresult = stristr($this->_agent, '/');
|
945 |
+
if (preg_match('/308|425|426|474|0b1/i', $aresult)) {
|
946 |
+
$this->setVersion('1.5');
|
947 |
+
}
|
948 |
+
return true;
|
949 |
+
} elseif (stripos($this->_agent, 'msie') !== false && stripos($this->_agent, 'opera') === false) {
|
950 |
+
// Test for versions > 1.5
|
951 |
+
// See if the browser is the odd MSN Explorer
|
952 |
+
if (stripos($this->_agent, 'msnb') !== false) {
|
953 |
+
$aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'MSN'));
|
954 |
+
if (isset($aresult[1])) {
|
955 |
+
$this->setBrowser(self::BROWSER_MSN);
|
956 |
+
$this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
|
957 |
+
return true;
|
958 |
+
}
|
959 |
+
}
|
960 |
+
$aresult = explode(' ', stristr(str_replace(';', '; ', $this->_agent), 'msie'));
|
961 |
+
if (isset($aresult[1])) {
|
962 |
+
$this->setBrowser(self::BROWSER_IE);
|
963 |
+
$this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1]));
|
964 |
+
if (stripos($this->_agent, 'IEMobile') !== false) {
|
965 |
+
$this->setBrowser(self::BROWSER_POCKET_IE);
|
966 |
+
$this->setMobile(true);
|
967 |
+
}
|
968 |
+
return true;
|
969 |
+
}
|
970 |
+
} elseif (stripos($this->_agent, 'trident') !== false) {
|
971 |
+
// Test for versions > IE 10
|
972 |
+
$this->setBrowser(self::BROWSER_IE);
|
973 |
+
$result = explode('rv:', $this->_agent);
|
974 |
+
if (isset($result[1])) {
|
975 |
+
$this->setVersion(preg_replace('/[^0-9.]+/', '', $result[1]));
|
976 |
+
$this->_agent = str_replace(array('Mozilla', 'Gecko'), 'MSIE', $this->_agent);
|
977 |
+
}
|
978 |
+
} elseif (stripos($this->_agent, 'mspie') !== false || stripos($this->_agent, 'pocket') !== false) {
|
979 |
+
// Test for Pocket IE
|
980 |
+
$aresult = explode(' ', stristr($this->_agent, 'mspie'));
|
981 |
+
if (isset($aresult[1])) {
|
982 |
+
$this->setPlatform(self::PLATFORM_WINDOWS_CE);
|
983 |
+
$this->setBrowser(self::BROWSER_POCKET_IE);
|
984 |
+
$this->setMobile(true);
|
985 |
+
|
986 |
+
if (stripos($this->_agent, 'mspie') !== false) {
|
987 |
+
$this->setVersion($aresult[1]);
|
988 |
+
} else {
|
989 |
+
$aversion = explode('/', $this->_agent);
|
990 |
+
if (isset($aversion[1])) {
|
991 |
+
$this->setVersion($aversion[1]);
|
992 |
+
}
|
993 |
+
}
|
994 |
+
return true;
|
995 |
+
}
|
996 |
+
}
|
997 |
+
return false;
|
998 |
+
}
|
999 |
+
|
1000 |
+
/**
|
1001 |
+
* Determine if the browser is Opera or not (last updated 1.7)
|
1002 |
+
*
|
1003 |
+
* @return boolean True if the browser is Opera otherwise false
|
1004 |
+
*/
|
1005 |
+
protected function checkBrowserOpera() {
|
1006 |
+
if (stripos($this->_agent, 'opera mini') !== false) {
|
1007 |
+
$resultant = stristr($this->_agent, 'opera mini');
|
1008 |
+
if (preg_match('/\//', $resultant)) {
|
1009 |
+
$aresult = explode('/', $resultant);
|
1010 |
+
if (isset($aresult[1])) {
|
1011 |
+
$aversion = explode(' ', $aresult[1]);
|
1012 |
+
$this->setVersion($aversion[0]);
|
1013 |
+
}
|
1014 |
+
} else {
|
1015 |
+
$aversion = explode(' ', stristr($resultant, 'opera mini'));
|
1016 |
+
if (isset($aversion[1])) {
|
1017 |
+
$this->setVersion($aversion[1]);
|
1018 |
+
}
|
1019 |
+
}
|
1020 |
+
$this->_browser_name = self::BROWSER_OPERA_MINI;
|
1021 |
+
$this->setMobile(true);
|
1022 |
+
return true;
|
1023 |
+
} elseif (stripos($this->_agent, 'opera') !== false) {
|
1024 |
+
$resultant = stristr($this->_agent, 'opera');
|
1025 |
+
if (preg_match('/Version\/(1*.*)$/', $resultant, $matches)) {
|
1026 |
+
$this->setVersion($matches[1]);
|
1027 |
+
} elseif (preg_match('/\//', $resultant)) {
|
1028 |
+
$aresult = explode('/', str_replace('(', ' ', $resultant));
|
1029 |
+
if (isset($aresult[1])) {
|
1030 |
+
$aversion = explode(' ', $aresult[1]);
|
1031 |
+
$this->setVersion($aversion[0]);
|
1032 |
+
}
|
1033 |
+
} else {
|
1034 |
+
$aversion = explode(' ', stristr($resultant, 'opera'));
|
1035 |
+
$this->setVersion(isset($aversion[1]) ? $aversion[1] : '');
|
1036 |
+
}
|
1037 |
+
if (stripos($this->_agent, 'Opera Mobi') !== false) {
|
1038 |
+
$this->setMobile(true);
|
1039 |
+
}
|
1040 |
+
$this->_browser_name = self::BROWSER_OPERA;
|
1041 |
+
return true;
|
1042 |
+
} elseif (stripos($this->_agent, 'OPR') !== false) {
|
1043 |
+
$resultant = stristr($this->_agent, 'OPR');
|
1044 |
+
if (preg_match('/\//', $resultant)) {
|
1045 |
+
$aresult = explode('/', str_replace('(', ' ', $resultant));
|
1046 |
+
if (isset($aresult[1])) {
|
1047 |
+
$aversion = explode(' ', $aresult[1]);
|
1048 |
+
$this->setVersion($aversion[0]);
|
1049 |
+
}
|
1050 |
+
}
|
1051 |
+
if (stripos($this->_agent, 'Mobile') !== false) {
|
1052 |
+
$this->setMobile(true);
|
1053 |
+
}
|
1054 |
+
$this->_browser_name = self::BROWSER_OPERA;
|
1055 |
+
return true;
|
1056 |
+
}
|
1057 |
+
return false;
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
/**
|
1061 |
+
* Determine if the browser is Chrome or not (last updated 1.7)
|
1062 |
+
*
|
1063 |
+
* @return boolean True if the browser is Chrome otherwise false
|
1064 |
+
*/
|
1065 |
+
protected function checkBrowserChrome() {
|
1066 |
+
if (stripos($this->_agent, 'Chrome') !== false) {
|
1067 |
+
$aresult = preg_split('/[\/;]+/', stristr($this->_agent, 'Chrome'));
|
1068 |
+
if (isset($aresult[1])) {
|
1069 |
+
$aversion = explode(' ', $aresult[1]);
|
1070 |
+
$this->setVersion($aversion[0]);
|
1071 |
+
$this->setBrowser(self::BROWSER_CHROME);
|
1072 |
+
//Chrome on Android
|
1073 |
+
if (stripos($this->_agent, 'Android') !== false) {
|
1074 |
+
if (stripos($this->_agent, 'Mobile') !== false) {
|
1075 |
+
$this->setMobile(true);
|
1076 |
+
} else {
|
1077 |
+
$this->setTablet(true);
|
1078 |
+
}
|
1079 |
+
}
|
1080 |
+
return true;
|
1081 |
+
}
|
1082 |
+
}
|
1083 |
+
return false;
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
|
1087 |
+
/**
|
1088 |
+
* Determine if the browser is WebTv or not (last updated 1.7)
|
1089 |
+
*
|
1090 |
+
* @return boolean True if the browser is WebTv otherwise false
|
1091 |
+
*/
|
1092 |
+
protected function checkBrowserWebTv() {
|
1093 |
+
if (stripos($this->_agent, 'webtv') !== false) {
|
1094 |
+
$aresult = explode('/', stristr($this->_agent, 'webtv'));
|
1095 |
+
if (isset($aresult[1])) {
|
1096 |
+
$aversion = explode(' ', $aresult[1]);
|
1097 |
+
$this->setVersion($aversion[0]);
|
1098 |
+
$this->setBrowser(self::BROWSER_WEBTV);
|
1099 |
+
return true;
|
1100 |
+
}
|
1101 |
+
}
|
1102 |
+
return false;
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
/**
|
1106 |
+
* Determine if the browser is NetPositive or not (last updated 1.7)
|
1107 |
+
*
|
1108 |
+
* @return boolean True if the browser is NetPositive otherwise false
|
1109 |
+
*/
|
1110 |
+
protected function checkBrowserNetPositive() {
|
1111 |
+
if (stripos($this->_agent, 'NetPositive') !== false) {
|
1112 |
+
$aresult = explode('/', stristr($this->_agent, 'NetPositive'));
|
1113 |
+
if (isset($aresult[1])) {
|
1114 |
+
$aversion = explode(' ', $aresult[1]);
|
1115 |
+
$this->setVersion(str_replace(array('(', ')', ';'), '', $aversion[0]));
|
1116 |
+
$this->setBrowser(self::BROWSER_NETPOSITIVE);
|
1117 |
+
return true;
|
1118 |
+
}
|
1119 |
+
}
|
1120 |
+
return false;
|
1121 |
+
}
|
1122 |
+
|
1123 |
+
/**
|
1124 |
+
* Determine if the browser is Galeon or not (last updated 1.7)
|
1125 |
+
*
|
1126 |
+
* @return boolean True if the browser is Galeon otherwise false
|
1127 |
+
*/
|
1128 |
+
protected function checkBrowserGaleon() {
|
1129 |
+
if (stripos($this->_agent, 'galeon') !== false) {
|
1130 |
+
$aresult = explode(' ', stristr($this->_agent, 'galeon'));
|
1131 |
+
$aversion = explode('/', $aresult[0]);
|
1132 |
+
if (isset($aversion[1])) {
|
1133 |
+
$this->setVersion($aversion[1]);
|
1134 |
+
$this->setBrowser(self::BROWSER_GALEON);
|
1135 |
+
return true;
|
1136 |
+
}
|
1137 |
+
}
|
1138 |
+
return false;
|
1139 |
+
}
|
1140 |
+
|
1141 |
+
/**
|
1142 |
+
* Determine if the browser is Konqueror or not (last updated 1.7)
|
1143 |
+
*
|
1144 |
+
* @return boolean True if the browser is Konqueror otherwise false
|
1145 |
+
*/
|
1146 |
+
protected function checkBrowserKonqueror() {
|
1147 |
+
if (stripos($this->_agent, 'Konqueror') !== false) {
|
1148 |
+
$aresult = explode(' ', stristr($this->_agent, 'Konqueror'));
|
1149 |
+
$aversion = explode('/', $aresult[0]);
|
1150 |
+
if (isset($aversion[1])) {
|
1151 |
+
$this->setVersion($aversion[1]);
|
1152 |
+
$this->setBrowser(self::BROWSER_KONQUEROR);
|
1153 |
+
return true;
|
1154 |
+
}
|
1155 |
+
}
|
1156 |
+
return false;
|
1157 |
+
}
|
1158 |
+
|
1159 |
+
/**
|
1160 |
+
* Determine if the browser is iCab or not (last updated 1.7)
|
1161 |
+
*
|
1162 |
+
* @return boolean True if the browser is iCab otherwise false
|
1163 |
+
*/
|
1164 |
+
protected function checkBrowserIcab() {
|
1165 |
+
if (stripos($this->_agent, 'icab') !== false) {
|
1166 |
+
$aversion = explode(' ', stristr(str_replace('/', ' ', $this->_agent), 'icab'));
|
1167 |
+
if (isset($aversion[1])) {
|
1168 |
+
$this->setVersion($aversion[1]);
|
1169 |
+
$this->setBrowser(self::BROWSER_ICAB);
|
1170 |
+
return true;
|
1171 |
+
}
|
1172 |
+
}
|
1173 |
+
return false;
|
1174 |
+
}
|
1175 |
+
|
1176 |
+
/**
|
1177 |
+
* Determine if the browser is OmniWeb or not (last updated 1.7)
|
1178 |
+
*
|
1179 |
+
* @return boolean True if the browser is OmniWeb otherwise false
|
1180 |
+
*/
|
1181 |
+
protected function checkBrowserOmniWeb() {
|
1182 |
+
if (stripos($this->_agent, 'omniweb') !== false) {
|
1183 |
+
$aresult = explode('/', stristr($this->_agent, 'omniweb'));
|
1184 |
+
$aversion = explode(' ', isset($aresult[1]) ? $aresult[1] : '');
|
1185 |
+
$this->setVersion($aversion[0]);
|
1186 |
+
$this->setBrowser(self::BROWSER_OMNIWEB);
|
1187 |
+
return true;
|
1188 |
+
}
|
1189 |
+
return false;
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
/**
|
1193 |
+
* Determine if the browser is Phoenix or not (last updated 1.7)
|
1194 |
+
*
|
1195 |
+
* @return boolean True if the browser is Phoenix otherwise false
|
1196 |
+
*/
|
1197 |
+
protected function checkBrowserPhoenix() {
|
1198 |
+
if (stripos($this->_agent, 'Phoenix') !== false) {
|
1199 |
+
$aversion = explode('/', stristr($this->_agent, 'Phoenix'));
|
1200 |
+
if (isset($aversion[1])) {
|
1201 |
+
$this->setVersion($aversion[1]);
|
1202 |
+
$this->setBrowser(self::BROWSER_PHOENIX);
|
1203 |
+
return true;
|
1204 |
+
}
|
1205 |
+
}
|
1206 |
+
return false;
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
/**
|
1210 |
+
* Determine if the browser is Firebird or not (last updated 1.7)
|
1211 |
+
*
|
1212 |
+
* @return boolean True if the browser is Firebird otherwise false
|
1213 |
+
*/
|
1214 |
+
protected function checkBrowserFirebird() {
|
1215 |
+
if (stripos($this->_agent, 'Firebird') !== false) {
|
1216 |
+
$aversion = explode('/', stristr($this->_agent, 'Firebird'));
|
1217 |
+
if (isset($aversion[1])) {
|
1218 |
+
$this->setVersion($aversion[1]);
|
1219 |
+
$this->setBrowser(self::BROWSER_FIREBIRD);
|
1220 |
+
return true;
|
1221 |
+
}
|
1222 |
+
}
|
1223 |
+
return false;
|
1224 |
+
}
|
1225 |
+
|
1226 |
+
/**
|
1227 |
+
* Determine if the browser is Netscape Navigator 9+ or not (last updated 1.7)
|
1228 |
+
* NOTE: (http://browser.netscape.com/ - Official support ended on March 1st, 2008)
|
1229 |
+
*
|
1230 |
+
* @return boolean True if the browser is Netscape Navigator 9+ otherwise false
|
1231 |
+
*/
|
1232 |
+
protected function checkBrowserNetscapeNavigator9Plus() {
|
1233 |
+
if (stripos($this->_agent, 'Firefox') !== false && preg_match('/Navigator\/([^ ]*)/i', $this->_agent, $matches)) {
|
1234 |
+
$this->setVersion($matches[1]);
|
1235 |
+
$this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
|
1236 |
+
return true;
|
1237 |
+
} elseif (stripos($this->_agent, 'Firefox') === false && preg_match('/Netscape6?\/([^ ]*)/i', $this->_agent, $matches)) {
|
1238 |
+
$this->setVersion($matches[1]);
|
1239 |
+
$this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
|
1240 |
+
return true;
|
1241 |
+
}
|
1242 |
+
return false;
|
1243 |
+
}
|
1244 |
+
|
1245 |
+
/**
|
1246 |
+
* Determine if the browser is Shiretoko or not (https://wiki.mozilla.org/Projects/shiretoko) (last updated 1.7)
|
1247 |
+
*
|
1248 |
+
* @return boolean True if the browser is Shiretoko otherwise false
|
1249 |
+
*/
|
1250 |
+
protected function checkBrowserShiretoko() {
|
1251 |
+
if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/Shiretoko\/([^ ]*)/i', $this->_agent, $matches)) {
|
1252 |
+
$this->setVersion($matches[1]);
|
1253 |
+
$this->setBrowser(self::BROWSER_SHIRETOKO);
|
1254 |
+
return true;
|
1255 |
+
}
|
1256 |
+
return false;
|
1257 |
+
}
|
1258 |
+
|
1259 |
+
/**
|
1260 |
+
* Determine if the browser is Ice Cat or not (http://en.wikipedia.org/wiki/GNU_IceCat) (last updated 1.7)
|
1261 |
+
*
|
1262 |
+
* @return boolean True if the browser is Ice Cat otherwise false
|
1263 |
+
*/
|
1264 |
+
protected function checkBrowserIceCat() {
|
1265 |
+
if (stripos($this->_agent, 'Mozilla') !== false && preg_match('/IceCat\/([^ ]*)/i', $this->_agent, $matches)) {
|
1266 |
+
$this->setVersion($matches[1]);
|
1267 |
+
$this->setBrowser(self::BROWSER_ICECAT);
|
1268 |
+
return true;
|
1269 |
+
}
|
1270 |
+
return false;
|
1271 |
+
}
|
1272 |
+
|
1273 |
+
/**
|
1274 |
+
* Determine if the browser is Nokia or not (last updated 1.7)
|
1275 |
+
*
|
1276 |
+
* @return boolean True if the browser is Nokia otherwise false
|
1277 |
+
*/
|
1278 |
+
protected function checkBrowserNokia() {
|
1279 |
+
if (preg_match('/Nokia([^\/]+)\/([^ SP]+)/i', $this->_agent, $matches)) {
|
1280 |
+
$this->setVersion($matches[2]);
|
1281 |
+
if (stripos($this->_agent, 'Series60') !== false || strpos($this->_agent, 'S60') !== false) {
|
1282 |
+
$this->setBrowser(self::BROWSER_NOKIA_S60);
|
1283 |
+
} else {
|
1284 |
+
$this->setBrowser(self::BROWSER_NOKIA);
|
1285 |
+
}
|
1286 |
+
$this->setMobile(true);
|
1287 |
+
return true;
|
1288 |
+
}
|
1289 |
+
return false;
|
1290 |
+
}
|
1291 |
+
|
1292 |
+
/**
|
1293 |
+
* Determine if the browser is Palemoon or not
|
1294 |
+
*
|
1295 |
+
* @return boolean True if the browser is Palemoon otherwise false
|
1296 |
+
*/
|
1297 |
+
protected function checkBrowserPalemoon() {
|
1298 |
+
if (stripos($this->_agent, 'safari') === false) {
|
1299 |
+
if (preg_match('/Palemoon[\/ \(]([^ ;\)]+)/i', $this->_agent, $matches)) {
|
1300 |
+
$this->setVersion($matches[1]);
|
1301 |
+
$this->setBrowser(self::BROWSER_PALEMOON);
|
1302 |
+
return true;
|
1303 |
+
} elseif (preg_match('/Palemoon([0-9a-zA-Z\.]+)/i', $this->_agent, $matches)) {
|
1304 |
+
$this->setVersion($matches[1]);
|
1305 |
+
$this->setBrowser(self::BROWSER_PALEMOON);
|
1306 |
+
return true;
|
1307 |
+
} elseif (preg_match('/Palemoon/i', $this->_agent, $matches)) {
|
1308 |
+
$this->setVersion('');
|
1309 |
+
$this->setBrowser(self::BROWSER_PALEMOON);
|
1310 |
+
return true;
|
1311 |
+
}
|
1312 |
+
}
|
1313 |
+
return false;
|
1314 |
+
}
|
1315 |
+
|
1316 |
+
/**
|
1317 |
+
* Determine if the browser is UCBrowser or not
|
1318 |
+
*
|
1319 |
+
* @return boolean True if the browser is UCBrowser otherwise false
|
1320 |
+
*/
|
1321 |
+
protected function checkBrowserUCBrowser() {
|
1322 |
+
if (preg_match('/UC ?Browser\/?([\d\.]+)/', $this->_agent, $matches)) {
|
1323 |
+
if (isset($matches[1])) {
|
1324 |
+
$this->setVersion($matches[1]);
|
1325 |
+
}
|
1326 |
+
if (stripos($this->_agent, 'Mobile') !== false) {
|
1327 |
+
$this->setMobile(true);
|
1328 |
+
} else {
|
1329 |
+
$this->setTablet(true);
|
1330 |
+
}
|
1331 |
+
$this->setBrowser(self::BROWSER_UCBROWSER);
|
1332 |
+
return true;
|
1333 |
+
}
|
1334 |
+
return false;
|
1335 |
+
}
|
1336 |
+
|
1337 |
+
/**
|
1338 |
+
* Determine if the browser is Firefox or not
|
1339 |
+
*
|
1340 |
+
* @return boolean True if the browser is Firefox otherwise false
|
1341 |
+
*/
|
1342 |
+
protected function checkBrowserFirefox() {
|
1343 |
+
if (stripos($this->_agent, 'safari') === false) {
|
1344 |
+
if (preg_match('/Firefox[\/ \(]([^ ;\)]+)/i', $this->_agent, $matches)) {
|
1345 |
+
$this->setVersion($matches[1]);
|
1346 |
+
$this->setBrowser(self::BROWSER_FIREFOX);
|
1347 |
+
//Firefox on Android
|
1348 |
+
if (stripos($this->_agent, 'Android') !== false || stripos($this->_agent, 'iPhone') !== false) {
|
1349 |
+
if (stripos($this->_agent, 'Mobile') !== false || stripos($this->_agent, 'Tablet') !== false) {
|
1350 |
+
$this->setMobile(true);
|
1351 |
+
} else {
|
1352 |
+
$this->setTablet(true);
|
1353 |
+
}
|
1354 |
+
}
|
1355 |
+
return true;
|
1356 |
+
} elseif (preg_match('/Firefox([0-9a-zA-Z\.]+)/i', $this->_agent, $matches)) {
|
1357 |
+
$this->setVersion($matches[1]);
|
1358 |
+
$this->setBrowser(self::BROWSER_FIREFOX);
|
1359 |
+
return true;
|
1360 |
+
} elseif (preg_match('/Firefox$/i', $this->_agent, $matches)) {
|
1361 |
+
$this->setVersion('');
|
1362 |
+
$this->setBrowser(self::BROWSER_FIREFOX);
|
1363 |
+
return true;
|
1364 |
+
}
|
1365 |
+
} elseif (preg_match('/FxiOS[\/ \(]([^ ;\)]+)/i', $this->_agent, $matches)) {
|
1366 |
+
$this->setVersion($matches[1]);
|
1367 |
+
$this->setBrowser(self::BROWSER_FIREFOX);
|
1368 |
+
//Firefox on Android
|
1369 |
+
if (stripos($this->_agent, 'Android') !== false || stripos($this->_agent, 'iPhone') !== false) {
|
1370 |
+
if (stripos($this->_agent, 'Mobile') !== false || stripos($this->_agent, 'Tablet') !== false) {
|
1371 |
+
$this->setMobile(true);
|
1372 |
+
} else {
|
1373 |
+
$this->setTablet(true);
|
1374 |
+
}
|
1375 |
+
}
|
1376 |
+
return true;
|
1377 |
+
}
|
1378 |
+
return false;
|
1379 |
+
}
|
1380 |
+
|
1381 |
+
/**
|
1382 |
+
* Determine if the browser is Firefox or not (last updated 1.7)
|
1383 |
+
*
|
1384 |
+
* @return boolean True if the browser is Firefox otherwise false
|
1385 |
+
*/
|
1386 |
+
protected function checkBrowserIceweasel() {
|
1387 |
+
if (stripos($this->_agent, 'Iceweasel') !== false) {
|
1388 |
+
$aresult = explode('/', stristr($this->_agent, 'Iceweasel'));
|
1389 |
+
if (isset($aresult[1])) {
|
1390 |
+
$aversion = explode(' ', $aresult[1]);
|
1391 |
+
$this->setVersion($aversion[0]);
|
1392 |
+
$this->setBrowser(self::BROWSER_ICEWEASEL);
|
1393 |
+
return true;
|
1394 |
+
}
|
1395 |
+
}
|
1396 |
+
return false;
|
1397 |
+
}
|
1398 |
+
|
1399 |
+
/**
|
1400 |
+
* Determine if the browser is Mozilla or not (last updated 1.7)
|
1401 |
+
*
|
1402 |
+
* @return boolean True if the browser is Mozilla otherwise false
|
1403 |
+
*/
|
1404 |
+
protected function checkBrowserMozilla() {
|
1405 |
+
if (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {
|
1406 |
+
$aversion = explode(' ', stristr($this->_agent, 'rv:'));
|
1407 |
+
preg_match('/rv:[0-9].[0-9][a-b]?/i', $this->_agent, $aversion);
|
1408 |
+
$this->setVersion(str_replace('rv:', '', $aversion[0]));
|
1409 |
+
$this->setBrowser(self::BROWSER_MOZILLA);
|
1410 |
+
return true;
|
1411 |
+
} elseif (stripos($this->_agent, 'mozilla') !== false && preg_match('/rv:[0-9]\.[0-9]/i', $this->_agent) && stripos($this->_agent, 'netscape') === false) {
|
1412 |
+
$aversion = explode('', stristr($this->_agent, 'rv:'));
|
1413 |
+
$this->setVersion(str_replace('rv:', '', $aversion[0]));
|
1414 |
+
$this->setBrowser(self::BROWSER_MOZILLA);
|
1415 |
+
return true;
|
1416 |
+
} elseif (stripos($this->_agent, 'mozilla') !== false && preg_match('/mozilla\/([^ ]*)/i', $this->_agent, $matches) && stripos($this->_agent, 'netscape') === false) {
|
1417 |
+
$this->setVersion($matches[1]);
|
1418 |
+
$this->setBrowser(self::BROWSER_MOZILLA);
|
1419 |
+
return true;
|
1420 |
+
}
|
1421 |
+
return false;
|
1422 |
+
}
|
1423 |
+
|
1424 |
+
/**
|
1425 |
+
* Determine if the browser is Lynx or not (last updated 1.7)
|
1426 |
+
*
|
1427 |
+
* @return boolean True if the browser is Lynx otherwise false
|
1428 |
+
*/
|
1429 |
+
protected function checkBrowserLynx() {
|
1430 |
+
if (stripos($this->_agent, 'lynx') !== false) {
|
1431 |
+
$aresult = explode('/', stristr($this->_agent, 'Lynx'));
|
1432 |
+
$aversion = explode(' ', ( isset($aresult[1]) ? $aresult[1] : '' ));
|
1433 |
+
$this->setVersion($aversion[0]);
|
1434 |
+
$this->setBrowser(self::BROWSER_LYNX);
|
1435 |
+
return true;
|
1436 |
+
}
|
1437 |
+
return false;
|
1438 |
+
}
|
1439 |
+
|
1440 |
+
/**
|
1441 |
+
* Determine if the browser is Amaya or not (last updated 1.7)
|
1442 |
+
*
|
1443 |
+
* @return boolean True if the browser is Amaya otherwise false
|
1444 |
+
*/
|
1445 |
+
protected function checkBrowserAmaya() {
|
1446 |
+
if (stripos($this->_agent, 'amaya') !== false) {
|
1447 |
+
$aresult = explode('/', stristr($this->_agent, 'Amaya'));
|
1448 |
+
if (isset($aresult[1])) {
|
1449 |
+
$aversion = explode(' ', $aresult[1]);
|
1450 |
+
$this->setVersion($aversion[0]);
|
1451 |
+
$this->setBrowser(self::BROWSER_AMAYA);
|
1452 |
+
return true;
|
1453 |
+
}
|
1454 |
+
}
|
1455 |
+
return false;
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
/**
|
1459 |
+
* Determine if the browser is Safari or not (last updated 1.7)
|
1460 |
+
*
|
1461 |
+
* @return boolean True if the browser is Safari otherwise false
|
1462 |
+
*/
|
1463 |
+
protected function checkBrowserSafari() {
|
1464 |
+
if (
|
1465 |
+
stripos($this->_agent, 'Safari') !== false
|
1466 |
+
&& stripos($this->_agent, 'iPhone') === false
|
1467 |
+
&& stripos($this->_agent, 'iPod') === false
|
1468 |
+
) {
|
1469 |
+
|
1470 |
+
$aresult = explode('/', stristr($this->_agent, 'Version'));
|
1471 |
+
if (isset($aresult[1])) {
|
1472 |
+
$aversion = explode(' ', $aresult[1]);
|
1473 |
+
$this->setVersion($aversion[0]);
|
1474 |
+
} else {
|
1475 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1476 |
+
}
|
1477 |
+
$this->setBrowser(self::BROWSER_SAFARI);
|
1478 |
+
return true;
|
1479 |
+
}
|
1480 |
+
return false;
|
1481 |
+
}
|
1482 |
+
|
1483 |
+
protected function checkBrowserSamsung() {
|
1484 |
+
if (stripos($this->_agent, 'SamsungBrowser') !== false) {
|
1485 |
+
|
1486 |
+
$aresult = explode('/', stristr($this->_agent, 'SamsungBrowser'));
|
1487 |
+
if (isset($aresult[1])) {
|
1488 |
+
$aversion = explode(' ', $aresult[1]);
|
1489 |
+
$this->setVersion($aversion[0]);
|
1490 |
+
} else {
|
1491 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1492 |
+
}
|
1493 |
+
$this->setBrowser(self::BROWSER_SAMSUNG);
|
1494 |
+
return true;
|
1495 |
+
}
|
1496 |
+
return false;
|
1497 |
+
}
|
1498 |
+
|
1499 |
+
protected function checkBrowserSilk() {
|
1500 |
+
if (stripos($this->_agent, 'Silk') !== false) {
|
1501 |
+
$aresult = explode('/', stristr($this->_agent, 'Silk'));
|
1502 |
+
if (isset($aresult[1])) {
|
1503 |
+
$aversion = explode(' ', $aresult[1]);
|
1504 |
+
$this->setVersion($aversion[0]);
|
1505 |
+
} else {
|
1506 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1507 |
+
}
|
1508 |
+
$this->setBrowser(self::BROWSER_SILK);
|
1509 |
+
return true;
|
1510 |
+
}
|
1511 |
+
return false;
|
1512 |
+
}
|
1513 |
+
|
1514 |
+
protected function checkBrowserIframely() {
|
1515 |
+
if (stripos($this->_agent, 'Iframely') !== false) {
|
1516 |
+
$aresult = explode('/', stristr($this->_agent, 'Iframely'));
|
1517 |
+
if (isset($aresult[1])) {
|
1518 |
+
$aversion = explode(' ', $aresult[1]);
|
1519 |
+
$this->setVersion($aversion[0]);
|
1520 |
+
} else {
|
1521 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1522 |
+
}
|
1523 |
+
$this->setBrowser(self::BROWSER_I_FRAME);
|
1524 |
+
return true;
|
1525 |
+
}
|
1526 |
+
return false;
|
1527 |
+
}
|
1528 |
+
|
1529 |
+
protected function checkBrowserCocoa() {
|
1530 |
+
if (stripos($this->_agent, 'CocoaRestClient') !== false) {
|
1531 |
+
$aresult = explode('/', stristr($this->_agent, 'CocoaRestClient'));
|
1532 |
+
if (isset($aresult[1])) {
|
1533 |
+
$aversion = explode(' ', $aresult[1]);
|
1534 |
+
$this->setVersion($aversion[0]);
|
1535 |
+
} else {
|
1536 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1537 |
+
}
|
1538 |
+
$this->setBrowser(self::BROWSER_COCOA);
|
1539 |
+
return true;
|
1540 |
+
}
|
1541 |
+
return false;
|
1542 |
+
}
|
1543 |
+
|
1544 |
+
/**
|
1545 |
+
* Detect if URL is loaded from FacebookExternalHit
|
1546 |
+
*
|
1547 |
+
* @return boolean True if it detects FacebookExternalHit otherwise false
|
1548 |
+
*/
|
1549 |
+
protected function checkFacebookExternalHit() {
|
1550 |
+
if (stristr($this->_agent, 'FacebookExternalHit')) {
|
1551 |
+
$this->setRobot(true);
|
1552 |
+
$this->setFacebook(true);
|
1553 |
+
return true;
|
1554 |
+
}
|
1555 |
+
return false;
|
1556 |
+
}
|
1557 |
+
|
1558 |
+
/**
|
1559 |
+
* Detect if URL is being loaded from internal Facebook browser
|
1560 |
+
*
|
1561 |
+
* @return boolean True if it detects internal Facebook browser otherwise false
|
1562 |
+
*/
|
1563 |
+
protected function checkForFacebookIos() {
|
1564 |
+
if (stristr($this->_agent, 'FBIOS')) {
|
1565 |
+
$this->setFacebook(true);
|
1566 |
+
return true;
|
1567 |
+
}
|
1568 |
+
return false;
|
1569 |
+
}
|
1570 |
+
|
1571 |
+
/**
|
1572 |
+
* Detect Version for the Safari browser on iOS devices
|
1573 |
+
*
|
1574 |
+
* @return boolean True if it detects the version correctly otherwise false
|
1575 |
+
*/
|
1576 |
+
protected function getSafariVersionOnIos() {
|
1577 |
+
$aresult = explode('/', stristr($this->_agent, 'Version'));
|
1578 |
+
if (isset($aresult[1])) {
|
1579 |
+
$aversion = explode(' ', $aresult[1]);
|
1580 |
+
$this->setVersion($aversion[0]);
|
1581 |
+
return true;
|
1582 |
+
}
|
1583 |
+
return false;
|
1584 |
+
}
|
1585 |
+
|
1586 |
+
/**
|
1587 |
+
* Detect Version for the Chrome browser on iOS devices
|
1588 |
+
*
|
1589 |
+
* @return boolean True if it detects the version correctly otherwise false
|
1590 |
+
*/
|
1591 |
+
protected function getChromeVersionOnIos() {
|
1592 |
+
$aresult = explode('/', stristr($this->_agent, 'CriOS'));
|
1593 |
+
if (isset($aresult[1])) {
|
1594 |
+
$aversion = explode(' ', $aresult[1]);
|
1595 |
+
$this->setVersion($aversion[0]);
|
1596 |
+
$this->setBrowser(self::BROWSER_CHROME);
|
1597 |
+
return true;
|
1598 |
+
}
|
1599 |
+
return false;
|
1600 |
+
}
|
1601 |
+
|
1602 |
+
/**
|
1603 |
+
* Determine if the browser is iPhone or not (last updated 1.7)
|
1604 |
+
*
|
1605 |
+
* @return boolean True if the browser is iPhone otherwise false
|
1606 |
+
*/
|
1607 |
+
protected function checkBrowseriPhone() {
|
1608 |
+
if (stripos($this->_agent, 'iPhone') !== false) {
|
1609 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1610 |
+
$this->setBrowser(self::BROWSER_IPHONE);
|
1611 |
+
$this->getSafariVersionOnIos();
|
1612 |
+
$this->getChromeVersionOnIos();
|
1613 |
+
$this->checkForFacebookIos();
|
1614 |
+
$this->setMobile(true);
|
1615 |
+
return true;
|
1616 |
+
}
|
1617 |
+
return false;
|
1618 |
+
}
|
1619 |
+
|
1620 |
+
/**
|
1621 |
+
* Determine if the browser is iPad or not (last updated 1.7)
|
1622 |
+
*
|
1623 |
+
* @return boolean True if the browser is iPad otherwise false
|
1624 |
+
*/
|
1625 |
+
protected function checkBrowseriPad() {
|
1626 |
+
if (stripos($this->_agent, 'iPad') !== false) {
|
1627 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1628 |
+
$this->setBrowser(self::BROWSER_IPAD);
|
1629 |
+
$this->getSafariVersionOnIos();
|
1630 |
+
$this->getChromeVersionOnIos();
|
1631 |
+
$this->checkForFacebookIos();
|
1632 |
+
$this->setTablet(true);
|
1633 |
+
return true;
|
1634 |
+
}
|
1635 |
+
return false;
|
1636 |
+
}
|
1637 |
+
|
1638 |
+
/**
|
1639 |
+
* Determine if the browser is iPod or not (last updated 1.7)
|
1640 |
+
*
|
1641 |
+
* @return boolean True if the browser is iPod otherwise false
|
1642 |
+
*/
|
1643 |
+
protected function checkBrowseriPod() {
|
1644 |
+
if (stripos($this->_agent, 'iPod') !== false) {
|
1645 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1646 |
+
$this->setBrowser(self::BROWSER_IPOD);
|
1647 |
+
$this->getSafariVersionOnIos();
|
1648 |
+
$this->getChromeVersionOnIos();
|
1649 |
+
$this->checkForFacebookIos();
|
1650 |
+
$this->setMobile(true);
|
1651 |
+
return true;
|
1652 |
+
}
|
1653 |
+
return false;
|
1654 |
+
}
|
1655 |
+
|
1656 |
+
/**
|
1657 |
+
* Determine if the browser is Android or not (last updated 1.7)
|
1658 |
+
*
|
1659 |
+
* @return boolean True if the browser is Android otherwise false
|
1660 |
+
*/
|
1661 |
+
protected function checkBrowserAndroid() {
|
1662 |
+
if (stripos($this->_agent, 'Android') !== false) {
|
1663 |
+
$aresult = explode(' ', stristr($this->_agent, 'Android'));
|
1664 |
+
if (isset($aresult[1])) {
|
1665 |
+
$aversion = explode(' ', $aresult[1]);
|
1666 |
+
$this->setVersion($aversion[0]);
|
1667 |
+
} else {
|
1668 |
+
$this->setVersion(self::VERSION_UNKNOWN);
|
1669 |
+
}
|
1670 |
+
if (stripos($this->_agent, 'Mobile') !== false) {
|
1671 |
+
$this->setMobile(true);
|
1672 |
+
} else {
|
1673 |
+
$this->setTablet(true);
|
1674 |
+
}
|
1675 |
+
$this->setBrowser(self::BROWSER_ANDROID);
|
1676 |
+
return true;
|
1677 |
+
}
|
1678 |
+
return false;
|
1679 |
+
}
|
1680 |
+
|
1681 |
+
/**
|
1682 |
+
* Determine if the browser is Vivaldi
|
1683 |
+
*
|
1684 |
+
* @return boolean True if the browser is Vivaldi otherwise false
|
1685 |
+
*/
|
1686 |
+
protected function checkBrowserVivaldi() {
|
1687 |
+
if (stripos($this->_agent, 'Vivaldi') !== false) {
|
1688 |
+
$aresult = explode('/', stristr($this->_agent, 'Vivaldi'));
|
1689 |
+
if (isset($aresult[1])) {
|
1690 |
+
$aversion = explode(' ', $aresult[1]);
|
1691 |
+
$this->setVersion($aversion[0]);
|
1692 |
+
$this->setBrowser(self::BROWSER_VIVALDI);
|
1693 |
+
return true;
|
1694 |
+
}
|
1695 |
+
}
|
1696 |
+
return false;
|
1697 |
+
}
|
1698 |
+
|
1699 |
+
/**
|
1700 |
+
* Determine if the browser is Yandex
|
1701 |
+
*
|
1702 |
+
* @return boolean True if the browser is Yandex otherwise false
|
1703 |
+
*/
|
1704 |
+
protected function checkBrowserYandex() {
|
1705 |
+
if (stripos($this->_agent, 'YaBrowser') !== false) {
|
1706 |
+
$aresult = explode('/', stristr($this->_agent, 'YaBrowser'));
|
1707 |
+
if (isset($aresult[1])) {
|
1708 |
+
$aversion = explode(' ', $aresult[1]);
|
1709 |
+
$this->setVersion($aversion[0]);
|
1710 |
+
$this->setBrowser(self::BROWSER_YANDEX);
|
1711 |
+
|
1712 |
+
if (stripos($this->_agent, 'iPad') !== false) {
|
1713 |
+
$this->setTablet(true);
|
1714 |
+
} elseif (stripos($this->_agent, 'Mobile') !== false) {
|
1715 |
+
$this->setMobile(true);
|
1716 |
+
} elseif (stripos($this->_agent, 'Android') !== false) {
|
1717 |
+
$this->setTablet(true);
|
1718 |
+
}
|
1719 |
+
|
1720 |
+
return true;
|
1721 |
+
}
|
1722 |
+
}
|
1723 |
+
|
1724 |
+
return false;
|
1725 |
+
}
|
1726 |
+
|
1727 |
+
/**
|
1728 |
+
* Determine if the browser is a PlayStation
|
1729 |
+
*
|
1730 |
+
* @return boolean True if the browser is PlayStation otherwise false
|
1731 |
+
*/
|
1732 |
+
protected function checkBrowserPlayStation() {
|
1733 |
+
if (stripos($this->_agent, 'PlayStation ') !== false) {
|
1734 |
+
$aresult = explode(' ', stristr($this->_agent, 'PlayStation '));
|
1735 |
+
$this->setBrowser(self::BROWSER_PLAYSTATION);
|
1736 |
+
if (isset($aresult[0])) {
|
1737 |
+
$aversion = explode(')', $aresult[2]);
|
1738 |
+
$this->setVersion($aversion[0]);
|
1739 |
+
if (stripos($this->_agent, 'Portable)') !== false || stripos($this->_agent, 'Vita') !== false) {
|
1740 |
+
$this->setMobile(true);
|
1741 |
+
}
|
1742 |
+
return true;
|
1743 |
+
}
|
1744 |
+
}
|
1745 |
+
return false;
|
1746 |
+
}
|
1747 |
+
|
1748 |
+
/**
|
1749 |
+
* Determine if the browser is Wget or not (last updated 1.7)
|
1750 |
+
*
|
1751 |
+
* @return boolean True if the browser is Wget otherwise false
|
1752 |
+
*/
|
1753 |
+
protected function checkBrowserWget() {
|
1754 |
+
if (preg_match('!^Wget/([^ ]+)!i', $this->_agent, $aresult)) {
|
1755 |
+
$this->setVersion($aresult[1]);
|
1756 |
+
$this->setBrowser(self::BROWSER_WGET);
|
1757 |
+
return true;
|
1758 |
+
}
|
1759 |
+
return false;
|
1760 |
+
}
|
1761 |
+
/**
|
1762 |
+
* Determine if the browser is cURL or not (last updated 1.7)
|
1763 |
+
*
|
1764 |
+
* @return boolean True if the browser is cURL otherwise false
|
1765 |
+
*/
|
1766 |
+
protected function checkBrowserCurl() {
|
1767 |
+
if (strpos($this->_agent, 'curl') === 0) {
|
1768 |
+
$aresult = explode('/', stristr($this->_agent, 'curl'));
|
1769 |
+
if (isset($aresult[1])) {
|
1770 |
+
$aversion = explode(' ', $aresult[1]);
|
1771 |
+
$this->setVersion($aversion[0]);
|
1772 |
+
$this->setBrowser(self::BROWSER_CURL);
|
1773 |
+
return true;
|
1774 |
+
}
|
1775 |
+
}
|
1776 |
+
return false;
|
1777 |
+
}
|
1778 |
+
|
1779 |
+
/**
|
1780 |
+
* Determine the user's platform (last updated 2.0)
|
1781 |
+
*/
|
1782 |
+
protected function checkPlatform() {
|
1783 |
+
if (stripos($this->_agent, 'windows') !== false) {
|
1784 |
+
$this->_platform = self::PLATFORM_WINDOWS;
|
1785 |
+
} elseif (stripos($this->_agent, 'iPad') !== false) {
|
1786 |
+
$this->_platform = self::PLATFORM_IPAD;
|
1787 |
+
} elseif (stripos($this->_agent, 'iPod') !== false) {
|
1788 |
+
$this->_platform = self::PLATFORM_IPOD;
|
1789 |
+
} elseif (stripos($this->_agent, 'iPhone') !== false) {
|
1790 |
+
$this->_platform = self::PLATFORM_IPHONE;
|
1791 |
+
} elseif (stripos($this->_agent, 'mac') !== false) {
|
1792 |
+
$this->_platform = self::PLATFORM_APPLE;
|
1793 |
+
} elseif (stripos($this->_agent, 'android') !== false) {
|
1794 |
+
$this->_platform = self::PLATFORM_ANDROID;
|
1795 |
+
} elseif (stripos($this->_agent, 'Silk') !== false) {
|
1796 |
+
$this->_platform = self::PLATFORM_FIRE_OS;
|
1797 |
+
} elseif (stripos($this->_agent, 'linux') !== false && stripos($this->_agent, 'SMART-TV') !== false) {
|
1798 |
+
$this->_platform = self::PLATFORM_LINUX . '/' . self::PLATFORM_SMART_TV;
|
1799 |
+
} elseif (stripos($this->_agent, 'linux') !== false) {
|
1800 |
+
$this->_platform = self::PLATFORM_LINUX;
|
1801 |
+
} elseif (stripos($this->_agent, 'Nokia') !== false) {
|
1802 |
+
$this->_platform = self::PLATFORM_NOKIA;
|
1803 |
+
} elseif (stripos($this->_agent, 'BlackBerry') !== false) {
|
1804 |
+
$this->_platform = self::PLATFORM_BLACKBERRY;
|
1805 |
+
} elseif (stripos($this->_agent, 'FreeBSD') !== false) {
|
1806 |
+
$this->_platform = self::PLATFORM_FREEBSD;
|
1807 |
+
} elseif (stripos($this->_agent, 'OpenBSD') !== false) {
|
1808 |
+
$this->_platform = self::PLATFORM_OPENBSD;
|
1809 |
+
} elseif (stripos($this->_agent, 'NetBSD') !== false) {
|
1810 |
+
$this->_platform = self::PLATFORM_NETBSD;
|
1811 |
+
} elseif (stripos($this->_agent, 'OpenSolaris') !== false) {
|
1812 |
+
$this->_platform = self::PLATFORM_OPENSOLARIS;
|
1813 |
+
} elseif (stripos($this->_agent, 'SunOS') !== false) {
|
1814 |
+
$this->_platform = self::PLATFORM_SUNOS;
|
1815 |
+
} elseif (stripos($this->_agent, 'OS\/2') !== false) {
|
1816 |
+
$this->_platform = self::PLATFORM_OS2;
|
1817 |
+
} elseif (stripos($this->_agent, 'BeOS') !== false) {
|
1818 |
+
$this->_platform = self::PLATFORM_BEOS;
|
1819 |
+
} elseif (stripos($this->_agent, 'win') !== false) {
|
1820 |
+
$this->_platform = self::PLATFORM_WINDOWS;
|
1821 |
+
} elseif (stripos($this->_agent, 'Playstation') !== false) {
|
1822 |
+
$this->_platform = self::PLATFORM_PLAYSTATION;
|
1823 |
+
} elseif (stripos($this->_agent, 'Roku') !== false) {
|
1824 |
+
$this->_platform = self::PLATFORM_ROKU;
|
1825 |
+
} elseif (stripos($this->_agent, 'iOS') !== false) {
|
1826 |
+
$this->_platform = self::PLATFORM_IPHONE . '/' . self::PLATFORM_IPAD;
|
1827 |
+
} elseif (stripos($this->_agent, 'tvOS') !== false) {
|
1828 |
+
$this->_platform = self::PLATFORM_APPLE_TV;
|
1829 |
+
} elseif (stripos($this->_agent, 'curl') !== false) {
|
1830 |
+
$this->_platform = self::PLATFORM_TERMINAL;
|
1831 |
+
} elseif (stripos($this->_agent, 'CrOS') !== false) {
|
1832 |
+
$this->_platform = self::PLATFORM_CHROME_OS;
|
1833 |
+
} elseif (stripos($this->_agent, 'okhttp') !== false) {
|
1834 |
+
$this->_platform = self::PLATFORM_JAVA_ANDROID;
|
1835 |
+
} elseif (stripos($this->_agent, 'PostmanRuntime') !== false) {
|
1836 |
+
$this->_platform = self::PLATFORM_POSTMAN;
|
1837 |
+
} elseif (stripos($this->_agent, 'Iframely') !== false) {
|
1838 |
+
$this->_platform = self::PLATFORM_I_FRAME;
|
1839 |
+
}
|
1840 |
+
}
|
1841 |
+
|
1842 |
+
/**
|
|
|
|
|
|
|
|
|
|
|
1843 |
* Method to get email client.
|
1844 |
*
|
1845 |
* @return string $email_client Email client name.
|
1852 |
|
1853 |
if ( preg_match( '# Thunderbird/([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1854 |
$email_client = 'Thunderbird';
|
1855 |
+
} elseif ( preg_match( '#Airmail ([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1856 |
$email_client = 'Airmail';
|
1857 |
+
} elseif ( preg_match( '# ANDROIDGMAILAPP#i', $this->_agent, $hit ) ) {
|
1858 |
$email_client = 'Gmail App (Android)';
|
1859 |
+
} elseif ( preg_match( '# GoogleImageProxy#i', $this->_agent, $hit ) ) {
|
1860 |
$email_client = 'Gmail';
|
1861 |
+
} elseif ( preg_match( '#(iPod|iPod touch).*OS ([0-9_]+)#i', $this->_agent, $hit ) ) {
|
1862 |
$email_client = 'iPod Touch';
|
1863 |
+
} elseif ( preg_match( '#(iPhone|iPad).*OS ([0-9_]+)#i', $this->_agent, $hit ) ) {
|
1864 |
$email_client = $hit[1];
|
1865 |
+
} elseif ( preg_match( '#(Android|BlackBerry|Windows Phone OS) ([0-9.]+)#i', $this->_agent, $hit ) ) {
|
1866 |
$email_client = $hit[1];
|
1867 |
+
} elseif ( preg_match( '#(Kindle Fire|Kindle|IEMobile)/([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1868 |
$email_client = $hit[1];
|
1869 |
+
} elseif ( preg_match( '#(Sparrow|Postbox|Eudora|Lotus-Notes|Shredder|PocoMail|Barca|BarcaPro)/([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1870 |
$email_client = str_replace( '-', ' ', $hit[1] );
|
1871 |
+
} elseif ( preg_match( '#Outlook-Express/7\.0 \(MSIE ([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1872 |
$email_client = 'Windows Live Mail';
|
1873 |
+
} elseif ( preg_match( '#Outlook-Express/6\.0#i', $this->_agent, $hit ) ) {
|
1874 |
$email_client = 'Outlook Express';
|
1875 |
+
} elseif ( preg_match( '#(MSAppHost)/([0-9.]+)#i', $this->_agent, $hit ) ) {
|
1876 |
$email_client = 'Windows Live Mail';
|
1877 |
+
} elseif ( preg_match( '# (Microsoft Outlook|MSOffice) ([0-9]+)#i', $this->_agent, $hit ) ) {
|
1878 |
$email_client = 'Microsoft Outlook';
|
1879 |
+
} elseif ( preg_match( '#(Chrome|Safari|Firefox|Opera)/([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1880 |
$email_client = 'Web Client (' . $hit[1] . ')';
|
1881 |
+
} elseif ( preg_match( '# Trident/.* rv:([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1882 |
$email_client = 'Web Client (Internet Explorer ' . (int) $hit[1] . ')';
|
1883 |
+
} elseif ( preg_match( '#MSIE ([0-9.]+).* Trident/#i', $this->_agent, $hit ) ) {
|
1884 |
$version = (int) $hit[1];
|
1885 |
if ( $version <= 7 ) {
|
1886 |
+
// most likly Outlook 2000-2003
|
1887 |
$email_client = 'Microsoft Outlook';
|
1888 |
} else {
|
1889 |
$email_client = 'Web Client (Internet Explorer ' . $version . ')';
|
1890 |
}
|
1891 |
+
} elseif ( preg_match( '# AppleWebKit/([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1892 |
if ( preg_match( '#Mac OS X 10_(\d+)#i', $this->_agent, $versionhit ) ) {
|
1893 |
$email_client = 'Apple Mail';
|
1894 |
} else {
|
1895 |
$email_client = 'Web Client (WebKit based)';
|
1896 |
}
|
1897 |
+
} elseif ( preg_match( '#Mozilla/([0-9a-z.]+)#i', $this->_agent, $hit ) ) {
|
1898 |
$email_client = 'Web Client (Mozilla based)';
|
1899 |
} else {
|
1900 |
+
$email_client = 'Web Client (' . $this->_agent . ')';
|
1901 |
}
|
1902 |
|
1903 |
return $email_client;
|
1904 |
}
|
1905 |
+
}
|
lite/includes/classes/class-es-cache.php
CHANGED
@@ -1,5 +1,13 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* @credit - Inspired by the WooCommerce Cache implementation.
|
4 |
*/
|
5 |
if ( ! class_exists( 'ES_Cache' ) ) {
|
@@ -10,24 +18,34 @@ if ( ! class_exists( 'ES_Cache' ) ) {
|
|
10 |
*/
|
11 |
class ES_Cache {
|
12 |
|
13 |
-
/**
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
/**
|
|
|
|
|
17 |
* @return mixed|void
|
|
|
18 |
*/
|
19 |
-
static function get_default_transient_expiration() {
|
20 |
return apply_filters( 'ig_es_cache_default_expiration', 10 );
|
21 |
}
|
22 |
|
23 |
/**
|
|
|
|
|
24 |
* @param $key
|
25 |
* @param $value
|
26 |
-
* @param bool
|
27 |
*
|
28 |
* @return bool
|
29 |
*/
|
30 |
-
static function set_transient( $key, $value, $expiration = false ) {
|
31 |
if ( ! self::$enabled ) {
|
32 |
return false;
|
33 |
}
|
@@ -39,13 +57,15 @@ if ( ! class_exists( 'ES_Cache' ) ) {
|
|
39 |
}
|
40 |
|
41 |
/**
|
|
|
|
|
42 |
* @param string $key
|
43 |
*
|
44 |
* @return bool|mixed
|
45 |
*
|
46 |
* @since 4.4.0
|
47 |
*/
|
48 |
-
static function get_transient( $key ) {
|
49 |
if ( ! self::$enabled ) {
|
50 |
return false;
|
51 |
}
|
@@ -54,11 +74,13 @@ if ( ! class_exists( 'ES_Cache' ) ) {
|
|
54 |
}
|
55 |
|
56 |
/**
|
|
|
|
|
57 |
* @param $key
|
58 |
*
|
59 |
* @since 4.4.0
|
60 |
*/
|
61 |
-
static function delete_transient( $key ) {
|
62 |
delete_transient( 'ig_es_cache_' . $key );
|
63 |
}
|
64 |
|
@@ -66,12 +88,12 @@ if ( ! class_exists( 'ES_Cache' ) ) {
|
|
66 |
* Only sets if key is not falsy
|
67 |
*
|
68 |
* @param string $key
|
69 |
-
* @param mixed
|
70 |
* @param string $group
|
71 |
*
|
72 |
* @since 4.4.0
|
73 |
*/
|
74 |
-
static function set( $key, $value, $group ) {
|
75 |
if ( ! $key ) {
|
76 |
return;
|
77 |
}
|
@@ -89,7 +111,7 @@ if ( ! class_exists( 'ES_Cache' ) ) {
|
|
89 |
*
|
90 |
* @since 4.4.0
|
91 |
*/
|
92 |
-
static function get( $key, $group ) {
|
93 |
if ( ! $key ) {
|
94 |
return false;
|
95 |
}
|
@@ -98,6 +120,8 @@ if ( ! class_exists( 'ES_Cache' ) ) {
|
|
98 |
}
|
99 |
|
100 |
/**
|
|
|
|
|
101 |
* @param string $key
|
102 |
* @param string $group
|
103 |
*
|
@@ -105,7 +129,7 @@ if ( ! class_exists( 'ES_Cache' ) ) {
|
|
105 |
*
|
106 |
* @since 4.4.0
|
107 |
*/
|
108 |
-
static function exists( $key, $group ) {
|
109 |
if ( ! $key ) {
|
110 |
return false;
|
111 |
}
|
@@ -124,7 +148,7 @@ if ( ! class_exists( 'ES_Cache' ) ) {
|
|
124 |
*
|
125 |
* @since 4.4.0
|
126 |
*/
|
127 |
-
static function delete( $key, $group ) {
|
128 |
if ( ! $key ) {
|
129 |
return;
|
130 |
}
|
1 |
<?php
|
2 |
+
|
3 |
+
// Exit if accessed directly
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit;
|
6 |
+
}
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Cache implementation of the plugin
|
10 |
+
*
|
11 |
* @credit - Inspired by the WooCommerce Cache implementation.
|
12 |
*/
|
13 |
if ( ! class_exists( 'ES_Cache' ) ) {
|
18 |
*/
|
19 |
class ES_Cache {
|
20 |
|
21 |
+
/**
|
22 |
+
* Cache enabled/disabled
|
23 |
+
*
|
24 |
+
* @var bool
|
25 |
+
*
|
26 |
+
*/
|
27 |
+
public static $enabled = true;
|
28 |
|
29 |
/**
|
30 |
+
* Get default transient expiration
|
31 |
+
*
|
32 |
* @return mixed|void
|
33 |
+
*
|
34 |
*/
|
35 |
+
public static function get_default_transient_expiration() {
|
36 |
return apply_filters( 'ig_es_cache_default_expiration', 10 );
|
37 |
}
|
38 |
|
39 |
/**
|
40 |
+
* Set the transient
|
41 |
+
*
|
42 |
* @param $key
|
43 |
* @param $value
|
44 |
+
* @param bool $expiration
|
45 |
*
|
46 |
* @return bool
|
47 |
*/
|
48 |
+
public static function set_transient( $key, $value, $expiration = false ) {
|
49 |
if ( ! self::$enabled ) {
|
50 |
return false;
|
51 |
}
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
+
* Get the transient
|
61 |
+
*
|
62 |
* @param string $key
|
63 |
*
|
64 |
* @return bool|mixed
|
65 |
*
|
66 |
* @since 4.4.0
|
67 |
*/
|
68 |
+
public static function get_transient( $key ) {
|
69 |
if ( ! self::$enabled ) {
|
70 |
return false;
|
71 |
}
|
74 |
}
|
75 |
|
76 |
/**
|
77 |
+
* Transient delete
|
78 |
+
*
|
79 |
* @param $key
|
80 |
*
|
81 |
* @since 4.4.0
|
82 |
*/
|
83 |
+
public static function delete_transient( $key ) {
|
84 |
delete_transient( 'ig_es_cache_' . $key );
|
85 |
}
|
86 |
|
88 |
* Only sets if key is not falsy
|
89 |
*
|
90 |
* @param string $key
|
91 |
+
* @param mixed $value
|
92 |
* @param string $group
|
93 |
*
|
94 |
* @since 4.4.0
|
95 |
*/
|
96 |
+
public static function set( $key, $value, $group ) {
|
97 |
if ( ! $key ) {
|
98 |
return;
|
99 |
}
|
111 |
*
|
112 |
* @since 4.4.0
|
113 |
*/
|
114 |
+
public static function get( $key, $group ) {
|
115 |
if ( ! $key ) {
|
116 |
return false;
|
117 |
}
|
120 |
}
|
121 |
|
122 |
/**
|
123 |
+
* Checks if key is found in the cache or not
|
124 |
+
*
|
125 |
* @param string $key
|
126 |
* @param string $group
|
127 |
*
|
129 |
*
|
130 |
* @since 4.4.0
|
131 |
*/
|
132 |
+
public static function exists( $key, $group ) {
|
133 |
if ( ! $key ) {
|
134 |
return false;
|
135 |
}
|
148 |
*
|
149 |
* @since 4.4.0
|
150 |
*/
|
151 |
+
public static function delete( $key, $group ) {
|
152 |
if ( ! $key ) {
|
153 |
return;
|
154 |
}
|
lite/includes/classes/class-es-campaigns-table.php
CHANGED
@@ -6,14 +6,15 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
}
|
7 |
|
8 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
9 |
-
require_once
|
10 |
}
|
11 |
|
12 |
class ES_Campaigns_Table extends WP_List_Table {
|
13 |
/**
|
|
|
|
|
14 |
* @since 4.2.1
|
15 |
* @var string
|
16 |
-
*
|
17 |
*/
|
18 |
public static $option_per_page = 'es_campaigns_per_page';
|
19 |
|
@@ -22,7 +23,6 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
22 |
*
|
23 |
* @since 4.3.4
|
24 |
* @var $db
|
25 |
-
*
|
26 |
*/
|
27 |
protected $db;
|
28 |
|
@@ -32,12 +32,14 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
32 |
* @since 4.0
|
33 |
*/
|
34 |
public function __construct() {
|
35 |
-
parent::__construct(
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
41 |
|
42 |
$this->db = new ES_DB_Campaigns();
|
43 |
|
@@ -56,7 +58,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
56 |
$args = array(
|
57 |
'label' => __( 'Number of campaigns per page', 'email-subscribers' ),
|
58 |
'default' => 20,
|
59 |
-
'option' => self::$option_per_page
|
60 |
);
|
61 |
|
62 |
add_screen_option( $option, $args );
|
@@ -76,7 +78,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
76 |
|
77 |
$child_campaign_ids = $this->db->get_campaigns_by_parent_id( $parent_campaign_id );
|
78 |
|
79 |
-
//Delete All Child Campaigns
|
80 |
$this->db->delete_campaigns( $child_campaign_ids );
|
81 |
}
|
82 |
}
|
@@ -99,41 +101,43 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
99 |
ES_Common::show_message( $message, 'success' );
|
100 |
}
|
101 |
?>
|
102 |
-
|
103 |
-
|
104 |
-
<a href="admin.php?page=es_notifications&action=new" class="ig-es-title-button px-2 py-2 mx-1"><?php
|
105 |
-
|
106 |
-
<?php
|
|
|
107 |
|
108 |
$icegram_plugin = 'icegram/icegram.php';
|
109 |
$active_plugins = $ig_es_tracker::get_active_plugins();
|
110 |
if ( in_array( $icegram_plugin, $active_plugins ) ) {
|
111 |
$redirect_url = admin_url( 'post-new.php?post_type=ig_campaign' );
|
112 |
?>
|
113 |
-
|
114 |
<?php } else { ?>
|
115 |
-
|
116 |
<?php } ?>
|
117 |
|
118 |
-
|
119 |
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
<?php
|
128 |
$this->prepare_items();
|
129 |
-
$this->display();
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
|
|
137 |
<?php
|
138 |
}
|
139 |
|
@@ -141,7 +145,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
141 |
$es_note_cat = ig_es_get_request_data( 'es_note_cat' );
|
142 |
|
143 |
if ( $es_note_cat ) {
|
144 |
-
echo '<div class="updated"><p>' .
|
145 |
}
|
146 |
}
|
147 |
|
@@ -155,7 +159,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
155 |
*/
|
156 |
public static function get_lists( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
157 |
|
158 |
-
global $wpdb;
|
159 |
|
160 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
161 |
$order = ig_es_get_request_data( 'order' );
|
@@ -164,51 +168,50 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
164 |
$filter_by_campaign_status = ig_es_get_request_data( 'filter_by_campaign_status' );
|
165 |
|
166 |
if ( $do_count_only ) {
|
167 |
-
$sql =
|
168 |
} else {
|
169 |
-
$sql =
|
170 |
}
|
171 |
|
172 |
-
$args =
|
|
|
173 |
$add_where_clause = true;
|
174 |
|
175 |
$query[] = "( deleted_at IS NULL OR deleted_at = '0000-00-00 00:00:00' )";
|
176 |
|
177 |
if ( ! empty( $search ) ) {
|
178 |
-
$query[] =
|
179 |
-
$args[] =
|
180 |
}
|
181 |
|
182 |
$query = apply_filters( 'ig_es_campaign_list_where_caluse', $query );
|
183 |
|
184 |
if ( $add_where_clause ) {
|
185 |
-
$sql .=
|
186 |
|
187 |
if ( count( $query ) > 0 ) {
|
188 |
-
$sql .= implode(
|
189 |
|
190 |
if ( count( $args ) > 0 ) {
|
191 |
-
$sql = $
|
192 |
}
|
193 |
}
|
194 |
}
|
195 |
|
196 |
if ( ! empty( $filter_by_campaign_status ) || ( '0' === $filter_by_campaign_status ) ) {
|
197 |
if ( $add_where_clause ) {
|
198 |
-
$sql .= $wpdb->prepare(
|
199 |
} else {
|
200 |
-
$sql .= $wpdb->prepare(
|
201 |
}
|
202 |
-
|
203 |
}
|
204 |
|
205 |
if ( ! empty( $filter_by_campaign_type ) ) {
|
206 |
if ( $add_where_clause ) {
|
207 |
-
$sql .= $wpdb->prepare(
|
208 |
} else {
|
209 |
-
$sql .= $wpdb->prepare(
|
210 |
}
|
211 |
-
|
212 |
}
|
213 |
|
214 |
if ( ! $do_count_only ) {
|
@@ -233,9 +236,9 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
233 |
$sql .= " LIMIT $per_page";
|
234 |
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
|
235 |
|
236 |
-
$result = $
|
237 |
} else {
|
238 |
-
$result = $
|
239 |
}
|
240 |
|
241 |
return $result;
|
@@ -247,7 +250,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
247 |
* @since 4.0
|
248 |
*/
|
249 |
public function no_items() {
|
250 |
-
|
251 |
}
|
252 |
|
253 |
/**
|
@@ -272,7 +275,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
272 |
|
273 |
// We are getting $status = 0 for "In Active".
|
274 |
// So, we can't check empty()
|
275 |
-
if (
|
276 |
return $statuses[ $status ];
|
277 |
}
|
278 |
|
@@ -282,7 +285,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
282 |
/**
|
283 |
* Render a column when no column specific method exist.
|
284 |
*
|
285 |
-
* @param array
|
286 |
* @param string $column_name
|
287 |
*
|
288 |
* @return mixed
|
@@ -302,7 +305,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
302 |
}
|
303 |
break;
|
304 |
case 'type':
|
305 |
-
$type = ( $item[ $column_name ]
|
306 |
$type = ucwords( str_replace( '_', ' ', $type ) );
|
307 |
|
308 |
return $type;
|
@@ -332,9 +335,10 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
332 |
*
|
333 |
* @return string
|
334 |
*/
|
335 |
-
function column_cb( $item ) {
|
336 |
return sprintf(
|
337 |
-
'<input type="checkbox" name="campaigns[]" value="%s" />',
|
|
|
338 |
);
|
339 |
}
|
340 |
|
@@ -345,7 +349,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
345 |
*
|
346 |
* @return string
|
347 |
*/
|
348 |
-
function column_name( $item ) {
|
349 |
global $wpdb;
|
350 |
|
351 |
$type = $item['type'];
|
@@ -356,7 +360,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
356 |
|
357 |
$report = ES_DB_Mailing_Queue::get_notification_by_campaign_id( $item['id'] );
|
358 |
|
359 |
-
if (
|
360 |
/*
|
361 |
if ( $template instanceof WP_Post ) {
|
362 |
$title = '<strong>' . $template->post_title . '</strong>';
|
@@ -367,8 +371,9 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
367 |
|
368 |
$title = ! empty( $item['name'] ) ? $item['name'] : '';
|
369 |
|
370 |
-
$slug
|
371 |
-
|
|
|
372 |
|
373 |
if ( in_array( $type, array( 'post_notification', 'post_digest' ) ) ) {
|
374 |
// Add reports link if there are any reports related to the post notification.
|
@@ -376,11 +381,9 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
376 |
|
377 |
$actions['report'] = sprintf( '<a href="?page=%s&campaign_id=%d" class="text-indigo-600">%s</a>', esc_attr( 'es_reports' ), esc_attr( $item['id'] ), __( 'Report', 'email-subscribers' ) );
|
378 |
}
|
379 |
-
|
380 |
} elseif ( 'sequence' === $type ) {
|
381 |
$actions['report'] = sprintf( '<a href="?page=%s&campaign_id=%d" class="text-indigo-600">%s</a>', esc_attr( 'es_reports' ), esc_attr( $item['id'] ), __( 'Report', 'email-subscribers' ) );
|
382 |
}
|
383 |
-
|
384 |
} else {
|
385 |
|
386 |
$title = $item['name'];
|
@@ -389,27 +392,29 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
389 |
|
390 |
$broadcast_allowed_edit_statuses = array(
|
391 |
IG_ES_CAMPAIGN_STATUS_IN_ACTIVE,
|
392 |
-
IG_ES_CAMPAIGN_STATUS_SCHEDULED
|
393 |
);
|
394 |
|
395 |
if ( in_array( $status, $broadcast_allowed_edit_statuses ) ) {
|
396 |
-
|
|
|
397 |
}
|
398 |
|
399 |
$broadcast_allowed_report_statuses = array(
|
400 |
IG_ES_CAMPAIGN_STATUS_SCHEDULED,
|
401 |
IG_ES_CAMPAIGN_STATUS_QUEUED,
|
402 |
IG_ES_CAMPAIGN_STATUS_ACTIVE,
|
403 |
-
IG_ES_CAMPAIGN_STATUS_FINISHED
|
404 |
);
|
405 |
|
406 |
if ( in_array( $status, $broadcast_allowed_report_statuses ) && ! empty( $report ) ) {
|
407 |
-
$es_nonce
|
|
|
408 |
$actions['report'] = sprintf( '<a href="?page=%s&action=%s&list=%s&_wpnonce=%s" class="text-indigo-600">%s</a>', esc_attr( 'es_reports' ), 'view', $report['hash'], $es_nonce, __( 'Report', 'email-subscribers' ) );
|
409 |
}
|
410 |
}
|
411 |
-
|
412 |
-
$actions['delete'] = sprintf( __( '<a href="?page=%s&action=%s&list=%s&_wpnonce=%s" onclick="return checkDelete()">Delete</a>', 'email-subscribers' ), esc_attr( 'es_campaigns' ), 'delete', absint( $item['id'] ), $nonce );
|
413 |
|
414 |
$title .= $this->row_actions( $actions );
|
415 |
|
@@ -423,12 +428,12 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
423 |
*
|
424 |
* @since 4.4.4
|
425 |
*/
|
426 |
-
function column_status( $item ) {
|
427 |
$campaign_id = ! empty( $item['id'] ) ? $item['id'] : 0;
|
428 |
$campaign_status = ! empty( $item['status'] ) ? (int) $item['status'] : 0;
|
429 |
$campaign_statuses = array(
|
430 |
IG_ES_CAMPAIGN_STATUS_ACTIVE,
|
431 |
-
IG_ES_CAMPAIGN_STATUS_IN_ACTIVE
|
432 |
);
|
433 |
|
434 |
$campaign_type = '';
|
@@ -438,14 +443,18 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
438 |
|
439 |
if ( 'newsletter' !== $campaign_type && in_array( $campaign_status, $campaign_statuses, true ) ) {
|
440 |
?>
|
441 |
-
|
442 |
<span class="relative">
|
443 |
-
<input id="<?php echo esc_attr( 'ig-es-campaign-status-toggle-' . $campaign_id ); ?>" type="checkbox" class="absolute es-check-toggle opacity-0 w-0 h-0" name="<?php echo esc_attr( 'ig-es-campaign-status-toggle-' . $campaign_id ); ?>" value="<?php echo esc_attr( $campaign_id ); ?>"
|
444 |
-
|
|
|
|
|
|
|
|
|
445 |
<span class="es-mail-toggle-line inline-block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
446 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline"></span>
|
447 |
</span>
|
448 |
-
|
449 |
<?php
|
450 |
} else {
|
451 |
switch ( $campaign_status ) {
|
@@ -456,24 +465,24 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
456 |
$notification_status = $notification['status'];
|
457 |
if ( 'In Queue' === $notification_status ) {
|
458 |
?>
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
<?php
|
464 |
} elseif ( 'Sending' === $notification_status ) {
|
465 |
?>
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
<?php
|
471 |
} else {
|
472 |
?>
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
<?php
|
478 |
}
|
479 |
}
|
@@ -481,47 +490,47 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
481 |
|
482 |
case IG_ES_CAMPAIGN_STATUS_IN_ACTIVE:
|
483 |
?>
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
<?php
|
489 |
break;
|
490 |
|
491 |
case IG_ES_CAMPAIGN_STATUS_SCHEDULED:
|
492 |
?>
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
<?php
|
498 |
break;
|
499 |
|
500 |
case IG_ES_CAMPAIGN_STATUS_QUEUED:
|
501 |
?>
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
<?php
|
508 |
break;
|
509 |
|
510 |
case IG_ES_CAMPAIGN_STATUS_PAUSED:
|
511 |
?>
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
<?php
|
517 |
break;
|
518 |
|
519 |
default:
|
520 |
?>
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
<?php
|
526 |
break;
|
527 |
}
|
@@ -535,7 +544,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
535 |
*
|
536 |
* @return array
|
537 |
*/
|
538 |
-
function get_columns() {
|
539 |
$columns = array(
|
540 |
'cb' => '<input type="checkbox" />',
|
541 |
'name' => __( 'Name', 'email-subscribers' ),
|
@@ -543,7 +552,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
543 |
'list_ids' => __( 'List(s)', 'email-subscribers' ),
|
544 |
'categories' => __( 'Categories', 'email-subscribers' ),
|
545 |
'created_at' => __( 'Created On', 'email-subscribers' ),
|
546 |
-
'status' => __( 'Status', 'email-subscribers' )
|
547 |
);
|
548 |
|
549 |
return $columns;
|
@@ -557,12 +566,12 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
557 |
*/
|
558 |
public function get_sortable_columns() {
|
559 |
$sortable_columns = array(
|
560 |
-
//'base_template_id' => array( 'base_template_id', true ),
|
561 |
-
//'list_ids' => array( 'list_ids', true ),
|
562 |
-
//'status' => array( 'status', true )
|
563 |
'name' => array( 'name', true ),
|
564 |
'type' => array( 'type', true ),
|
565 |
-
'created_at' => array( 'created_at', true )
|
566 |
);
|
567 |
|
568 |
return $sortable_columns;
|
@@ -575,7 +584,7 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
575 |
*/
|
576 |
public function get_bulk_actions() {
|
577 |
$actions = array(
|
578 |
-
'bulk_delete' => 'Delete'
|
579 |
);
|
580 |
|
581 |
return $actions;
|
@@ -590,25 +599,35 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
590 |
* @since 4.0.0
|
591 |
* @since 4.3.4 Added esc_attr()
|
592 |
*/
|
593 |
-
public function search_box( $text = '', $input_id = '' ) {
|
594 |
-
|
595 |
-
|
596 |
-
|
|
|
597 |
<?php submit_button( __( 'Search Campaigns', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
598 |
-
|
599 |
-
|
600 |
<?php $filter_by_status = ig_es_get_request_data( 'filter_by_campaign_status' ); ?>
|
601 |
-
|
602 |
-
<?php
|
603 |
-
|
604 |
-
|
605 |
-
|
|
|
|
|
|
|
|
|
|
|
606 |
<?php $filter_by_campaign_type = ig_es_get_request_data( 'filter_by_campaign_type' ); ?>
|
607 |
-
|
608 |
-
<?php
|
609 |
-
|
610 |
-
|
611 |
-
|
|
|
|
|
|
|
|
|
612 |
|
613 |
/**
|
614 |
* Handles data query and filter, sorting, and pagination.
|
@@ -617,7 +636,6 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
617 |
|
618 |
$this->_column_headers = $this->get_column_info();
|
619 |
|
620 |
-
|
621 |
/** Process bulk action */
|
622 |
$this->process_bulk_action();
|
623 |
|
@@ -629,14 +647,14 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
629 |
|
630 |
$current_page = $this->get_pagenum();
|
631 |
|
632 |
-
|
633 |
$total_items = $this->get_lists( 0, 0, true );
|
634 |
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
|
|
640 |
|
641 |
$this->items = $this->get_lists( $per_page, $current_page );
|
642 |
}
|
@@ -680,8 +698,6 @@ class ES_Campaigns_Table extends WP_List_Table {
|
|
680 |
$message = __( 'Please check campaign(s) to delete.', 'email-subscribers' );
|
681 |
ES_Common::show_message( $message, 'error' );
|
682 |
}
|
683 |
-
|
684 |
-
|
685 |
}
|
686 |
}
|
687 |
}
|
6 |
}
|
7 |
|
8 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
9 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
10 |
}
|
11 |
|
12 |
class ES_Campaigns_Table extends WP_List_Table {
|
13 |
/**
|
14 |
+
* Number of campaigns to be shown on the page
|
15 |
+
*
|
16 |
* @since 4.2.1
|
17 |
* @var string
|
|
|
18 |
*/
|
19 |
public static $option_per_page = 'es_campaigns_per_page';
|
20 |
|
23 |
*
|
24 |
* @since 4.3.4
|
25 |
* @var $db
|
|
|
26 |
*/
|
27 |
protected $db;
|
28 |
|
32 |
* @since 4.0
|
33 |
*/
|
34 |
public function __construct() {
|
35 |
+
parent::__construct(
|
36 |
+
array(
|
37 |
+
'singular' => __( 'Campaign', 'email-subscribers' ), // singular name of the listed records
|
38 |
+
'plural' => __( 'Campaign', 'email-subscribers' ), // plural name of the listed records
|
39 |
+
'ajax' => false, // does this table support ajax?
|
40 |
+
'screen' => 'es_campaigns',
|
41 |
+
)
|
42 |
+
);
|
43 |
|
44 |
$this->db = new ES_DB_Campaigns();
|
45 |
|
58 |
$args = array(
|
59 |
'label' => __( 'Number of campaigns per page', 'email-subscribers' ),
|
60 |
'default' => 20,
|
61 |
+
'option' => self::$option_per_page,
|
62 |
);
|
63 |
|
64 |
add_screen_option( $option, $args );
|
78 |
|
79 |
$child_campaign_ids = $this->db->get_campaigns_by_parent_id( $parent_campaign_id );
|
80 |
|
81 |
+
// Delete All Child Campaigns
|
82 |
$this->db->delete_campaigns( $child_campaign_ids );
|
83 |
}
|
84 |
}
|
101 |
ES_Common::show_message( $message, 'success' );
|
102 |
}
|
103 |
?>
|
104 |
+
<div class="wrap">
|
105 |
+
<h1 class="wp-heading-inline"><span class="text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate"><?php esc_html_e( 'Campaigns', 'email-subscribers' ); ?>
|
106 |
+
<a href="admin.php?page=es_notifications&action=new" class="ig-es-title-button px-2 py-2 mx-1"><?php esc_html_e( 'Create Post Notification', 'email-subscribers' ); ?></a></span>
|
107 |
+
<a href="admin.php?page=es_newsletters" class="ig-es-title-button px-2 py-2 mx-1"><?php esc_html_e( 'Send Broadcast', 'email-subscribers' ); ?></a>
|
108 |
+
<?php
|
109 |
+
do_action( 'ig_es_after_campaign_type_buttons' );
|
110 |
|
111 |
$icegram_plugin = 'icegram/icegram.php';
|
112 |
$active_plugins = $ig_es_tracker::get_active_plugins();
|
113 |
if ( in_array( $icegram_plugin, $active_plugins ) ) {
|
114 |
$redirect_url = admin_url( 'post-new.php?post_type=ig_campaign' );
|
115 |
?>
|
116 |
+
<a href="<?php echo esc_url( $redirect_url ); ?>" class="ig-es-link-button px-2 py-2 mx-1"><?php esc_html_e( 'Onsite Campaigns', 'email-subscribers' ); ?></a>
|
117 |
<?php } else { ?>
|
118 |
+
<a href="admin.php?page=go_to_icegram&action=create_campaign" class="ig-es-link-button px-2 py-2 mx-1"><?php esc_html_e( 'Onsite Campaigns', 'email-subscribers' ); ?></a>
|
119 |
<?php } ?>
|
120 |
|
121 |
+
<a href="edit.php?post_type=es_template" class="ig-es-imp-button px-2 py-2 mx-1"><?php esc_html_e( 'Manage Templates', 'email-subscribers' ); ?></a>
|
122 |
|
123 |
|
124 |
+
</h1>
|
125 |
+
<div id="poststuff" class="es-items-lists">
|
126 |
+
<div id="post-body" class="metabox-holder column-1">
|
127 |
+
<div id="post-body-content">
|
128 |
+
<div class="meta-box-sortables ui-sortable">
|
129 |
+
<form method="post">
|
130 |
<?php
|
131 |
$this->prepare_items();
|
132 |
+
$this->display();
|
133 |
+
?>
|
134 |
+
</form>
|
135 |
+
</div>
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
<br class="clear">
|
139 |
+
</div>
|
140 |
+
</div>
|
141 |
<?php
|
142 |
}
|
143 |
|
145 |
$es_note_cat = ig_es_get_request_data( 'es_note_cat' );
|
146 |
|
147 |
if ( $es_note_cat ) {
|
148 |
+
echo '<div class="updated"><p>' . esc_html__( 'Notification Added Successfully!', 'email-subscribers' ) . '</p></div>';
|
149 |
}
|
150 |
}
|
151 |
|
159 |
*/
|
160 |
public static function get_lists( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
161 |
|
162 |
+
global $wpdb, $wpbd;
|
163 |
|
164 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
165 |
$order = ig_es_get_request_data( 'order' );
|
168 |
$filter_by_campaign_status = ig_es_get_request_data( 'filter_by_campaign_status' );
|
169 |
|
170 |
if ( $do_count_only ) {
|
171 |
+
$sql = 'SELECT count(*) as total FROM ' . IG_CAMPAIGNS_TABLE;
|
172 |
} else {
|
173 |
+
$sql = 'SELECT * FROM ' . IG_CAMPAIGNS_TABLE;
|
174 |
}
|
175 |
|
176 |
+
$args = array();
|
177 |
+
$query = array();
|
178 |
$add_where_clause = true;
|
179 |
|
180 |
$query[] = "( deleted_at IS NULL OR deleted_at = '0000-00-00 00:00:00' )";
|
181 |
|
182 |
if ( ! empty( $search ) ) {
|
183 |
+
$query[] = ' name LIKE %s ';
|
184 |
+
$args[] = '%' . $wpdb->esc_like( $search ) . '%';
|
185 |
}
|
186 |
|
187 |
$query = apply_filters( 'ig_es_campaign_list_where_caluse', $query );
|
188 |
|
189 |
if ( $add_where_clause ) {
|
190 |
+
$sql .= ' WHERE ';
|
191 |
|
192 |
if ( count( $query ) > 0 ) {
|
193 |
+
$sql .= implode( ' AND ', $query );
|
194 |
|
195 |
if ( count( $args ) > 0 ) {
|
196 |
+
$sql = $wpbd->prepare( $sql, $args );
|
197 |
}
|
198 |
}
|
199 |
}
|
200 |
|
201 |
if ( ! empty( $filter_by_campaign_status ) || ( '0' === $filter_by_campaign_status ) ) {
|
202 |
if ( $add_where_clause ) {
|
203 |
+
$sql .= $wpdb->prepare( ' AND status = %s', $filter_by_campaign_status );
|
204 |
} else {
|
205 |
+
$sql .= $wpdb->prepare( ' WHERE status = %s', $filter_by_campaign_status );
|
206 |
}
|
|
|
207 |
}
|
208 |
|
209 |
if ( ! empty( $filter_by_campaign_type ) ) {
|
210 |
if ( $add_where_clause ) {
|
211 |
+
$sql .= $wpdb->prepare( ' AND type = %s', $filter_by_campaign_type );
|
212 |
} else {
|
213 |
+
$sql .= $wpdb->prepare( ' WHERE type = %s', $filter_by_campaign_type );
|
214 |
}
|
|
|
215 |
}
|
216 |
|
217 |
if ( ! $do_count_only ) {
|
236 |
$sql .= " LIMIT $per_page";
|
237 |
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
|
238 |
|
239 |
+
$result = $wpbd->get_results( $sql, 'ARRAY_A' );
|
240 |
} else {
|
241 |
+
$result = $wpbd->get_var( $sql );
|
242 |
}
|
243 |
|
244 |
return $result;
|
250 |
* @since 4.0
|
251 |
*/
|
252 |
public function no_items() {
|
253 |
+
esc_html_e( 'No Campaigns Found.', 'email-subscribers' );
|
254 |
}
|
255 |
|
256 |
/**
|
275 |
|
276 |
// We are getting $status = 0 for "In Active".
|
277 |
// So, we can't check empty()
|
278 |
+
if ( '' != $status ) {
|
279 |
return $statuses[ $status ];
|
280 |
}
|
281 |
|
285 |
/**
|
286 |
* Render a column when no column specific method exist.
|
287 |
*
|
288 |
+
* @param array $item
|
289 |
* @param string $column_name
|
290 |
*
|
291 |
* @return mixed
|
305 |
}
|
306 |
break;
|
307 |
case 'type':
|
308 |
+
$type = ( 'newsletter' === $item[ $column_name ] ) ? __( 'Broadcast', 'email-subscribers' ) : $item[ $column_name ];
|
309 |
$type = ucwords( str_replace( '_', ' ', $type ) );
|
310 |
|
311 |
return $type;
|
335 |
*
|
336 |
* @return string
|
337 |
*/
|
338 |
+
public function column_cb( $item ) {
|
339 |
return sprintf(
|
340 |
+
'<input type="checkbox" name="campaigns[]" value="%s" />',
|
341 |
+
$item['id']
|
342 |
);
|
343 |
}
|
344 |
|
349 |
*
|
350 |
* @return string
|
351 |
*/
|
352 |
+
public function column_name( $item ) {
|
353 |
global $wpdb;
|
354 |
|
355 |
$type = $item['type'];
|
360 |
|
361 |
$report = ES_DB_Mailing_Queue::get_notification_by_campaign_id( $item['id'] );
|
362 |
|
363 |
+
if ( 'newsletter' !== $type ) {
|
364 |
/*
|
365 |
if ( $template instanceof WP_Post ) {
|
366 |
$title = '<strong>' . $template->post_title . '</strong>';
|
371 |
|
372 |
$title = ! empty( $item['name'] ) ? $item['name'] : '';
|
373 |
|
374 |
+
$slug = ( in_array( $item['type'], array( 'post_notification', 'post_digest' ) ) ) ? esc_attr( 'es_notifications' ) : 'es_' . $item['type'];
|
375 |
+
/* translators: 1: Slug 2: Edit Action 3: List id 4. WP Nonce */
|
376 |
+
$actions ['edit'] = sprintf( __( '<a href="?page=%1$s&action=%2$s&list=%3$s&_wpnonce=%4$s" class="text-indigo-600">Edit</a>', 'email-subscribers' ), $slug, 'edit', absint( $item['id'] ), $nonce );
|
377 |
|
378 |
if ( in_array( $type, array( 'post_notification', 'post_digest' ) ) ) {
|
379 |
// Add reports link if there are any reports related to the post notification.
|
381 |
|
382 |
$actions['report'] = sprintf( '<a href="?page=%s&campaign_id=%d" class="text-indigo-600">%s</a>', esc_attr( 'es_reports' ), esc_attr( $item['id'] ), __( 'Report', 'email-subscribers' ) );
|
383 |
}
|
|
|
384 |
} elseif ( 'sequence' === $type ) {
|
385 |
$actions['report'] = sprintf( '<a href="?page=%s&campaign_id=%d" class="text-indigo-600">%s</a>', esc_attr( 'es_reports' ), esc_attr( $item['id'] ), __( 'Report', 'email-subscribers' ) );
|
386 |
}
|
|
|
387 |
} else {
|
388 |
|
389 |
$title = $item['name'];
|
392 |
|
393 |
$broadcast_allowed_edit_statuses = array(
|
394 |
IG_ES_CAMPAIGN_STATUS_IN_ACTIVE,
|
395 |
+
IG_ES_CAMPAIGN_STATUS_SCHEDULED,
|
396 |
);
|
397 |
|
398 |
if ( in_array( $status, $broadcast_allowed_edit_statuses ) ) {
|
399 |
+
/* translators: 1: Slug 2: Edit Action 3: List id 4. WP Nonce */
|
400 |
+
$actions ['edit'] = sprintf( __( '<a href="?page=%1$s&action=%2$s&list=%3$s&_wpnonce=%4$s" class="text-indigo-600">Edit</a>', 'email-subscribers' ), $slug, 'edit', absint( $item['id'] ), $nonce );
|
401 |
}
|
402 |
|
403 |
$broadcast_allowed_report_statuses = array(
|
404 |
IG_ES_CAMPAIGN_STATUS_SCHEDULED,
|
405 |
IG_ES_CAMPAIGN_STATUS_QUEUED,
|
406 |
IG_ES_CAMPAIGN_STATUS_ACTIVE,
|
407 |
+
IG_ES_CAMPAIGN_STATUS_FINISHED,
|
408 |
);
|
409 |
|
410 |
if ( in_array( $status, $broadcast_allowed_report_statuses ) && ! empty( $report ) ) {
|
411 |
+
$es_nonce = wp_create_nonce( 'es_notification' );
|
412 |
+
/* translators: 1: Slug 2: View Action 3: Hash 4. WP Nonce */
|
413 |
$actions['report'] = sprintf( '<a href="?page=%s&action=%s&list=%s&_wpnonce=%s" class="text-indigo-600">%s</a>', esc_attr( 'es_reports' ), 'view', $report['hash'], $es_nonce, __( 'Report', 'email-subscribers' ) );
|
414 |
}
|
415 |
}
|
416 |
+
/* translators: 1: Slug 2: Delete Action 3: ID 4. WP Nonce */
|
417 |
+
$actions['delete'] = sprintf( __( '<a href="?page=%1$s&action=%2$s&list=%3$s&_wpnonce=%4$s" onclick="return checkDelete()">Delete</a>', 'email-subscribers' ), esc_attr( 'es_campaigns' ), 'delete', absint( $item['id'] ), $nonce );
|
418 |
|
419 |
$title .= $this->row_actions( $actions );
|
420 |
|
428 |
*
|
429 |
* @since 4.4.4
|
430 |
*/
|
431 |
+
public function column_status( $item ) {
|
432 |
$campaign_id = ! empty( $item['id'] ) ? $item['id'] : 0;
|
433 |
$campaign_status = ! empty( $item['status'] ) ? (int) $item['status'] : 0;
|
434 |
$campaign_statuses = array(
|
435 |
IG_ES_CAMPAIGN_STATUS_ACTIVE,
|
436 |
+
IG_ES_CAMPAIGN_STATUS_IN_ACTIVE,
|
437 |
);
|
438 |
|
439 |
$campaign_type = '';
|
443 |
|
444 |
if ( 'newsletter' !== $campaign_type && in_array( $campaign_status, $campaign_statuses, true ) ) {
|
445 |
?>
|
446 |
+
<label for="<?php echo esc_attr( 'ig-es-campaign-status-toggle-' . $campaign_id ); ?>" class="ig-es-campaign-status-toggle-label inline-flex items-center cursor-pointer">
|
447 |
<span class="relative">
|
448 |
+
<input id="<?php echo esc_attr( 'ig-es-campaign-status-toggle-' . $campaign_id ); ?>" type="checkbox" class="absolute es-check-toggle opacity-0 w-0 h-0" name="<?php echo esc_attr( 'ig-es-campaign-status-toggle-' . $campaign_id ); ?>" value="<?php echo esc_attr( $campaign_id ); ?>"
|
449 |
+
<?php
|
450 |
+
checked( IG_ES_CAMPAIGN_STATUS_ACTIVE,
|
451 |
+
$campaign_status );
|
452 |
+
?>
|
453 |
+
>
|
454 |
<span class="es-mail-toggle-line inline-block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
455 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline"></span>
|
456 |
</span>
|
457 |
+
</label>
|
458 |
<?php
|
459 |
} else {
|
460 |
switch ( $campaign_status ) {
|
465 |
$notification_status = $notification['status'];
|
466 |
if ( 'In Queue' === $notification_status ) {
|
467 |
?>
|
468 |
+
<svg class="flex-shrink-0 ml-2 h-6 w-6 text-orange-400" fill="currentColor" viewBox="0 0 20 20">
|
469 |
+
<title><?php echo esc_html__( 'Scheduled', 'email-subscribers' ); ?></title>
|
470 |
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z" clip-rule="evenodd"/>
|
471 |
+
</svg>
|
472 |
<?php
|
473 |
} elseif ( 'Sending' === $notification_status ) {
|
474 |
?>
|
475 |
+
<svg class="flex-shrink-0 ml-2 h-6 w-6 text-yellow-400" fill="currentColor" viewBox="0 0 20 20">
|
476 |
+
<title><?php echo esc_html__( 'Sending', 'email-subscribers' ); ?></title>
|
477 |
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-8.707l-3-3a1 1 0 00-1.414 1.414L10.586 9H7a1 1 0 100 2h3.586l-1.293 1.293a1 1 0 101.414 1.414l3-3a1 1 0 000-1.414z" clip-rule="evenodd"/>
|
478 |
+
</svg>
|
479 |
<?php
|
480 |
} else {
|
481 |
?>
|
482 |
+
<svg class="flex-shrink-0 ml-2 h-6 w-6 text-green-400" fill="currentColor" viewBox="0 0 20 20">
|
483 |
+
<title><?php echo esc_html__( 'Sent', 'email-subscribers' ); ?></title>
|
484 |
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
|
485 |
+
</svg>
|
486 |
<?php
|
487 |
}
|
488 |
}
|
490 |
|
491 |
case IG_ES_CAMPAIGN_STATUS_IN_ACTIVE:
|
492 |
?>
|
493 |
+
<svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="ml-2 h-6 w-6 text-indigo-600">
|
494 |
+
<title><?php echo esc_html__( 'Draft', 'email-subscribers' ); ?></title>
|
495 |
+
<path d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
|
496 |
+
</svg>
|
497 |
<?php
|
498 |
break;
|
499 |
|
500 |
case IG_ES_CAMPAIGN_STATUS_SCHEDULED:
|
501 |
?>
|
502 |
+
<svg class="flex-shrink-0 ml-2 h-6 w-6 text-orange-400" fill="currentColor" viewBox="0 0 20 20">
|
503 |
+
<title><?php echo esc_html__( 'Scheduled', 'email-subscribers' ); ?></title>
|
504 |
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z" clip-rule="evenodd"/>
|
505 |
+
</svg>
|
506 |
<?php
|
507 |
break;
|
508 |
|
509 |
case IG_ES_CAMPAIGN_STATUS_QUEUED:
|
510 |
?>
|
511 |
+
<svg class="flex-shrink-0 ml-2 h-6 w-6 text-yellow-400" fill="currentColor" viewBox="0 0 20 20">
|
512 |
+
<title><?php echo esc_html__( 'Sending', 'email-subscribers' ); ?></title>
|
513 |
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-8.707l-3-3a1 1 0 00-1.414 1.414L10.586 9H7a1 1 0 100 2h3.586l-1.293 1.293a1 1 0 101.414 1.414l3-3a1 1 0 000-1.414z" clip-rule="evenodd"/>
|
514 |
+
</svg>
|
515 |
+
</svg>
|
516 |
<?php
|
517 |
break;
|
518 |
|
519 |
case IG_ES_CAMPAIGN_STATUS_PAUSED:
|
520 |
?>
|
521 |
+
<svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="ml-2 h-6 w-6 text-blue-400">
|
522 |
+
<title><?php echo esc_html__( 'Paused', 'email-subscribers' ); ?></title>
|
523 |
+
<path d="M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
524 |
+
</svg>
|
525 |
<?php
|
526 |
break;
|
527 |
|
528 |
default:
|
529 |
?>
|
530 |
+
<svg class="flex-shrink-0 ml-2 h-6 w-6 text-green-400" fill="currentColor" viewBox="0 0 20 20">
|
531 |
+
<title><?php echo esc_html__( 'Sent', 'email-subscribers' ); ?></title>
|
532 |
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
|
533 |
+
</svg>
|
534 |
<?php
|
535 |
break;
|
536 |
}
|
544 |
*
|
545 |
* @return array
|
546 |
*/
|
547 |
+
public function get_columns() {
|
548 |
$columns = array(
|
549 |
'cb' => '<input type="checkbox" />',
|
550 |
'name' => __( 'Name', 'email-subscribers' ),
|
552 |
'list_ids' => __( 'List(s)', 'email-subscribers' ),
|
553 |
'categories' => __( 'Categories', 'email-subscribers' ),
|
554 |
'created_at' => __( 'Created On', 'email-subscribers' ),
|
555 |
+
'status' => __( 'Status', 'email-subscribers' ),
|
556 |
);
|
557 |
|
558 |
return $columns;
|
566 |
*/
|
567 |
public function get_sortable_columns() {
|
568 |
$sortable_columns = array(
|
569 |
+
// 'base_template_id' => array( 'base_template_id', true ),
|
570 |
+
// 'list_ids' => array( 'list_ids', true ),
|
571 |
+
// 'status' => array( 'status', true )
|
572 |
'name' => array( 'name', true ),
|
573 |
'type' => array( 'type', true ),
|
574 |
+
'created_at' => array( 'created_at', true ),
|
575 |
);
|
576 |
|
577 |
return $sortable_columns;
|
584 |
*/
|
585 |
public function get_bulk_actions() {
|
586 |
$actions = array(
|
587 |
+
'bulk_delete' => 'Delete',
|
588 |
);
|
589 |
|
590 |
return $actions;
|
599 |
* @since 4.0.0
|
600 |
* @since 4.3.4 Added esc_attr()
|
601 |
*/
|
602 |
+
public function search_box( $text = '', $input_id = '' ) {
|
603 |
+
?>
|
604 |
+
<p class="search-box">
|
605 |
+
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $text ); ?>:</label>
|
606 |
+
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>"/>
|
607 |
<?php submit_button( __( 'Search Campaigns', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
608 |
+
</p>
|
609 |
+
<p class="search-box search-group-box box-ma10">
|
610 |
<?php $filter_by_status = ig_es_get_request_data( 'filter_by_campaign_status' ); ?>
|
611 |
+
<select name="filter_by_campaign_status" id="ig_es_filter_campaign_status_by_type">
|
612 |
+
<?php
|
613 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
614 |
+
add_filter( 'safe_style_css', 'ig_es_allowed_css_style' );
|
615 |
+
$campaign_types = ES_Common::prepare_campaign_statuses_dropdown_options( $filter_by_status, __( 'All Statuses', 'email-subscribers' ) );
|
616 |
+
echo wp_kses( $campaign_types , $allowedtags );
|
617 |
+
?>
|
618 |
+
</select>
|
619 |
+
</p>
|
620 |
+
<p class="search-box search-group-box box-ma10">
|
621 |
<?php $filter_by_campaign_type = ig_es_get_request_data( 'filter_by_campaign_type' ); ?>
|
622 |
+
<select name="filter_by_campaign_type" id="ig_es_filter_campaign_type">
|
623 |
+
<?php
|
624 |
+
$campaign_statuses = ES_Common::prepare_campaign_type_dropdown_options( $filter_by_campaign_type, __( 'All Type', 'email-subscribers' ) );
|
625 |
+
echo wp_kses( $campaign_statuses , $allowedtags );
|
626 |
+
?>
|
627 |
+
</select>
|
628 |
+
</p>
|
629 |
+
<?php
|
630 |
+
}
|
631 |
|
632 |
/**
|
633 |
* Handles data query and filter, sorting, and pagination.
|
636 |
|
637 |
$this->_column_headers = $this->get_column_info();
|
638 |
|
|
|
639 |
/** Process bulk action */
|
640 |
$this->process_bulk_action();
|
641 |
|
647 |
|
648 |
$current_page = $this->get_pagenum();
|
649 |
|
|
|
650 |
$total_items = $this->get_lists( 0, 0, true );
|
651 |
|
652 |
+
$this->set_pagination_args(
|
653 |
+
array(
|
654 |
+
'total_items' => $total_items, // We have to calculate the total number of items
|
655 |
+
'per_page' => $per_page, // We have to determine how many items to show on a page
|
656 |
+
)
|
657 |
+
);
|
658 |
|
659 |
$this->items = $this->get_lists( $per_page, $current_page );
|
660 |
}
|
698 |
$message = __( 'Please check campaign(s) to delete.', 'email-subscribers' );
|
699 |
ES_Common::show_message( $message, 'error' );
|
700 |
}
|
|
|
|
|
701 |
}
|
702 |
}
|
703 |
}
|
lite/includes/classes/class-es-compatibility.php
CHANGED
@@ -48,4 +48,4 @@ if ( ! class_exists( 'ES_Compatibility' ) ) {
|
|
48 |
return $body;
|
49 |
}
|
50 |
}
|
51 |
-
}
|
48 |
return $body;
|
49 |
}
|
50 |
}
|
51 |
+
}
|
lite/includes/classes/class-es-contacts-table.php
CHANGED
@@ -6,10 +6,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
}
|
7 |
|
8 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
9 |
-
require_once
|
10 |
}
|
11 |
class ES_Contacts_Table extends WP_List_Table {
|
12 |
/**
|
|
|
|
|
13 |
* @since 4.0.0
|
14 |
* @var array
|
15 |
*
|
@@ -17,13 +19,18 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
17 |
public $contact_lists_statuses = array();
|
18 |
|
19 |
/**
|
|
|
|
|
20 |
* @since 4.2.1
|
21 |
*
|
22 |
* @var string
|
|
|
23 |
*/
|
24 |
public static $option_per_page = 'es_contacts_per_page';
|
25 |
|
26 |
/**
|
|
|
|
|
27 |
* @since 4.0.0
|
28 |
* @var array
|
29 |
*
|
@@ -31,6 +38,8 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
31 |
public $list_ids = array();
|
32 |
|
33 |
/**
|
|
|
|
|
34 |
* @since 4.0.0
|
35 |
* @var array
|
36 |
*
|
@@ -38,6 +47,8 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
38 |
public $lists_id_name_map = array();
|
39 |
|
40 |
/**
|
|
|
|
|
41 |
* @var object|ES_DB_Contacts
|
42 |
*/
|
43 |
public $db;
|
@@ -49,12 +60,14 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
49 |
*/
|
50 |
public function __construct() {
|
51 |
|
52 |
-
parent::__construct(
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
58 |
|
59 |
$this->db = new ES_DB_Contacts();
|
60 |
|
@@ -81,7 +94,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
81 |
$args = array(
|
82 |
'label' => __( 'Number of contacts per page', 'email-subscribers' ),
|
83 |
'default' => 100,
|
84 |
-
'option' => self::$option_per_page
|
85 |
);
|
86 |
|
87 |
add_screen_option( $option, $args );
|
@@ -90,8 +103,10 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
90 |
}
|
91 |
|
92 |
/**
|
|
|
|
|
93 |
* @param $active_tab
|
94 |
-
* @param array
|
95 |
*
|
96 |
* @return array
|
97 |
*
|
@@ -100,40 +115,40 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
100 |
public function get_audience_main_tabs( $active_tab, $audience_main_tabs = array() ) {
|
101 |
|
102 |
$audience_tab_main_navigation = array(
|
103 |
-
'new_contact'
|
104 |
'label' => __( 'Add New Contact', 'email-subscribers' ),
|
105 |
'indicator_option' => '',
|
106 |
'indicator_label' => '',
|
107 |
'indicator_type' => '',
|
108 |
'action' => 'new',
|
109 |
-
'url' => add_query_arg( 'action', 'new', 'admin.php?page=es_subscribers' )
|
110 |
),
|
111 |
|
112 |
-
'import'
|
113 |
'label' => __( 'Import Contacts', 'email-subscribers' ),
|
114 |
'indicator_option' => '',
|
115 |
'indicator_label' => '',
|
116 |
'indicator_type' => '',
|
117 |
'action' => 'import',
|
118 |
-
'url' => add_query_arg( 'action', 'import', 'admin.php?page=es_subscribers' )
|
119 |
),
|
120 |
|
121 |
-
'export'
|
122 |
'label' => __( 'Export Contacts', 'email-subscribers' ),
|
123 |
'indicator_option' => '',
|
124 |
'indicator_label' => '',
|
125 |
'indicator_type' => '',
|
126 |
'action' => 'export',
|
127 |
-
'url' => add_query_arg( 'action', 'export', 'admin.php?page=es_subscribers' )
|
128 |
),
|
129 |
|
130 |
-
'sync'
|
131 |
'label' => __( 'Sync', 'email-subscribers' ),
|
132 |
'indicator_option' => 'ig_es_show_sync_tab',
|
133 |
'indicator_label' => __( 'New', 'email-subscribers' ),
|
134 |
'indicator_type' => 'new',
|
135 |
'action' => 'sync',
|
136 |
-
'url' => add_query_arg( 'action', 'sync', 'admin.php?page=es_subscribers' )
|
137 |
),
|
138 |
|
139 |
'manage_lists' => array(
|
@@ -143,8 +158,8 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
143 |
'indicator_type' => '',
|
144 |
'action' => 'manage-lists',
|
145 |
'is_imp' => true,
|
146 |
-
'url' => add_query_arg( 'action', 'manage-lists', 'admin.php?page=es_lists' )
|
147 |
-
)
|
148 |
);
|
149 |
|
150 |
$audience_main_tabs = $audience_main_tabs + $audience_tab_main_navigation;
|
@@ -177,31 +192,35 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
177 |
$contact_id = absint( ig_es_get_request_data( 'subscriber' ) );
|
178 |
$this->save_contact( $contact_id );
|
179 |
} elseif ( 'sync' === $action ) {
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
|
189 |
-
|
190 |
|
191 |
<h2 class="wp-heading-inline">
|
192 |
-
<span class="text-base font-normal text-indigo-600 sm:leading-7 sm:truncate"
|
193 |
-
|
|
|
|
|
|
|
194 |
</span>
|
195 |
<span class="text-2xl font-medium text-gray-900 sm:leading-9 sm:truncate">
|
196 |
-
|
197 |
-
|
|
|
198 |
</span>
|
199 |
-
|
200 |
-
|
|
|
201 |
</h2>
|
202 |
|
203 |
<div class="my-4">
|
204 |
-
|
205 |
</div>
|
206 |
|
207 |
<div id="poststuff" class="es-audience-view es-items-lists">
|
@@ -220,8 +239,9 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
220 |
<br class="clear">
|
221 |
</div>
|
222 |
</div>
|
223 |
-
<?php
|
224 |
-
}
|
|
|
225 |
|
226 |
/**
|
227 |
* Load Export Feature
|
@@ -268,42 +288,42 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
268 |
<table class="min-w-full overflow-hidden bg-white border-t border-b sm:border-l sm:border-r sm:rounded shadow font-sans">
|
269 |
<tr>
|
270 |
<td class="w-1/5 border-r lg:px-4">
|
271 |
-
<div class="block pt-3 pb-2 pl-2"><span class="text-lg font-medium text-gray-400"><?php
|
272 |
<div class="flex pt-2 pb-2 h-20">
|
273 |
<div class="lg:pl-2 ">
|
274 |
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" class="w-8 h-8 text-gray-400 mt-1"><path d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path></svg>
|
275 |
</div>
|
276 |
<div>
|
277 |
-
<span class="text-4xl font-bold leading-none text-indigo-600 pl-4"><?php echo number_format($es_total_contact); ?></span>
|
278 |
|
279 |
</div>
|
280 |
</div>
|
281 |
</td>
|
282 |
<td class="w-4/5">
|
283 |
-
<div class="block pt-4 pb-1"><span class="text-lg font-medium text-gray-400 pl-4"><?php
|
284 |
<div class="flex">
|
285 |
<div class="lg:w-3/12 xl:w-2/12 h-20 pl-4 pt-3 border-r border-gray-200">
|
286 |
<div class="mb-1">
|
287 |
-
<span class="text-2xl font-bold leading-none text-gray-700"><?php echo number_format($es_total_subscribed_contacts); ?></span>
|
288 |
</div>
|
289 |
<div class="text-sm text-gray-400 tracking-wide">
|
290 |
-
<?php
|
291 |
</div>
|
292 |
</div>
|
293 |
<div class="lg:w-3/12 xl:w-2/12 h-20 pl-4 pt-3 mb-2 border-r border-gray-200">
|
294 |
<div class=" mb-1">
|
295 |
-
<span class="text-2xl font-bold leading-none text-gray-700"><?php echo number_format($es_total_unsubscribed_contacts); ?></span>
|
296 |
</div>
|
297 |
<div class="text-sm text-gray-400 tracking-wide">
|
298 |
-
<?php
|
299 |
</div>
|
300 |
</div>
|
301 |
<div class="lg:w-3/12 xl:w-2/12 h-20 pl-4 pt-3 border-r border-gray-200">
|
302 |
<div class="mb-1">
|
303 |
-
<span class="text-2xl font-bold leading-none text-gray-700"><?php echo number_format($es_total_contacts_opened_emails); ?></span>
|
304 |
</div>
|
305 |
<div class="text-sm text-gray-400 tracking-wide">
|
306 |
-
<?php
|
307 |
</div>
|
308 |
</div>
|
309 |
<div class="lg:w-3/12 xl:w-2/12 h-20 pl-4 pt-3">
|
@@ -327,11 +347,16 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
327 |
public function save_contact( $id = 0 ) {
|
328 |
global $wpdb;
|
329 |
|
330 |
-
$first_name =
|
|
|
|
|
|
|
|
|
|
|
331 |
$list_ids = array();
|
332 |
$is_new = true;
|
333 |
|
334 |
-
if (
|
335 |
|
336 |
$title = __( ' Add New Contact', 'email-subscribers' );
|
337 |
$title_action = '<a href="admin.php?page=es_lists&action=manage-lists" class="ig-es-imp-button px-2 py-2">' . __( 'Manage Lists', 'email-subscribers' ) . '</a>';
|
@@ -441,13 +466,13 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
441 |
$name = ES_Common::prepare_name_from_first_name_last_name( $contact['first_name'], $contact['last_name'] );
|
442 |
|
443 |
$template_data = array(
|
444 |
-
'email'
|
445 |
'contact_id' => $id,
|
446 |
-
'name'
|
447 |
'first_name' => $contact['first_name'],
|
448 |
-
'last_name'
|
449 |
-
'guid'
|
450 |
-
'list_name'
|
451 |
);
|
452 |
|
453 |
// Send Welcome Email
|
@@ -466,17 +491,14 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
466 |
$message = __( 'Please Enter First Name', 'email-subscribers' );
|
467 |
ES_Common::show_message( $message, 'error' );
|
468 |
}
|
469 |
-
|
470 |
} else {
|
471 |
$message = __( 'Please Select List', 'email-subscribers' );
|
472 |
ES_Common::show_message( $message, 'error' );
|
473 |
}
|
474 |
-
|
475 |
} else {
|
476 |
$message = __( 'Please Enter Valid Email Address', 'email-subscribers' );
|
477 |
ES_Common::show_message( $message, 'error' );
|
478 |
}
|
479 |
-
|
480 |
}
|
481 |
}
|
482 |
|
@@ -485,7 +507,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
485 |
'first_name' => $first_name,
|
486 |
'last_name' => $last_name,
|
487 |
'email' => $email,
|
488 |
-
'guid' => $guid
|
489 |
);
|
490 |
|
491 |
?>
|
@@ -496,35 +518,34 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
496 |
<div class="flex-1 min-w-0">
|
497 |
<h2 class="text-2xl leading-7 text-gray-900 sm:leading-9 sm:truncate">
|
498 |
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate">
|
499 |
-
<a href="admin.php?page=es_subscribers"><?php
|
500 |
<path
|
501 |
fill-rule="evenodd"
|
502 |
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
503 |
clip-rule="evenodd"
|
504 |
></path>
|
505 |
</svg>
|
506 |
-
<?php echo $title; ?>
|
507 |
</h2>
|
508 |
</div>
|
509 |
|
510 |
<div class="py-2 flex md:mt-0 pb-2">
|
511 |
<div id="ig-es-create-button" class="relative inline-block text-left">
|
512 |
-
<span class="rounded-md shadow-sm">
|
513 |
<?php
|
514 |
-
echo $title_action;
|
515 |
-
|
516 |
</div>
|
517 |
</div>
|
518 |
</div>
|
519 |
</header>
|
520 |
<div class=""><hr class="wp-header-end"></div>
|
521 |
<div class="bg-white shadow-md rounded-lg">
|
522 |
-
<?php echo $this->prepare_contact_form( $data, $is_new ); ?>
|
523 |
|
524 |
</div>
|
525 |
<?php
|
526 |
|
527 |
-
|
528 |
|
529 |
/**
|
530 |
* Retrieve subscribers data from the database
|
@@ -535,7 +556,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
535 |
* @return mixed
|
536 |
*/
|
537 |
public function get_subscribers( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
538 |
-
global $wpdb;
|
539 |
|
540 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
541 |
$order = ig_es_get_request_data( 'order' );
|
@@ -567,43 +588,41 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
567 |
$where_clause_added = false;
|
568 |
|
569 |
if ( ! empty( $filter_by_list_id ) ) {
|
570 |
-
$list_filter_sql = $wpdb->prepare(
|
571 |
$where_clause_added = true;
|
572 |
}
|
573 |
|
574 |
if ( ! empty( $filter_by_status ) ) {
|
575 |
if ( $where_clause_added ) {
|
576 |
-
$list_filter_sql .= $wpdb->prepare(
|
577 |
} else {
|
578 |
-
$list_filter_sql .= $wpdb->prepare(
|
579 |
}
|
580 |
-
|
581 |
}
|
582 |
|
583 |
$filter_sql .= $list_filter_sql;
|
584 |
-
$query[]
|
585 |
}
|
586 |
|
587 |
// Prepare search query
|
588 |
if ( ! empty( $search ) ) {
|
589 |
-
$query[] =
|
590 |
-
$args[] =
|
591 |
-
$args[] =
|
592 |
-
$args[] =
|
593 |
}
|
594 |
|
595 |
if ( $add_where_clause || count( $query ) > 0 ) {
|
596 |
-
$sql .=
|
597 |
|
598 |
if ( count( $query ) > 0 ) {
|
599 |
-
$sql .= implode(
|
600 |
if ( ! empty( $args ) ) {
|
601 |
-
$sql = $
|
602 |
}
|
603 |
}
|
604 |
}
|
605 |
|
606 |
-
|
607 |
if ( ! $do_count_only ) {
|
608 |
|
609 |
// Prepare Order by clause
|
@@ -627,9 +646,9 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
627 |
$sql .= $order_by_clause;
|
628 |
$sql .= " LIMIT {$offset}, {$per_page}";
|
629 |
|
630 |
-
$result = $
|
631 |
} else {
|
632 |
-
$result = $
|
633 |
}
|
634 |
|
635 |
return $result;
|
@@ -649,20 +668,20 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
649 |
$lists_id_name_map = ES()->lists_db->get_list_id_name_map();
|
650 |
|
651 |
if ( count( $lists_id_name_map ) ) {
|
652 |
-
|
653 |
$list_html = $this->prepare_lists_html( $id );
|
654 |
} else {
|
655 |
-
$list_html = "<tr><td><span class='text-sm leading-5 font-normal text-gray-500'>" . __( 'No list found', 'email-subscribers' ) .
|
656 |
}
|
657 |
|
658 |
?>
|
659 |
|
660 |
|
661 |
-
<form method="post" action="<?php echo $action; ?>" class="ml-5 mr-4 text-left pt-8 flex-row mt-2 item-center ">
|
662 |
<div class="flex flex-row border-b border-gray-100">
|
663 |
<div class="flex w-1/5">
|
664 |
<div class="ml-4 pt-6">
|
665 |
-
<label for="firstname"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
666 |
|
667 |
</div>
|
668 |
</div>
|
@@ -674,7 +693,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
674 |
<span class="my-2 mr-10 dashicons dashicons-admin-users"></span>
|
675 |
</span>
|
676 |
</div>
|
677 |
-
<input id="ig-es-contact-first-name" class="ig-es-contact-first-name form-input block border-gray-400 w-full pl-10 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" placeholder="<?php
|
678 |
</div>
|
679 |
</div>
|
680 |
</div>
|
@@ -683,7 +702,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
683 |
<div class="flex flex-row border-b border-gray-100">
|
684 |
<div class="flex w-1/5">
|
685 |
<div class="ml-4 pt-6">
|
686 |
-
<label for="lastname"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
687 |
</div>
|
688 |
</div>
|
689 |
<div class="flex">
|
@@ -694,7 +713,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
694 |
<span class="my-2 mr-10 dashicons dashicons-admin-users"></span>
|
695 |
</span>
|
696 |
</div>
|
697 |
-
<input id="ig-es-contact-last-name" class="ig-es-contact-last-name form-input block border-gray-400 w-full pl-10 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" placeholder="<?php
|
698 |
</div>
|
699 |
</div>
|
700 |
</div>
|
@@ -703,7 +722,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
703 |
<div class="flex flex-row border-b border-gray-100">
|
704 |
<div class="flex w-1/5" >
|
705 |
<div class="ml-4 pt-6">
|
706 |
-
<label for="email"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
707 |
</div>
|
708 |
</div>
|
709 |
<div class="flex">
|
@@ -713,7 +732,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
713 |
<span class="inset-y-0 text-gray-400 sm:text-sm sm:leading-5">
|
714 |
<span class="my-2 mr-10 dashicons dashicons-email-alt"></span></span>
|
715 |
</div>
|
716 |
-
<input id="email" class="form-input block border-gray-400 w-full pl-10 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5"
|
717 |
</div>
|
718 |
</div>
|
719 |
</div>
|
@@ -723,7 +742,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
723 |
<div class="flex flex-row border-b border-gray-100">
|
724 |
<div class="flex w-1/5">
|
725 |
<div class="ml-4 pt-4">
|
726 |
-
<label for="send_email"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
727 |
</label>
|
728 |
</div>
|
729 |
</div>
|
@@ -732,9 +751,13 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
732 |
<label for="send_email" class=" inline-flex items-center cursor-pointer">
|
733 |
<span class="relative">
|
734 |
<input id="send_email" type="checkbox" class="absolute es-check-toggle opacity-0 w-0 h-0"
|
735 |
-
name="contact_data[send_welcome_email]"
|
|
|
|
|
736 |
echo "checked='checked'";
|
737 |
-
}
|
|
|
|
|
738 |
<span class="es-mail-toggle-line block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
739 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline"></span>
|
740 |
</span>
|
@@ -748,38 +771,38 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
748 |
<div class="flex w-1/5">
|
749 |
<div class="ml-4 pt-6">
|
750 |
<label for="status">
|
751 |
-
<span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"> <?php
|
752 |
</div>
|
753 |
</div>
|
754 |
<div class="flex">
|
755 |
<div class="ml-16 my-4 mr-4">
|
756 |
<div class=" relative">
|
757 |
-
<?php
|
|
|
|
|
|
|
758 |
</div>
|
759 |
</div>
|
760 |
</div>
|
761 |
</div>
|
762 |
|
763 |
<div class="flex border-b border-gray-100">
|
|
|
|
|
|
|
764 |
<div class="ml-4 mb-4 pt-6">
|
765 |
-
<input type="hidden" name="contact_data[created_at]" value="<?php echo $created; ?>" />
|
766 |
-
<input type="hidden" name="contact_data[guid]" value="<?php echo $guid; ?>" />
|
767 |
<input type="hidden" name="submitted" value="submitted" />
|
768 |
-
<input type="submit" name="submit" class="cursor-pointer align-middle px-4 my-2 py-2 mx-2 ig-es-primary-button hover:shadow-md" value="<?php
|
769 |
-
|
770 |
-
}
|
771 |
-
else{
|
772 |
-
_e( 'Save Changes', 'email-subscribers' );
|
773 |
-
}
|
774 |
-
?>"/>
|
775 |
-
<a href="admin.php?page=es_subscribers" class="cursor-pointer align-middle rounded-md border border-indigo-600 hover:shadow-md focus:outline-none focus:shadow-outline-indigo text-sm leading-5 font-medium transition ease-in-out duration-150 px-4 my-2 py-2 mx-2 ">Cancel</a>
|
776 |
</div>
|
777 |
</div>
|
778 |
</form>
|
779 |
</div>
|
780 |
<?php
|
781 |
|
782 |
-
|
783 |
|
784 |
|
785 |
/**
|
@@ -788,14 +811,14 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
788 |
* @since 4.0.0
|
789 |
*/
|
790 |
public function no_items() {
|
791 |
-
|
792 |
}
|
793 |
|
794 |
|
795 |
/**
|
796 |
* Render a column when no column specific method exist.
|
797 |
*
|
798 |
-
* @param array
|
799 |
* @param string $column_name
|
800 |
*
|
801 |
* @return mixed
|
@@ -806,15 +829,15 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
806 |
$item = apply_filters( 'es_subscribers_col_data', $item, $column_name );
|
807 |
switch ( $column_name ) {
|
808 |
case 'lists':
|
809 |
-
|
810 |
case 'created_at':
|
811 |
-
|
812 |
case 'first_name':
|
813 |
case 'email':
|
814 |
default:
|
815 |
return $item[ $column_name ]; //Show the whole array for troubleshooting purposes
|
816 |
-
}
|
817 |
}
|
|
|
818 |
|
819 |
/**
|
820 |
* Prepare lists html to set status
|
@@ -841,28 +864,28 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
841 |
|
842 |
$i = 0;
|
843 |
foreach ( $lists as $list_id => $list_name ) {
|
844 |
-
if ( $i
|
845 |
-
$lists_html .= "</tr><tr class='mt-3'>";
|
846 |
}
|
847 |
|
848 |
$selected = ! empty( $list_contact_status_map[ $list_id ] ) ? $list_contact_status_map[ $list_id ] : '';
|
849 |
|
850 |
-
$status_dropdown_html
|
851 |
$status_dropdown_html .= ES_Common::prepare_statuses_dropdown_options( $selected );
|
852 |
-
$status_dropdown_html .=
|
853 |
|
854 |
$status_span = '';
|
855 |
if ( ! empty( $list_contact_status_map[ $list_id ] ) ) {
|
856 |
$status_span = '<span class="border-gray-400 focus:bg-gray-100 es_list_contact_status ' . $list_contact_status_map[ $list_id ] . '" title="' . ucwords( $list_contact_status_map[ $list_id ] ) . '">';
|
857 |
}
|
858 |
|
859 |
-
$list_name
|
860 |
$lists_html .= "<td class='pr-1 pt-2 text-sm leading-5 font-normal text-gray-500'>$status_span$list_name</td><td>$status_dropdown_html</td>";
|
861 |
|
862 |
$i ++;
|
863 |
}
|
864 |
|
865 |
-
$lists_html .=
|
866 |
}
|
867 |
|
868 |
return $lists_html;
|
@@ -887,7 +910,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
887 |
|
888 |
if ( count( $lists ) > 0 ) {
|
889 |
// Show only 4 lists
|
890 |
-
|
891 |
foreach ( $lists as $list_id => $status ) {
|
892 |
|
893 |
if ( ! empty( $this->lists_id_name_map[ $list_id ] ) ) {
|
@@ -910,9 +933,10 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
910 |
*
|
911 |
* @since 4.0.0
|
912 |
*/
|
913 |
-
function column_cb( $item ) {
|
914 |
return sprintf(
|
915 |
-
'<input type="checkbox" name="subscribers[]" value="%s"/>',
|
|
|
916 |
);
|
917 |
}
|
918 |
|
@@ -925,7 +949,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
925 |
*
|
926 |
* @since 4.0.0
|
927 |
*/
|
928 |
-
function column_name( $item ) {
|
929 |
$delete_nonce = wp_create_nonce( 'ig_es_delete_subscriber' );
|
930 |
|
931 |
$name = ES_Common::prepare_name_from_first_name_last_name( $item['first_name'], $item['last_name'] );
|
@@ -934,12 +958,13 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
934 |
$page = ig_es_get_request_data( 'page' );
|
935 |
|
936 |
$actions = array(
|
937 |
-
|
938 |
-
'
|
|
|
|
|
939 |
);
|
940 |
-
|
941 |
-
$actions['resend'] = sprintf( __( '<a href="?page=%s&action=%s&subscriber=%s&_wpnonce=%s" class="text-indigo-600">Resend Confirmation<a>', 'email-subscribers' ), esc_attr( ig_es_get_request_data( 'page' ) ), 'resend', absint( $item['id'] ), $delete_nonce );
|
942 |
-
|
943 |
|
944 |
return $title . $this->row_actions( $actions );
|
945 |
}
|
@@ -951,7 +976,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
951 |
*
|
952 |
* @since 4.0.0
|
953 |
*/
|
954 |
-
function get_columns() {
|
955 |
$columns = array(
|
956 |
'cb' => '<input type="checkbox"/>',
|
957 |
'name' => __( 'Name', 'email-subscribers' ),
|
@@ -975,7 +1000,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
975 |
'name' => array( 'first_name', true ),
|
976 |
'email' => array( 'email', false ),
|
977 |
// 'status' => array( 'status', false ),
|
978 |
-
'created_at' => array( 'created_at', false )
|
979 |
);
|
980 |
|
981 |
return $sortable_columns;
|
@@ -993,7 +1018,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
993 |
'bulk_delete' => __( 'Delete', 'email-subscribers' ),
|
994 |
'bulk_list_update' => __( 'Move To List', 'email-subscribers' ),
|
995 |
'bulk_list_add' => __( 'Add To List', 'email-subscribers' ),
|
996 |
-
'bulk_status_update' => __( 'Change Status', 'email-subscribers' )
|
997 |
);
|
998 |
|
999 |
return $actions;
|
@@ -1013,23 +1038,32 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
1013 |
?>
|
1014 |
<p class="search-box box-ma10">
|
1015 |
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $text ); ?>:</label>
|
1016 |
-
<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
|
1017 |
<?php submit_button( __( 'Search Contacts', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
1018 |
</p>
|
1019 |
<p class="search-box search-group-box box-ma10">
|
1020 |
<?php $filter_by_status = ig_es_get_request_data( 'filter_by_status' ); ?>
|
1021 |
<select name="filter_by_status">
|
1022 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
1023 |
</select>
|
1024 |
</p>
|
1025 |
<p class="search-box search-group-box box-ma10">
|
1026 |
<?php $filter_by_list_id = ig_es_get_request_data( 'filter_by_list_id' ); ?>
|
1027 |
<select name="filter_by_list_id">
|
1028 |
-
<?php
|
|
|
|
|
|
|
1029 |
</select>
|
1030 |
</p>
|
1031 |
|
1032 |
-
|
|
|
1033 |
|
1034 |
/**
|
1035 |
* Get Contact id
|
@@ -1063,14 +1097,15 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
1063 |
$current_page = $this->get_pagenum();
|
1064 |
$total_items = $this->get_subscribers( 0, 0, true );
|
1065 |
|
1066 |
-
$this->set_pagination_args(
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
|
|
|
|
1070 |
|
1071 |
$contacts = $this->get_subscribers( $per_page, $current_page );
|
1072 |
|
1073 |
-
|
1074 |
$this->items = $contacts;
|
1075 |
|
1076 |
if ( count( $contacts ) > 0 ) {
|
@@ -1091,11 +1126,12 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
1091 |
* @since 4.0.0
|
1092 |
*/
|
1093 |
public function prepare_lists_dropdown() {
|
1094 |
-
$data
|
1095 |
$data .= ES_Common::prepare_list_dropdown_options();
|
1096 |
$data .= '</select>';
|
1097 |
|
1098 |
-
|
|
|
1099 |
}
|
1100 |
|
1101 |
/**
|
@@ -1104,11 +1140,13 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
1104 |
* @since 4.0.0
|
1105 |
*/
|
1106 |
public function prepare_statuses_dropdown() {
|
1107 |
-
$data
|
1108 |
$data .= ES_Common::prepare_statuses_dropdown_options();
|
1109 |
$data .= '</select>';
|
1110 |
|
1111 |
-
|
|
|
|
|
1112 |
}
|
1113 |
|
1114 |
/**
|
@@ -1118,7 +1156,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
1118 |
*/
|
1119 |
public function process_bulk_action() {
|
1120 |
|
1121 |
-
//Detect when a bulk action is being triggered...
|
1122 |
if ( 'delete' === $this->current_action() ) {
|
1123 |
|
1124 |
// In our file that handles the request, verify the nonce.
|
@@ -1136,7 +1174,6 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
1136 |
|
1137 |
return;
|
1138 |
}
|
1139 |
-
|
1140 |
}
|
1141 |
|
1142 |
if ( 'resend' === $this->current_action() ) {
|
@@ -1163,7 +1200,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
1163 |
} else {
|
1164 |
$response = ES()->mailer->send_double_optin_email( $email, $merge_tags );
|
1165 |
$url = add_query_arg( 'resend', true );
|
1166 |
-
//redirect to resend link and avoid resending email
|
1167 |
?>
|
1168 |
<meta http-equiv="refresh" content="0; url=<?php echo esc_url( $url ); ?>"/>
|
1169 |
<?php
|
@@ -1172,7 +1209,6 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
1172 |
return;
|
1173 |
|
1174 |
}
|
1175 |
-
|
1176 |
}
|
1177 |
|
1178 |
$action = ig_es_get_request_data( 'action' );
|
@@ -1294,11 +1330,7 @@ class ES_Contacts_Table extends WP_List_Table {
|
|
1294 |
|
1295 |
global $wpdb;
|
1296 |
|
1297 |
-
$
|
1298 |
-
|
1299 |
-
$query = "UPDATE $ig_contacts_table SET form_id = 0 WHERE form_id = %d";
|
1300 |
-
|
1301 |
-
$wpdb->query( $wpdb->prepare( $query, $form_id ) );
|
1302 |
}
|
1303 |
|
1304 |
-
}
|
6 |
}
|
7 |
|
8 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
9 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
10 |
}
|
11 |
class ES_Contacts_Table extends WP_List_Table {
|
12 |
/**
|
13 |
+
* Contact lists status array
|
14 |
+
*
|
15 |
* @since 4.0.0
|
16 |
* @var array
|
17 |
*
|
19 |
public $contact_lists_statuses = array();
|
20 |
|
21 |
/**
|
22 |
+
* Number of contacts per page
|
23 |
+
*
|
24 |
* @since 4.2.1
|
25 |
*
|
26 |
* @var string
|
27 |
+
*
|
28 |
*/
|
29 |
public static $option_per_page = 'es_contacts_per_page';
|
30 |
|
31 |
/**
|
32 |
+
* Array of list ids
|
33 |
+
*
|
34 |
* @since 4.0.0
|
35 |
* @var array
|
36 |
*
|
38 |
public $list_ids = array();
|
39 |
|
40 |
/**
|
41 |
+
* List name mapped to id
|
42 |
+
*
|
43 |
* @since 4.0.0
|
44 |
* @var array
|
45 |
*
|
47 |
public $lists_id_name_map = array();
|
48 |
|
49 |
/**
|
50 |
+
* Contacts database object
|
51 |
+
*
|
52 |
* @var object|ES_DB_Contacts
|
53 |
*/
|
54 |
public $db;
|
60 |
*/
|
61 |
public function __construct() {
|
62 |
|
63 |
+
parent::__construct(
|
64 |
+
array(
|
65 |
+
'singular' => __( 'Contact', 'email-subscribers' ),
|
66 |
+
'plural' => __( 'Contacts', 'email-subscribers' ),
|
67 |
+
'ajax' => false,
|
68 |
+
'screen' => 'es_subscribers',
|
69 |
+
)
|
70 |
+
);
|
71 |
|
72 |
$this->db = new ES_DB_Contacts();
|
73 |
|
94 |
$args = array(
|
95 |
'label' => __( 'Number of contacts per page', 'email-subscribers' ),
|
96 |
'default' => 100,
|
97 |
+
'option' => self::$option_per_page,
|
98 |
);
|
99 |
|
100 |
add_screen_option( $option, $args );
|
103 |
}
|
104 |
|
105 |
/**
|
106 |
+
* Get the content of Audience main tab
|
107 |
+
*
|
108 |
* @param $active_tab
|
109 |
+
* @param array $audience_main_tabs
|
110 |
*
|
111 |
* @return array
|
112 |
*
|
115 |
public function get_audience_main_tabs( $active_tab, $audience_main_tabs = array() ) {
|
116 |
|
117 |
$audience_tab_main_navigation = array(
|
118 |
+
'new_contact' => array(
|
119 |
'label' => __( 'Add New Contact', 'email-subscribers' ),
|
120 |
'indicator_option' => '',
|
121 |
'indicator_label' => '',
|
122 |
'indicator_type' => '',
|
123 |
'action' => 'new',
|
124 |
+
'url' => add_query_arg( 'action', 'new', 'admin.php?page=es_subscribers' ),
|
125 |
),
|
126 |
|
127 |
+
'import' => array(
|
128 |
'label' => __( 'Import Contacts', 'email-subscribers' ),
|
129 |
'indicator_option' => '',
|
130 |
'indicator_label' => '',
|
131 |
'indicator_type' => '',
|
132 |
'action' => 'import',
|
133 |
+
'url' => add_query_arg( 'action', 'import', 'admin.php?page=es_subscribers' ),
|
134 |
),
|
135 |
|
136 |
+
'export' => array(
|
137 |
'label' => __( 'Export Contacts', 'email-subscribers' ),
|
138 |
'indicator_option' => '',
|
139 |
'indicator_label' => '',
|
140 |
'indicator_type' => '',
|
141 |
'action' => 'export',
|
142 |
+
'url' => add_query_arg( 'action', 'export', 'admin.php?page=es_subscribers' ),
|
143 |
),
|
144 |
|
145 |
+
'sync' => array(
|
146 |
'label' => __( 'Sync', 'email-subscribers' ),
|
147 |
'indicator_option' => 'ig_es_show_sync_tab',
|
148 |
'indicator_label' => __( 'New', 'email-subscribers' ),
|
149 |
'indicator_type' => 'new',
|
150 |
'action' => 'sync',
|
151 |
+
'url' => add_query_arg( 'action', 'sync', 'admin.php?page=es_subscribers' ),
|
152 |
),
|
153 |
|
154 |
'manage_lists' => array(
|
158 |
'indicator_type' => '',
|
159 |
'action' => 'manage-lists',
|
160 |
'is_imp' => true,
|
161 |
+
'url' => add_query_arg( 'action', 'manage-lists', 'admin.php?page=es_lists' ),
|
162 |
+
),
|
163 |
);
|
164 |
|
165 |
$audience_main_tabs = $audience_main_tabs + $audience_tab_main_navigation;
|
192 |
$contact_id = absint( ig_es_get_request_data( 'subscriber' ) );
|
193 |
$this->save_contact( $contact_id );
|
194 |
} elseif ( 'sync' === $action ) {
|
195 |
+
update_option( 'ig_es_show_sync_tab', 'no' ); // yes/no
|
196 |
+
$this->load_sync();
|
197 |
+
} else {
|
|
|
198 |
|
199 |
+
$audience_tab_main_navigation = array();
|
200 |
+
$active_tab = '';
|
201 |
+
$audience_tab_main_navigation = apply_filters( 'ig_es_audience_tab_main_navigation', $active_tab, $audience_tab_main_navigation );
|
202 |
|
203 |
+
?>
|
204 |
|
205 |
<h2 class="wp-heading-inline">
|
206 |
+
<span class="text-base font-normal text-indigo-600 sm:leading-7 sm:truncate">
|
207 |
+
<?php
|
208 |
+
echo esc_html__( 'Audience', 'email-subscribers' );
|
209 |
+
?>
|
210 |
+
<svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="w-4 h-4 inline-block align-middle text-gray-900"><path d="M9 5l7 7-7 7"></path></svg>
|
211 |
</span>
|
212 |
<span class="text-2xl font-medium text-gray-900 sm:leading-9 sm:truncate">
|
213 |
+
<?php
|
214 |
+
echo esc_html__( 'Contacts', 'email-subscribers' );
|
215 |
+
?>
|
216 |
</span>
|
217 |
+
<?php
|
218 |
+
ES_Common::prepare_main_header_navigation( $audience_tab_main_navigation );
|
219 |
+
?>
|
220 |
</h2>
|
221 |
|
222 |
<div class="my-4">
|
223 |
+
<?php $this->get_contacts_reports(); ?>
|
224 |
</div>
|
225 |
|
226 |
<div id="poststuff" class="es-audience-view es-items-lists">
|
239 |
<br class="clear">
|
240 |
</div>
|
241 |
</div>
|
242 |
+
<?php
|
243 |
+
}
|
244 |
+
}
|
245 |
|
246 |
/**
|
247 |
* Load Export Feature
|
288 |
<table class="min-w-full overflow-hidden bg-white border-t border-b sm:border-l sm:border-r sm:rounded shadow font-sans">
|
289 |
<tr>
|
290 |
<td class="w-1/5 border-r lg:px-4">
|
291 |
+
<div class="block pt-3 pb-2 pl-2"><span class="text-lg font-medium text-gray-400"><?php echo esc_html__( 'Total Contacts', 'email-subscribers' ); ?></span></div>
|
292 |
<div class="flex pt-2 pb-2 h-20">
|
293 |
<div class="lg:pl-2 ">
|
294 |
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" class="w-8 h-8 text-gray-400 mt-1"><path d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path></svg>
|
295 |
</div>
|
296 |
<div>
|
297 |
+
<span class="text-4xl font-bold leading-none text-indigo-600 pl-4"><?php echo esc_html( number_format( $es_total_contact ) ); ?></span>
|
298 |
|
299 |
</div>
|
300 |
</div>
|
301 |
</td>
|
302 |
<td class="w-4/5">
|
303 |
+
<div class="block pt-4 pb-1"><span class="text-lg font-medium text-gray-400 pl-4"><?php echo esc_html__( 'Last 60 Days', 'email-subscribers' ); ?></span></div>
|
304 |
<div class="flex">
|
305 |
<div class="lg:w-3/12 xl:w-2/12 h-20 pl-4 pt-3 border-r border-gray-200">
|
306 |
<div class="mb-1">
|
307 |
+
<span class="text-2xl font-bold leading-none text-gray-700"><?php echo esc_html( number_format( $es_total_subscribed_contacts ) ); ?></span>
|
308 |
</div>
|
309 |
<div class="text-sm text-gray-400 tracking-wide">
|
310 |
+
<?php echo esc_html__( 'Subscribed', 'email-subscribers' ); ?>
|
311 |
</div>
|
312 |
</div>
|
313 |
<div class="lg:w-3/12 xl:w-2/12 h-20 pl-4 pt-3 mb-2 border-r border-gray-200">
|
314 |
<div class=" mb-1">
|
315 |
+
<span class="text-2xl font-bold leading-none text-gray-700"><?php echo esc_html( number_format( $es_total_unsubscribed_contacts ) ); ?></span>
|
316 |
</div>
|
317 |
<div class="text-sm text-gray-400 tracking-wide">
|
318 |
+
<?php echo esc_html__( 'Unsubscribed', 'email-subscribers' ); ?>
|
319 |
</div>
|
320 |
</div>
|
321 |
<div class="lg:w-3/12 xl:w-2/12 h-20 pl-4 pt-3 border-r border-gray-200">
|
322 |
<div class="mb-1">
|
323 |
+
<span class="text-2xl font-bold leading-none text-gray-700"><?php echo esc_html( number_format( $es_total_contacts_opened_emails ) ); ?></span>
|
324 |
</div>
|
325 |
<div class="text-sm text-gray-400 tracking-wide">
|
326 |
+
<?php echo esc_html__( 'Opened', 'email-subscribers' ); ?>
|
327 |
</div>
|
328 |
</div>
|
329 |
<div class="lg:w-3/12 xl:w-2/12 h-20 pl-4 pt-3">
|
347 |
public function save_contact( $id = 0 ) {
|
348 |
global $wpdb;
|
349 |
|
350 |
+
$first_name = '';
|
351 |
+
$action = '';
|
352 |
+
$last_name = '';
|
353 |
+
$email = '';
|
354 |
+
$guid = '';
|
355 |
+
$created_at = '';
|
356 |
$list_ids = array();
|
357 |
$is_new = true;
|
358 |
|
359 |
+
if ( 0 === $id ) {
|
360 |
|
361 |
$title = __( ' Add New Contact', 'email-subscribers' );
|
362 |
$title_action = '<a href="admin.php?page=es_lists&action=manage-lists" class="ig-es-imp-button px-2 py-2">' . __( 'Manage Lists', 'email-subscribers' ) . '</a>';
|
466 |
$name = ES_Common::prepare_name_from_first_name_last_name( $contact['first_name'], $contact['last_name'] );
|
467 |
|
468 |
$template_data = array(
|
469 |
+
'email' => $contact['email'],
|
470 |
'contact_id' => $id,
|
471 |
+
'name' => $name,
|
472 |
'first_name' => $contact['first_name'],
|
473 |
+
'last_name' => $contact['last_name'],
|
474 |
+
'guid' => $contact['hash'],
|
475 |
+
'list_name' => $list_name,
|
476 |
);
|
477 |
|
478 |
// Send Welcome Email
|
491 |
$message = __( 'Please Enter First Name', 'email-subscribers' );
|
492 |
ES_Common::show_message( $message, 'error' );
|
493 |
}
|
|
|
494 |
} else {
|
495 |
$message = __( 'Please Select List', 'email-subscribers' );
|
496 |
ES_Common::show_message( $message, 'error' );
|
497 |
}
|
|
|
498 |
} else {
|
499 |
$message = __( 'Please Enter Valid Email Address', 'email-subscribers' );
|
500 |
ES_Common::show_message( $message, 'error' );
|
501 |
}
|
|
|
502 |
}
|
503 |
}
|
504 |
|
507 |
'first_name' => $first_name,
|
508 |
'last_name' => $last_name,
|
509 |
'email' => $email,
|
510 |
+
'guid' => $guid,
|
511 |
);
|
512 |
|
513 |
?>
|
518 |
<div class="flex-1 min-w-0">
|
519 |
<h2 class="text-2xl leading-7 text-gray-900 sm:leading-9 sm:truncate">
|
520 |
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate">
|
521 |
+
<a href="admin.php?page=es_subscribers"><?php esc_html_e('Audience ', 'email-subscribers'); ?></a></span> <svg class="w-6 h-6 mt-2 inline-block" fill="currentColor" viewBox="0 0 24 24">
|
522 |
<path
|
523 |
fill-rule="evenodd"
|
524 |
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
525 |
clip-rule="evenodd"
|
526 |
></path>
|
527 |
</svg>
|
528 |
+
<?php echo esc_html( $title ); ?>
|
529 |
</h2>
|
530 |
</div>
|
531 |
|
532 |
<div class="py-2 flex md:mt-0 pb-2">
|
533 |
<div id="ig-es-create-button" class="relative inline-block text-left">
|
|
|
534 |
<?php
|
535 |
+
echo wp_kses_post( $title_action );
|
536 |
+
?>
|
537 |
</div>
|
538 |
</div>
|
539 |
</div>
|
540 |
</header>
|
541 |
<div class=""><hr class="wp-header-end"></div>
|
542 |
<div class="bg-white shadow-md rounded-lg">
|
543 |
+
<?php echo wp_kses_post( $this->prepare_contact_form( $data, $is_new ) ); ?>
|
544 |
|
545 |
</div>
|
546 |
<?php
|
547 |
|
548 |
+
}
|
549 |
|
550 |
/**
|
551 |
* Retrieve subscribers data from the database
|
556 |
* @return mixed
|
557 |
*/
|
558 |
public function get_subscribers( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
559 |
+
global $wpdb, $wpbd;
|
560 |
|
561 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
562 |
$order = ig_es_get_request_data( 'order' );
|
588 |
$where_clause_added = false;
|
589 |
|
590 |
if ( ! empty( $filter_by_list_id ) ) {
|
591 |
+
$list_filter_sql = $wpdb->prepare( ' WHERE list_id = %d', $filter_by_list_id );
|
592 |
$where_clause_added = true;
|
593 |
}
|
594 |
|
595 |
if ( ! empty( $filter_by_status ) ) {
|
596 |
if ( $where_clause_added ) {
|
597 |
+
$list_filter_sql .= $wpdb->prepare( ' AND status = %s', $filter_by_status );
|
598 |
} else {
|
599 |
+
$list_filter_sql .= $wpdb->prepare( ' WHERE status = %s', $filter_by_status );
|
600 |
}
|
|
|
601 |
}
|
602 |
|
603 |
$filter_sql .= $list_filter_sql;
|
604 |
+
$query[] = "id IN ( $filter_sql )";
|
605 |
}
|
606 |
|
607 |
// Prepare search query
|
608 |
if ( ! empty( $search ) ) {
|
609 |
+
$query[] = ' ( first_name LIKE %s OR last_name LIKE %s OR email LIKE %s ) ';
|
610 |
+
$args[] = '%' . $wpdb->esc_like( $search ) . '%';
|
611 |
+
$args[] = '%' . $wpdb->esc_like( $search ) . '%';
|
612 |
+
$args[] = '%' . $wpdb->esc_like( $search ) . '%';
|
613 |
}
|
614 |
|
615 |
if ( $add_where_clause || count( $query ) > 0 ) {
|
616 |
+
$sql .= ' WHERE ';
|
617 |
|
618 |
if ( count( $query ) > 0 ) {
|
619 |
+
$sql .= implode( ' AND ', $query );
|
620 |
if ( ! empty( $args ) ) {
|
621 |
+
$sql = $wpbd->prepare( $sql, $args );
|
622 |
}
|
623 |
}
|
624 |
}
|
625 |
|
|
|
626 |
if ( ! $do_count_only ) {
|
627 |
|
628 |
// Prepare Order by clause
|
646 |
$sql .= $order_by_clause;
|
647 |
$sql .= " LIMIT {$offset}, {$per_page}";
|
648 |
|
649 |
+
$result = $wpbd->get_results( $sql, 'ARRAY_A' );
|
650 |
} else {
|
651 |
+
$result = $wpbd->get_var( $sql );
|
652 |
}
|
653 |
|
654 |
return $result;
|
668 |
$lists_id_name_map = ES()->lists_db->get_list_id_name_map();
|
669 |
|
670 |
if ( count( $lists_id_name_map ) ) {
|
671 |
+
// $list_html = ES_Shortcode::prepare_lists_checkboxes( $lists_id_name_map, array_keys( $lists_id_name_map ), 4, $selected_list_ids, $id, 'contact_data[lists][]' );
|
672 |
$list_html = $this->prepare_lists_html( $id );
|
673 |
} else {
|
674 |
+
$list_html = "<tr><td><span class='text-sm leading-5 font-normal text-gray-500'>" . __( 'No list found', 'email-subscribers' ) . '</span></td></tr>';
|
675 |
}
|
676 |
|
677 |
?>
|
678 |
|
679 |
|
680 |
+
<form method="post" action="<?php echo esc_attr( $action ); ?>" class="ml-5 mr-4 text-left pt-8 flex-row mt-2 item-center ">
|
681 |
<div class="flex flex-row border-b border-gray-100">
|
682 |
<div class="flex w-1/5">
|
683 |
<div class="ml-4 pt-6">
|
684 |
+
<label for="firstname"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'First Name', 'email-subscribers' ); ?></span></label>
|
685 |
|
686 |
</div>
|
687 |
</div>
|
693 |
<span class="my-2 mr-10 dashicons dashicons-admin-users"></span>
|
694 |
</span>
|
695 |
</div>
|
696 |
+
<input id="ig-es-contact-first-name" class="ig-es-contact-first-name form-input block border-gray-400 w-full pl-10 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" placeholder="<?php esc_html_e( 'Enter First Name', 'email-subscribers' ); ?>" name="contact_data[first_name]" value="<?php echo esc_attr( $first_name ); ?>" />
|
697 |
</div>
|
698 |
</div>
|
699 |
</div>
|
702 |
<div class="flex flex-row border-b border-gray-100">
|
703 |
<div class="flex w-1/5">
|
704 |
<div class="ml-4 pt-6">
|
705 |
+
<label for="lastname"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Last Name', 'email-subscribers' ); ?></span></label>
|
706 |
</div>
|
707 |
</div>
|
708 |
<div class="flex">
|
713 |
<span class="my-2 mr-10 dashicons dashicons-admin-users"></span>
|
714 |
</span>
|
715 |
</div>
|
716 |
+
<input id="ig-es-contact-last-name" class="ig-es-contact-last-name form-input block border-gray-400 w-full pl-10 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" placeholder="<?php esc_html_e( 'Enter Last Name', 'email-subscribers' ); ?>" name="contact_data[last_name]" value="<?php echo esc_attr( $last_name ); ?>" />
|
717 |
</div>
|
718 |
</div>
|
719 |
</div>
|
722 |
<div class="flex flex-row border-b border-gray-100">
|
723 |
<div class="flex w-1/5" >
|
724 |
<div class="ml-4 pt-6">
|
725 |
+
<label for="email"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Email', 'email-subscribers' ); ?></span></label>
|
726 |
</div>
|
727 |
</div>
|
728 |
<div class="flex">
|
732 |
<span class="inset-y-0 text-gray-400 sm:text-sm sm:leading-5">
|
733 |
<span class="my-2 mr-10 dashicons dashicons-email-alt"></span></span>
|
734 |
</div>
|
735 |
+
<input id="email" class="form-input block border-gray-400 w-full pl-10 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" id="email" name="contact_data[email]" value="<?php echo esc_attr( $email ); ?>" placeholder="<?php esc_html_e( 'Enter Email', 'email-subscribers' ); ?>" />
|
736 |
</div>
|
737 |
</div>
|
738 |
</div>
|
742 |
<div class="flex flex-row border-b border-gray-100">
|
743 |
<div class="flex w-1/5">
|
744 |
<div class="ml-4 pt-4">
|
745 |
+
<label for="send_email"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Send Welcome Email?', 'email-subscribers' ); ?></span>
|
746 |
</label>
|
747 |
</div>
|
748 |
</div>
|
751 |
<label for="send_email" class=" inline-flex items-center cursor-pointer">
|
752 |
<span class="relative">
|
753 |
<input id="send_email" type="checkbox" class="absolute es-check-toggle opacity-0 w-0 h-0"
|
754 |
+
name="contact_data[send_welcome_email]"
|
755 |
+
<?php
|
756 |
+
if ( $send_welcome_email ) {
|
757 |
echo "checked='checked'";
|
758 |
+
}
|
759 |
+
?>
|
760 |
+
/>
|
761 |
<span class="es-mail-toggle-line block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
762 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline"></span>
|
763 |
</span>
|
771 |
<div class="flex w-1/5">
|
772 |
<div class="ml-4 pt-6">
|
773 |
<label for="status">
|
774 |
+
<span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"> <?php esc_html_e( 'List(s)', 'email-subscribers' ); ?></span></label>
|
775 |
</div>
|
776 |
</div>
|
777 |
<div class="flex">
|
778 |
<div class="ml-16 my-4 mr-4">
|
779 |
<div class=" relative">
|
780 |
+
<?php
|
781 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
782 |
+
echo wp_kses( $list_html , $allowedtags );
|
783 |
+
?>
|
784 |
</div>
|
785 |
</div>
|
786 |
</div>
|
787 |
</div>
|
788 |
|
789 |
<div class="flex border-b border-gray-100">
|
790 |
+
<?php
|
791 |
+
$submit_button_text = $is_new ? __( 'Save Contact', 'email-subscribers' ) : __( 'Save Changes', 'email-subscribers' );
|
792 |
+
?>
|
793 |
<div class="ml-4 mb-4 pt-6">
|
794 |
+
<input type="hidden" name="contact_data[created_at]" value="<?php echo esc_attr( $created ); ?>" />
|
795 |
+
<input type="hidden" name="contact_data[guid]" value="<?php echo esc_attr( $guid ); ?>" />
|
796 |
<input type="hidden" name="submitted" value="submitted" />
|
797 |
+
<input type="submit" name="submit" class="cursor-pointer align-middle px-4 my-2 py-2 mx-2 ig-es-primary-button hover:shadow-md" value="<?php echo esc_attr( $submit_button_text ); ?>"/>
|
798 |
+
<a href="admin.php?page=es_subscribers" class="cursor-pointer align-middle rounded-md border border-indigo-600 hover:shadow-md focus:outline-none focus:shadow-outline-indigo text-sm leading-5 font-medium transition ease-in-out duration-150 px-4 my-2 py-2 mx-2 "><?php esc_html_e( 'Cancel', 'email-subscribers' ); ?></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
799 |
</div>
|
800 |
</div>
|
801 |
</form>
|
802 |
</div>
|
803 |
<?php
|
804 |
|
805 |
+
}
|
806 |
|
807 |
|
808 |
/**
|
811 |
* @since 4.0.0
|
812 |
*/
|
813 |
public function no_items() {
|
814 |
+
esc_html_e( 'No contacts avaliable.', 'email-subscribers' );
|
815 |
}
|
816 |
|
817 |
|
818 |
/**
|
819 |
* Render a column when no column specific method exist.
|
820 |
*
|
821 |
+
* @param array $item
|
822 |
* @param string $column_name
|
823 |
*
|
824 |
* @return mixed
|
829 |
$item = apply_filters( 'es_subscribers_col_data', $item, $column_name );
|
830 |
switch ( $column_name ) {
|
831 |
case 'lists':
|
832 |
+
return $this->get_lists_to_show( $item['id'] );
|
833 |
case 'created_at':
|
834 |
+
return ig_es_format_date_time( $item[ $column_name ] );
|
835 |
case 'first_name':
|
836 |
case 'email':
|
837 |
default:
|
838 |
return $item[ $column_name ]; //Show the whole array for troubleshooting purposes
|
|
|
839 |
}
|
840 |
+
}
|
841 |
|
842 |
/**
|
843 |
* Prepare lists html to set status
|
864 |
|
865 |
$i = 0;
|
866 |
foreach ( $lists as $list_id => $list_name ) {
|
867 |
+
if ( 0 != $i && 0 === ( $i % $columns ) ) {
|
868 |
+
$lists_html .= "</tr><tr class='mt-3'>";
|
869 |
}
|
870 |
|
871 |
$selected = ! empty( $list_contact_status_map[ $list_id ] ) ? $list_contact_status_map[ $list_id ] : '';
|
872 |
|
873 |
+
$status_dropdown_html = '<select class="h-8 form-select w-40 mt-2 mr-8 shadow-sm border-gray-400 ig-es-statuses-dropdown shadow-sm sm:text-sm sm:leading-5" name="contact_data[lists][' . esc_attr( $list_id ) . ']" >';
|
874 |
$status_dropdown_html .= ES_Common::prepare_statuses_dropdown_options( $selected );
|
875 |
+
$status_dropdown_html .= '</select>';
|
876 |
|
877 |
$status_span = '';
|
878 |
if ( ! empty( $list_contact_status_map[ $list_id ] ) ) {
|
879 |
$status_span = '<span class="border-gray-400 focus:bg-gray-100 es_list_contact_status ' . $list_contact_status_map[ $list_id ] . '" title="' . ucwords( $list_contact_status_map[ $list_id ] ) . '">';
|
880 |
}
|
881 |
|
882 |
+
$list_name = strlen( $list_name ) > 15 ? substr( $list_name, 0, 15 ) . '...' : $list_name;
|
883 |
$lists_html .= "<td class='pr-1 pt-2 text-sm leading-5 font-normal text-gray-500'>$status_span$list_name</td><td>$status_dropdown_html</td>";
|
884 |
|
885 |
$i ++;
|
886 |
}
|
887 |
|
888 |
+
$lists_html .= '</tr></table>';
|
889 |
}
|
890 |
|
891 |
return $lists_html;
|
910 |
|
911 |
if ( count( $lists ) > 0 ) {
|
912 |
// Show only 4 lists
|
913 |
+
// $contact_lists_to_display = array_slice( $lists, 0, 4 );
|
914 |
foreach ( $lists as $list_id => $status ) {
|
915 |
|
916 |
if ( ! empty( $this->lists_id_name_map[ $list_id ] ) ) {
|
933 |
*
|
934 |
* @since 4.0.0
|
935 |
*/
|
936 |
+
public function column_cb( $item ) {
|
937 |
return sprintf(
|
938 |
+
'<input type="checkbox" name="subscribers[]" value="%s"/>',
|
939 |
+
$item['id']
|
940 |
);
|
941 |
}
|
942 |
|
949 |
*
|
950 |
* @since 4.0.0
|
951 |
*/
|
952 |
+
public function column_name( $item ) {
|
953 |
$delete_nonce = wp_create_nonce( 'ig_es_delete_subscriber' );
|
954 |
|
955 |
$name = ES_Common::prepare_name_from_first_name_last_name( $item['first_name'], $item['last_name'] );
|
958 |
$page = ig_es_get_request_data( 'page' );
|
959 |
|
960 |
$actions = array(
|
961 |
+
/* translators: 1: Page 2: Edit action 3: Contact id 4: Wp nonce */
|
962 |
+
'edit' => sprintf( __( '<a href="?page=%1$s&action=%2$s&subscriber=%3$s&_wpnonce=%4$s" class="text-indigo-600">Edit</a>', 'email-subscribers' ), esc_attr( $page ), 'edit', absint( $item['id'] ), $delete_nonce ),
|
963 |
+
/* translators: 1: Page 2: Delete action 3: Contact id 4: Wp nonce */
|
964 |
+
'delete' => sprintf( __( '<a href="?page=%1$s&action=%2$s&subscriber=%3$s&_wpnonce=%4$s" onclick="return checkDelete()">Delete</a>', 'email-subscribers' ), esc_attr( $page ), 'delete', absint( $item['id'] ), $delete_nonce ),
|
965 |
);
|
966 |
+
/* translators: 1: Page 2: Resend action 3: Contact id 4: Wp nonce */
|
967 |
+
$actions['resend'] = sprintf( __( '<a href="?page=%1$s&action=%2$s&subscriber=%3$s&_wpnonce=%4$s" class="text-indigo-600">Resend Confirmation<a>', 'email-subscribers' ), esc_attr( ig_es_get_request_data( 'page' ) ), 'resend', absint( $item['id'] ), $delete_nonce );
|
|
|
968 |
|
969 |
return $title . $this->row_actions( $actions );
|
970 |
}
|
976 |
*
|
977 |
* @since 4.0.0
|
978 |
*/
|
979 |
+
public function get_columns() {
|
980 |
$columns = array(
|
981 |
'cb' => '<input type="checkbox"/>',
|
982 |
'name' => __( 'Name', 'email-subscribers' ),
|
1000 |
'name' => array( 'first_name', true ),
|
1001 |
'email' => array( 'email', false ),
|
1002 |
// 'status' => array( 'status', false ),
|
1003 |
+
'created_at' => array( 'created_at', false ),
|
1004 |
);
|
1005 |
|
1006 |
return $sortable_columns;
|
1018 |
'bulk_delete' => __( 'Delete', 'email-subscribers' ),
|
1019 |
'bulk_list_update' => __( 'Move To List', 'email-subscribers' ),
|
1020 |
'bulk_list_add' => __( 'Add To List', 'email-subscribers' ),
|
1021 |
+
'bulk_status_update' => __( 'Change Status', 'email-subscribers' ),
|
1022 |
);
|
1023 |
|
1024 |
return $actions;
|
1038 |
?>
|
1039 |
<p class="search-box box-ma10">
|
1040 |
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $text ); ?>:</label>
|
1041 |
+
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>"/>
|
1042 |
<?php submit_button( __( 'Search Contacts', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
1043 |
</p>
|
1044 |
<p class="search-box search-group-box box-ma10">
|
1045 |
<?php $filter_by_status = ig_es_get_request_data( 'filter_by_status' ); ?>
|
1046 |
<select name="filter_by_status">
|
1047 |
+
<?php
|
1048 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
1049 |
+
add_filter( 'safe_style_css', 'ig_es_allowed_css_style' );
|
1050 |
+
$status_types = ES_Common::prepare_statuses_dropdown_options( $filter_by_status, __( 'All Statuses', 'email-subscribers' ) );
|
1051 |
+
echo wp_kses( $status_types , $allowedtags );
|
1052 |
+
?>
|
1053 |
</select>
|
1054 |
</p>
|
1055 |
<p class="search-box search-group-box box-ma10">
|
1056 |
<?php $filter_by_list_id = ig_es_get_request_data( 'filter_by_list_id' ); ?>
|
1057 |
<select name="filter_by_list_id">
|
1058 |
+
<?php
|
1059 |
+
$lists_dropdown = ES_Common::prepare_list_dropdown_options( $filter_by_list_id, __( 'All Lists', 'email-subscribers' ) );
|
1060 |
+
echo wp_kses( $lists_dropdown , $allowedtags );
|
1061 |
+
?>
|
1062 |
</select>
|
1063 |
</p>
|
1064 |
|
1065 |
+
<?php
|
1066 |
+
}
|
1067 |
|
1068 |
/**
|
1069 |
* Get Contact id
|
1097 |
$current_page = $this->get_pagenum();
|
1098 |
$total_items = $this->get_subscribers( 0, 0, true );
|
1099 |
|
1100 |
+
$this->set_pagination_args(
|
1101 |
+
array(
|
1102 |
+
'total_items' => $total_items, // WE have to calculate the total number of items
|
1103 |
+
'per_page' => $per_page, // WE have to determine how many items to show on a page
|
1104 |
+
)
|
1105 |
+
);
|
1106 |
|
1107 |
$contacts = $this->get_subscribers( $per_page, $current_page );
|
1108 |
|
|
|
1109 |
$this->items = $contacts;
|
1110 |
|
1111 |
if ( count( $contacts ) > 0 ) {
|
1126 |
* @since 4.0.0
|
1127 |
*/
|
1128 |
public function prepare_lists_dropdown() {
|
1129 |
+
$data = '<label for="bulk-action-selector-top" class="screen-reader-text">Select bulk action</label><select name="list_id" id="list_id" class="groupsselect" style="display: none">';
|
1130 |
$data .= ES_Common::prepare_list_dropdown_options();
|
1131 |
$data .= '</select>';
|
1132 |
|
1133 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
1134 |
+
echo wp_kses( $data , $allowedtags );
|
1135 |
}
|
1136 |
|
1137 |
/**
|
1140 |
* @since 4.0.0
|
1141 |
*/
|
1142 |
public function prepare_statuses_dropdown() {
|
1143 |
+
$data = '<label for="bulk-action-selector-top" class="screen-reader-text">Select bulk action</label><select name="status_select" id="status_select" class="statusesselect" style="display:none;">';
|
1144 |
$data .= ES_Common::prepare_statuses_dropdown_options();
|
1145 |
$data .= '</select>';
|
1146 |
|
1147 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
1148 |
+
echo wp_kses( $data , $allowedtags );
|
1149 |
+
|
1150 |
}
|
1151 |
|
1152 |
/**
|
1156 |
*/
|
1157 |
public function process_bulk_action() {
|
1158 |
|
1159 |
+
// Detect when a bulk action is being triggered...
|
1160 |
if ( 'delete' === $this->current_action() ) {
|
1161 |
|
1162 |
// In our file that handles the request, verify the nonce.
|
1174 |
|
1175 |
return;
|
1176 |
}
|
|
|
1177 |
}
|
1178 |
|
1179 |
if ( 'resend' === $this->current_action() ) {
|
1200 |
} else {
|
1201 |
$response = ES()->mailer->send_double_optin_email( $email, $merge_tags );
|
1202 |
$url = add_query_arg( 'resend', true );
|
1203 |
+
// redirect to resend link and avoid resending email
|
1204 |
?>
|
1205 |
<meta http-equiv="refresh" content="0; url=<?php echo esc_url( $url ); ?>"/>
|
1206 |
<?php
|
1209 |
return;
|
1210 |
|
1211 |
}
|
|
|
1212 |
}
|
1213 |
|
1214 |
$action = ig_es_get_request_data( 'action' );
|
1330 |
|
1331 |
global $wpdb;
|
1332 |
|
1333 |
+
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}ig_contacts SET form_id = %d WHERE form_id = %d" , 0, $form_id ) );
|
|
|
|
|
|
|
|
|
1334 |
}
|
1335 |
|
1336 |
+
}
|
lite/includes/classes/class-es-cron.php
CHANGED
@@ -217,10 +217,10 @@ class ES_Cron {
|
|
217 |
public function is_locked( $key = 0 ) {
|
218 |
global $wpdb;
|
219 |
|
220 |
-
$
|
221 |
-
|
222 |
-
$res = $wpdb->get_var( $wpdb->prepare(
|
223 |
-
|
224 |
return ! ! $res;
|
225 |
}
|
226 |
|
@@ -236,7 +236,7 @@ class ES_Cron {
|
|
236 |
|
237 |
$schedules['ig_es_cron_interval'] = array(
|
238 |
'interval' => $this->get_cron_interval(),
|
239 |
-
'display' => esc_html__( 'Email Subscribers Cronjob Interval' ),
|
240 |
);
|
241 |
|
242 |
return $schedules;
|
@@ -273,7 +273,7 @@ class ES_Cron {
|
|
273 |
900 => __( '15 minutes', 'email-subscribers' ),
|
274 |
1200 => __( '20 minutes', 'email-subscribers' ),
|
275 |
1500 => __( '25 minutes', 'email-subscribers' ),
|
276 |
-
1800 => __( '30 minutes', 'email-subscribers' )
|
277 |
);
|
278 |
|
279 |
}
|
@@ -281,8 +281,8 @@ class ES_Cron {
|
|
281 |
/**
|
282 |
* Get Cron URL
|
283 |
*
|
284 |
-
* @param bool
|
285 |
-
* @param bool
|
286 |
* @param string $campaign_hash
|
287 |
*
|
288 |
* @return mixed|string|void
|
@@ -407,7 +407,7 @@ class ES_Cron {
|
|
407 |
$self = ig_es_get_request_data( 'self', 0 );
|
408 |
|
409 |
$verified_self = false;
|
410 |
-
if (
|
411 |
$verified_self = true;
|
412 |
}
|
413 |
|
@@ -415,7 +415,10 @@ class ES_Cron {
|
|
415 |
|
416 |
if ( ! empty( $guid ) ) {
|
417 |
|
418 |
-
$response = array(
|
|
|
|
|
|
|
419 |
|
420 |
$es_process_request = true;
|
421 |
|
@@ -424,9 +427,9 @@ class ES_Cron {
|
|
424 |
|
425 |
if ( true === $es_process_request ) {
|
426 |
$security1 = strlen( $guid );
|
427 |
-
$es_c_cronguid_noslash = str_replace(
|
428 |
$security2 = strlen( $es_c_cronguid_noslash );
|
429 |
-
if (
|
430 |
if ( ! preg_match( '/[^a-z]/', $es_c_cronguid_noslash ) ) {
|
431 |
$cron_url = ES()->cron->url();
|
432 |
|
@@ -470,7 +473,6 @@ class ES_Cron {
|
|
470 |
$response['status'] = 'ERROR';
|
471 |
$response['message'] = 'CRON_LOCK_ENABLED';
|
472 |
}
|
473 |
-
|
474 |
} else {
|
475 |
$self = false;
|
476 |
$response['status'] = 'ERROR';
|
@@ -496,7 +498,6 @@ class ES_Cron {
|
|
496 |
$response['status'] = 'ERROR';
|
497 |
$response['message'] = 'EMPTY_CRON_GUID';
|
498 |
}
|
499 |
-
|
500 |
} else {
|
501 |
$response['es_remaining_email_count'] = 0;
|
502 |
$response['message'] = 'PLEASE_TRY_AGAIN_LATER';
|
@@ -509,8 +510,6 @@ class ES_Cron {
|
|
509 |
$total_emails_to_be_sent = ! empty( $response['es_remaining_email_count'] ) ? $response['es_remaining_email_count'] : 0;
|
510 |
$cron_url = ES()->cron->url( true );
|
511 |
|
512 |
-
$send_now_text = __( sprintf( "<a href='%s'>Send Now</a>", $cron_url ), 'email-subscribers' );
|
513 |
-
|
514 |
if ( 'SUCCESS' === $status ) {
|
515 |
$message = __( sprintf( 'Email(s) have been sent successfully!' ), 'email-subscribers' );
|
516 |
} else {
|
217 |
public function is_locked( $key = 0 ) {
|
218 |
global $wpdb;
|
219 |
|
220 |
+
$lock = 'ig_es_cron_lock_' . $key . '%';
|
221 |
+
|
222 |
+
$res = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}options WHERE option_name LIKE %s AND option_value != ''", $lock ) ) ;
|
223 |
+
|
224 |
return ! ! $res;
|
225 |
}
|
226 |
|
236 |
|
237 |
$schedules['ig_es_cron_interval'] = array(
|
238 |
'interval' => $this->get_cron_interval(),
|
239 |
+
'display' => esc_html__( 'Email Subscribers Cronjob Interval', 'email-subscribers' ),
|
240 |
);
|
241 |
|
242 |
return $schedules;
|
273 |
900 => __( '15 minutes', 'email-subscribers' ),
|
274 |
1200 => __( '20 minutes', 'email-subscribers' ),
|
275 |
1500 => __( '25 minutes', 'email-subscribers' ),
|
276 |
+
1800 => __( '30 minutes', 'email-subscribers' ),
|
277 |
);
|
278 |
|
279 |
}
|
281 |
/**
|
282 |
* Get Cron URL
|
283 |
*
|
284 |
+
* @param bool $self
|
285 |
+
* @param bool $pro
|
286 |
* @param string $campaign_hash
|
287 |
*
|
288 |
* @return mixed|string|void
|
407 |
$self = ig_es_get_request_data( 'self', 0 );
|
408 |
|
409 |
$verified_self = false;
|
410 |
+
if ( 1 == $self && wp_verify_nonce( ig_es_get_request_data( '_wpnonce' ), 'ig_es_self_cron' ) ) {
|
411 |
$verified_self = true;
|
412 |
}
|
413 |
|
415 |
|
416 |
if ( ! empty( $guid ) ) {
|
417 |
|
418 |
+
$response = array(
|
419 |
+
'status' => 'SUCCESS',
|
420 |
+
'es_remaining_email_count' => 100,
|
421 |
+
);
|
422 |
|
423 |
$es_process_request = true;
|
424 |
|
427 |
|
428 |
if ( true === $es_process_request ) {
|
429 |
$security1 = strlen( $guid );
|
430 |
+
$es_c_cronguid_noslash = str_replace( '-', '', $guid );
|
431 |
$security2 = strlen( $es_c_cronguid_noslash );
|
432 |
+
if ( 34 == $security1 && 30 == $security2 ) {
|
433 |
if ( ! preg_match( '/[^a-z]/', $es_c_cronguid_noslash ) ) {
|
434 |
$cron_url = ES()->cron->url();
|
435 |
|
473 |
$response['status'] = 'ERROR';
|
474 |
$response['message'] = 'CRON_LOCK_ENABLED';
|
475 |
}
|
|
|
476 |
} else {
|
477 |
$self = false;
|
478 |
$response['status'] = 'ERROR';
|
498 |
$response['status'] = 'ERROR';
|
499 |
$response['message'] = 'EMPTY_CRON_GUID';
|
500 |
}
|
|
|
501 |
} else {
|
502 |
$response['es_remaining_email_count'] = 0;
|
503 |
$response['message'] = 'PLEASE_TRY_AGAIN_LATER';
|
510 |
$total_emails_to_be_sent = ! empty( $response['es_remaining_email_count'] ) ? $response['es_remaining_email_count'] : 0;
|
511 |
$cron_url = ES()->cron->url( true );
|
512 |
|
|
|
|
|
513 |
if ( 'SUCCESS' === $status ) {
|
514 |
$message = __( sprintf( 'Email(s) have been sent successfully!' ), 'email-subscribers' );
|
515 |
} else {
|
lite/includes/classes/class-es-export-subscribers.php
CHANGED
@@ -30,7 +30,7 @@ class Export_Subscribers {
|
|
30 |
$selected_list_id = ig_es_get_request_data( 'list_id', 0 );
|
31 |
|
32 |
if ( 0 === $selected_list_id ) {
|
33 |
-
$message = __(
|
34 |
ES_Common::show_message( $message, 'error' );
|
35 |
exit();
|
36 |
}
|
@@ -38,22 +38,23 @@ class Export_Subscribers {
|
|
38 |
|
39 |
$csv = $this->generate_csv( $status, $selected_list_id );
|
40 |
|
41 |
-
|
|
|
42 |
|
43 |
if ( empty( $csv ) ) {
|
44 |
-
$message = __(
|
45 |
ES_Common::show_message( $message, 'error' );
|
46 |
exit();
|
47 |
} else {
|
48 |
-
header(
|
49 |
-
header(
|
50 |
-
header(
|
51 |
-
header(
|
52 |
-
header(
|
53 |
header( "Content-Disposition: attachment; filename={$file_name};" );
|
54 |
-
header(
|
55 |
|
56 |
-
echo $csv;
|
57 |
exit;
|
58 |
}
|
59 |
}
|
@@ -72,10 +73,10 @@ class Export_Subscribers {
|
|
72 |
?>
|
73 |
|
74 |
<tr class="bg-gray-100 text-xs text-left leading-4 font-medium text-gray-500 uppercase tracking-wider border-b border-t border-gray-200 ">
|
75 |
-
<th class="w-1/12 pl-8 py-4" scope="col"><?php
|
76 |
-
<th class="w-2/12 pl-4 py-4" scope="col"><?php
|
77 |
-
<th class="w-2/12 pl-8 py-4" scope="col"><?php
|
78 |
-
<th class="w-2/12 pl-16 py-4" scope="col"><?php
|
79 |
</tr>
|
80 |
|
81 |
<?php
|
@@ -83,23 +84,24 @@ class Export_Subscribers {
|
|
83 |
|
84 |
public function prepare_body() {
|
85 |
|
86 |
-
$list_dropdown_html
|
87 |
$list_dropdown_html .= ES_Common::prepare_list_dropdown_options();
|
88 |
-
$list_dropdown_html .=
|
89 |
|
90 |
$export_lists = array(
|
91 |
|
92 |
'all' => __( 'All Contacts', 'email-subscribers' ),
|
93 |
'subscribed' => __( 'Subscribed Contacts', 'email-subscribers' ),
|
94 |
'unsubscribed' => __( 'Unsubscribed Contacts', 'email-subscribers' ),
|
95 |
-
//'confirmed' => __( 'Confirmed Contacts', 'email-subscribers' ),
|
96 |
'unconfirmed' => __( 'Unconfirmed Contacts', 'email-subscribers' ),
|
97 |
-
'select_list' => $list_dropdown_html
|
98 |
);
|
99 |
|
100 |
$i = 1;
|
101 |
foreach ( $export_lists as $key => $export_list ) {
|
102 |
-
|
|
|
103 |
if ( $i % 2 === 0 ) {
|
104 |
$class = 'alternate';
|
105 |
}*/
|
@@ -108,38 +110,43 @@ class Export_Subscribers {
|
|
108 |
|
109 |
?>
|
110 |
|
111 |
-
<tr class="border-b text-sm font-normal text-gray-700 border-gray-200" id="ig_es_export_<?php echo $key; ?>">
|
112 |
-
<td class="py-2 pl-10 w-1/12"><?php echo $i; ?></td>
|
113 |
-
<td class="py-2 pl-4 w-2/12"
|
114 |
-
|
|
|
|
|
|
|
|
|
|
|
115 |
<td class="py-2 pl-8 w-2/12">
|
116 |
-
<div class="inline-flex pl-10"><a href="<?php echo $url; ?>" id="ig_es_export_link_<?php echo $key; ?>">
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
<?php
|
125 |
-
$i ++;
|
126 |
-
}
|
127 |
|
128 |
-
|
|
|
|
|
|
|
|
|
129 |
|
130 |
-
public function export_subscribers_page() {
|
131 |
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
|
136 |
-
|
137 |
|
138 |
<div class="wrap ml-4">
|
139 |
<header class="wp-heading-inline">
|
140 |
<div class="mt-2">
|
141 |
<h2 class="text-2xl font-medium text-gray-900 sm:leading-9 sm:truncate">
|
142 |
-
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate"> <a href="admin.php?page=es_subscribers"><?php
|
143 |
<?php
|
144 |
ES_Common::prepare_main_header_navigation( $audience_tab_main_navigation );
|
145 |
?>
|
@@ -164,10 +171,13 @@ public function export_subscribers_page() {
|
|
164 |
</form>
|
165 |
</div>
|
166 |
</div>
|
167 |
-
<?php
|
|
|
168 |
|
169 |
|
170 |
/**
|
|
|
|
|
171 |
* @param string $status
|
172 |
*
|
173 |
* @return string|null
|
@@ -178,28 +188,28 @@ public function export_subscribers_page() {
|
|
178 |
|
179 |
switch ( $status ) {
|
180 |
case 'all':
|
181 |
-
|
182 |
break;
|
183 |
|
184 |
case 'subscribed':
|
185 |
-
|
186 |
break;
|
187 |
|
188 |
case 'unsubscribed':
|
189 |
-
|
190 |
break;
|
191 |
|
192 |
case 'confirmed':
|
193 |
-
|
194 |
break;
|
195 |
|
196 |
case 'unconfirmed':
|
197 |
-
|
198 |
break;
|
199 |
|
200 |
case 'select_list':
|
201 |
default:
|
202 |
-
|
203 |
break;
|
204 |
}
|
205 |
|
@@ -235,11 +245,11 @@ public function export_subscribers_page() {
|
|
235 |
<div id="icon-tools" class="icon32"></div>
|
236 |
<h2>Download Report</h2>
|
237 |
<p>
|
238 |
-
<a href="?page=download_report&report=users"><?php
|
239 |
</p>
|
240 |
|
241 |
<?php
|
242 |
-
|
243 |
|
244 |
/**
|
245 |
* Generate CSV
|
@@ -254,7 +264,14 @@ public function export_subscribers_page() {
|
|
254 |
|
255 |
global $wpdb;
|
256 |
|
257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
set_time_limit( IG_SET_TIME_LIMIT );
|
259 |
|
260 |
$email_subscribe_table = IG_CONTACTS_TABLE;
|
@@ -289,15 +306,18 @@ public function export_subscribers_page() {
|
|
289 |
$contact_list_map[ $result['contact_id'] ][] = array(
|
290 |
'status' => $result['status'],
|
291 |
'list_id' => $result['list_id'],
|
292 |
-
'optin_type' => $result['optin_type']
|
293 |
);
|
294 |
}
|
295 |
|
296 |
-
|
|
|
|
|
297 |
|
298 |
-
|
299 |
|
300 |
-
$
|
|
|
301 |
}
|
302 |
|
303 |
$csv_output = '';
|
@@ -310,11 +330,11 @@ public function export_subscribers_page() {
|
|
310 |
__( 'List', 'email-subscribers' ),
|
311 |
__( 'Status', 'email-subscribers' ),
|
312 |
__( 'Opt-In Type', 'email-subscribers' ),
|
313 |
-
__( 'Created On', 'email-subscribers' )
|
314 |
);
|
315 |
|
316 |
$lists_id_name_map = ES()->lists_db->get_list_id_name_map();
|
317 |
-
$csv_output
|
318 |
|
319 |
foreach ( $subscribers as $key => $subscriber ) {
|
320 |
|
@@ -327,10 +347,10 @@ public function export_subscribers_page() {
|
|
327 |
foreach ( $contact_list_map[ $contact_id ] as $list_details ) {
|
328 |
$data['list'] = $lists_id_name_map[ $list_details['list_id'] ];
|
329 |
$data['status'] = ucfirst( $list_details['status'] );
|
330 |
-
$data['optin_type'] = ( $list_details['optin_type']
|
331 |
$data['created_at'] = $subscriber['created_at'];
|
332 |
-
$csv_output
|
333 |
-
$csv_output
|
334 |
}
|
335 |
}
|
336 |
}
|
30 |
$selected_list_id = ig_es_get_request_data( 'list_id', 0 );
|
31 |
|
32 |
if ( 0 === $selected_list_id ) {
|
33 |
+
$message = __( 'Please Select List', 'email-subscribers' );
|
34 |
ES_Common::show_message( $message, 'error' );
|
35 |
exit();
|
36 |
}
|
38 |
|
39 |
$csv = $this->generate_csv( $status, $selected_list_id );
|
40 |
|
41 |
+
/* translators: %s : csv filename in lowercase */
|
42 |
+
$file_name = sprintf( '%s-contacts.csv', strtolower( $status ) );
|
43 |
|
44 |
if ( empty( $csv ) ) {
|
45 |
+
$message = __( 'No data available', 'email-subscribers' );
|
46 |
ES_Common::show_message( $message, 'error' );
|
47 |
exit();
|
48 |
} else {
|
49 |
+
header( 'Pragma: public' );
|
50 |
+
header( 'Expires: 0' );
|
51 |
+
header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
|
52 |
+
header( 'Cache-Control: private', false );
|
53 |
+
header( 'Content-Type: application/octet-stream' );
|
54 |
header( "Content-Disposition: attachment; filename={$file_name};" );
|
55 |
+
header( 'Content-Transfer-Encoding: binary' );
|
56 |
|
57 |
+
echo wp_kses_post( $csv );
|
58 |
exit;
|
59 |
}
|
60 |
}
|
73 |
?>
|
74 |
|
75 |
<tr class="bg-gray-100 text-xs text-left leading-4 font-medium text-gray-500 uppercase tracking-wider border-b border-t border-gray-200 ">
|
76 |
+
<th class="w-1/12 pl-8 py-4" scope="col"><?php esc_html_e( 'No.', 'email-subscribers' ); ?></th>
|
77 |
+
<th class="w-2/12 pl-4 py-4" scope="col"><?php esc_html_e( 'Contacts', 'email-subscribers' ); ?></th>
|
78 |
+
<th class="w-2/12 pl-8 py-4" scope="col"><?php esc_html_e( 'Total Contacts', 'email-subscribers' ); ?></th>
|
79 |
+
<th class="w-2/12 pl-16 py-4" scope="col"><?php esc_html_e( 'Export', 'email-subscribers' ); ?></th>
|
80 |
</tr>
|
81 |
|
82 |
<?php
|
84 |
|
85 |
public function prepare_body() {
|
86 |
|
87 |
+
$list_dropdown_html = "<select class='form-select sm:w-32 lg:w-40' name='list_id' id='ig_es_export_list_dropdown'>";
|
88 |
$list_dropdown_html .= ES_Common::prepare_list_dropdown_options();
|
89 |
+
$list_dropdown_html .= '</select>';
|
90 |
|
91 |
$export_lists = array(
|
92 |
|
93 |
'all' => __( 'All Contacts', 'email-subscribers' ),
|
94 |
'subscribed' => __( 'Subscribed Contacts', 'email-subscribers' ),
|
95 |
'unsubscribed' => __( 'Unsubscribed Contacts', 'email-subscribers' ),
|
96 |
+
// 'confirmed' => __( 'Confirmed Contacts', 'email-subscribers' ),
|
97 |
'unconfirmed' => __( 'Unconfirmed Contacts', 'email-subscribers' ),
|
98 |
+
'select_list' => $list_dropdown_html,
|
99 |
);
|
100 |
|
101 |
$i = 1;
|
102 |
foreach ( $export_lists as $key => $export_list ) {
|
103 |
+
/*
|
104 |
+
$class = '';
|
105 |
if ( $i % 2 === 0 ) {
|
106 |
$class = 'alternate';
|
107 |
}*/
|
110 |
|
111 |
?>
|
112 |
|
113 |
+
<tr class="border-b text-sm font-normal text-gray-700 border-gray-200" id="ig_es_export_<?php echo esc_attr( $key ); ?>">
|
114 |
+
<td class="py-2 pl-10 w-1/12"><?php echo esc_html( $i ); ?></td>
|
115 |
+
<td class="py-2 pl-4 w-2/12">
|
116 |
+
<?php
|
117 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
118 |
+
echo wp_kses( $export_list , $allowedtags );
|
119 |
+
?>
|
120 |
+
</td>
|
121 |
+
<td class="py-2 pl-8 w-2/12 font-medium ig_es_total_contacts"><?php echo esc_html( $this->count_subscribers( $key ) ); ?></td>
|
122 |
<td class="py-2 pl-8 w-2/12">
|
123 |
+
<div class="inline-flex pl-10"><a href="<?php echo esc_url( $url ); ?>" id="ig_es_export_link_<?php echo esc_attr( $key ); ?>">
|
124 |
+
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" class="w-8 h-8 text-indigo-600 hover:text-indigo-500 active:text-indigo-600"><path d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
|
125 |
+
</svg>
|
126 |
+
</a>
|
127 |
+
</div>
|
128 |
+
</td>
|
129 |
+
</tr>
|
|
|
|
|
|
|
|
|
130 |
|
131 |
+
<?php
|
132 |
+
$i ++;
|
133 |
+
}
|
134 |
+
|
135 |
+
}
|
136 |
|
137 |
+
public function export_subscribers_page() {
|
138 |
|
139 |
+
$audience_tab_main_navigation = array();
|
140 |
+
$active_tab = 'export';
|
141 |
+
$audience_tab_main_navigation = apply_filters( 'ig_es_audience_tab_main_navigation', $active_tab, $audience_tab_main_navigation );
|
142 |
|
143 |
+
?>
|
144 |
|
145 |
<div class="wrap ml-4">
|
146 |
<header class="wp-heading-inline">
|
147 |
<div class="mt-2">
|
148 |
<h2 class="text-2xl font-medium text-gray-900 sm:leading-9 sm:truncate">
|
149 |
+
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate"> <a href="admin.php?page=es_subscribers"><?php esc_html_e( 'Audience', 'email-subscribers' ); ?> </a> </span> <svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="w-4 h-4 mt-1 inline-block align-middle"><path d="M9 5l7 7-7 7"></path></svg> <?php esc_html_e( 'Export Contacts', 'email-subscribers' ); ?>
|
150 |
<?php
|
151 |
ES_Common::prepare_main_header_navigation( $audience_tab_main_navigation );
|
152 |
?>
|
171 |
</form>
|
172 |
</div>
|
173 |
</div>
|
174 |
+
<?php
|
175 |
+
}
|
176 |
|
177 |
|
178 |
/**
|
179 |
+
* Count total subscribers
|
180 |
+
*
|
181 |
* @param string $status
|
182 |
*
|
183 |
* @return string|null
|
188 |
|
189 |
switch ( $status ) {
|
190 |
case 'all':
|
191 |
+
return ES()->lists_contacts_db->get_all_contacts_count( 0, false );
|
192 |
break;
|
193 |
|
194 |
case 'subscribed':
|
195 |
+
return ES()->lists_contacts_db->get_subscribed_contacts_count( 0, false );
|
196 |
break;
|
197 |
|
198 |
case 'unsubscribed':
|
199 |
+
return ES()->lists_contacts_db->get_unsubscribed_contacts_count( 0, false );
|
200 |
break;
|
201 |
|
202 |
case 'confirmed':
|
203 |
+
return ES()->lists_contacts_db->get_confirmed_contacts_count( 0, false );
|
204 |
break;
|
205 |
|
206 |
case 'unconfirmed':
|
207 |
+
return ES()->lists_contacts_db->get_unconfirmed_contacts_count( 0, false );
|
208 |
break;
|
209 |
|
210 |
case 'select_list':
|
211 |
default:
|
212 |
+
return '-';
|
213 |
break;
|
214 |
}
|
215 |
|
245 |
<div id="icon-tools" class="icon32"></div>
|
246 |
<h2>Download Report</h2>
|
247 |
<p>
|
248 |
+
<a href="?page=download_report&report=users"><?php esc_html_e( 'Export the Subscribers', 'email-subscribers' ); ?></a>
|
249 |
</p>
|
250 |
|
251 |
<?php
|
252 |
+
}
|
253 |
|
254 |
/**
|
255 |
* Generate CSV
|
264 |
|
265 |
global $wpdb;
|
266 |
|
267 |
+
// Add filter to increase memory limit
|
268 |
+
add_filter( 'ig_es_memory_limit', 'ig_es_increase_memory_limit' );
|
269 |
+
|
270 |
+
wp_raise_memory_limit( 'ig_es' );
|
271 |
+
|
272 |
+
// Remove the added filter function so that it won't be called again if wp_raise_memory_limit called later on.
|
273 |
+
remove_filter( 'ig_es_memory_limit', 'ig_es_increase_memory_limit' );
|
274 |
+
|
275 |
set_time_limit( IG_SET_TIME_LIMIT );
|
276 |
|
277 |
$email_subscribe_table = IG_CONTACTS_TABLE;
|
306 |
$contact_list_map[ $result['contact_id'] ][] = array(
|
307 |
'status' => $result['status'],
|
308 |
'list_id' => $result['list_id'],
|
309 |
+
'optin_type' => $result['optin_type'],
|
310 |
);
|
311 |
}
|
312 |
|
313 |
+
//$contact_ids_str = "'" . implode( "' , '", $contact_ids ) . "' ";
|
314 |
+
|
315 |
+
//$query = "SELECT `id`, `first_name`, `last_name`, `email`, `created_at` FROM {$email_subscribe_table} WHERE id IN ({$contact_ids_str})";
|
316 |
|
317 |
+
//$subscribers = $wpdb->get_results( $query, ARRAY_A );
|
318 |
|
319 |
+
$contact_ids_str = implode( ',', $contact_ids );
|
320 |
+
$subscribers = $wpdb->get_results( $wpdb->prepare( "SELECT id, first_name, last_name, email, created_at FROM {$wpdb->prefix}ig_contacts WHERE FIND_IN_SET(ID, %s)", $contact_ids_str ), ARRAY_A );
|
321 |
}
|
322 |
|
323 |
$csv_output = '';
|
330 |
__( 'List', 'email-subscribers' ),
|
331 |
__( 'Status', 'email-subscribers' ),
|
332 |
__( 'Opt-In Type', 'email-subscribers' ),
|
333 |
+
__( 'Created On', 'email-subscribers' ),
|
334 |
);
|
335 |
|
336 |
$lists_id_name_map = ES()->lists_db->get_list_id_name_map();
|
337 |
+
$csv_output .= implode( ',', $headers );
|
338 |
|
339 |
foreach ( $subscribers as $key => $subscriber ) {
|
340 |
|
347 |
foreach ( $contact_list_map[ $contact_id ] as $list_details ) {
|
348 |
$data['list'] = $lists_id_name_map[ $list_details['list_id'] ];
|
349 |
$data['status'] = ucfirst( $list_details['status'] );
|
350 |
+
$data['optin_type'] = ( 1 == $list_details['optin_type'] ) ? 'Single Opt-In' : 'Double Opt-In';
|
351 |
$data['created_at'] = $subscriber['created_at'];
|
352 |
+
$csv_output .= "\n";
|
353 |
+
$csv_output .= '"' . implode( '","', $data ) . '"';
|
354 |
}
|
355 |
}
|
356 |
}
|
lite/includes/classes/class-es-form-widget.php
CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
class ES_Form_Widget extends WP_Widget {
|
9 |
|
10 |
-
function __construct() {
|
11 |
parent::__construct( 'email-subscribers-form', __( 'Email Subscribers', 'email-subscribers' ), array( 'description' => __( 'Email Subscribers Form', 'email-subscribers' ) ) );
|
12 |
}
|
13 |
|
@@ -17,10 +17,10 @@ class ES_Form_Widget extends WP_Widget {
|
|
17 |
|
18 |
$title = apply_filters( 'widget_title', $title );
|
19 |
|
20 |
-
echo $args['before_widget'];
|
21 |
|
22 |
if ( ! empty( $title ) ) {
|
23 |
-
echo $args['before_title']
|
24 |
}
|
25 |
|
26 |
$form_id = isset( $instance['form_id'] ) ? esc_attr( $instance['form_id'] ) : 0;
|
@@ -54,7 +54,7 @@ class ES_Form_Widget extends WP_Widget {
|
|
54 |
|
55 |
ES_Shortcode::render_form( $data );
|
56 |
|
57 |
-
echo $args['after_widget'];
|
58 |
}
|
59 |
|
60 |
public function form( $instance ) {
|
@@ -62,16 +62,20 @@ class ES_Form_Widget extends WP_Widget {
|
|
62 |
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
63 |
?>
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
<?php
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
75 |
<?php
|
76 |
}
|
77 |
|
@@ -82,4 +86,4 @@ class ES_Form_Widget extends WP_Widget {
|
|
82 |
|
83 |
return $instance;
|
84 |
}
|
85 |
-
}
|
7 |
|
8 |
class ES_Form_Widget extends WP_Widget {
|
9 |
|
10 |
+
public function __construct() {
|
11 |
parent::__construct( 'email-subscribers-form', __( 'Email Subscribers', 'email-subscribers' ), array( 'description' => __( 'Email Subscribers Form', 'email-subscribers' ) ) );
|
12 |
}
|
13 |
|
17 |
|
18 |
$title = apply_filters( 'widget_title', $title );
|
19 |
|
20 |
+
echo wp_kses_post( $args['before_widget'] );
|
21 |
|
22 |
if ( ! empty( $title ) ) {
|
23 |
+
echo wp_kses_post( sprintf( '%s %s %s', $args['before_title'] , $title , $args['after_title']) );
|
24 |
}
|
25 |
|
26 |
$form_id = isset( $instance['form_id'] ) ? esc_attr( $instance['form_id'] ) : 0;
|
54 |
|
55 |
ES_Shortcode::render_form( $data );
|
56 |
|
57 |
+
echo wp_kses_post( $args['after_widget'] );
|
58 |
}
|
59 |
|
60 |
public function form( $instance ) {
|
62 |
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
63 |
?>
|
64 |
|
65 |
+
<p>
|
66 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Widget Title:', 'email-subscribers' ); ?></label>
|
67 |
+
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
|
68 |
+
</p>
|
69 |
+
<p>
|
70 |
+
<label for="widget-email-subscribers-2-es_group"><?php esc_html_e( 'Forms', 'email-subscribers' ); ?></label>
|
71 |
+
<select id="<?php echo esc_attr( $this->get_field_id( 'form_id' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'form_id' ) ); ?>" class="widefat" style="width:100%;">
|
72 |
+
<?php
|
73 |
+
$form_dropdown = ES_Common::prepare_form_dropdown_options( $selected_form_id, null );
|
74 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
75 |
+
echo wp_kses( $form_dropdown , $allowedtags );
|
76 |
+
?>
|
77 |
+
</select>
|
78 |
+
</p>
|
79 |
<?php
|
80 |
}
|
81 |
|
86 |
|
87 |
return $instance;
|
88 |
}
|
89 |
+
}
|
lite/includes/classes/class-es-forms-table.php
CHANGED
@@ -6,15 +6,16 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
}
|
7 |
|
8 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
9 |
-
require_once
|
10 |
}
|
11 |
|
12 |
class ES_Forms_Table extends WP_List_Table {
|
13 |
|
14 |
/**
|
|
|
|
|
15 |
* @since 4.2.1
|
16 |
* @var string
|
17 |
-
*
|
18 |
*/
|
19 |
public static $option_per_page = 'es_forms_per_page';
|
20 |
|
@@ -23,7 +24,6 @@ class ES_Forms_Table extends WP_List_Table {
|
|
23 |
*
|
24 |
* @since 4.3.1
|
25 |
* @var $db
|
26 |
-
*
|
27 |
*/
|
28 |
protected $db;
|
29 |
|
@@ -34,12 +34,14 @@ class ES_Forms_Table extends WP_List_Table {
|
|
34 |
*/
|
35 |
public function __construct() {
|
36 |
|
37 |
-
parent::__construct(
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
43 |
|
44 |
$this->db = new ES_DB_Forms();
|
45 |
}
|
@@ -55,7 +57,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
55 |
$args = array(
|
56 |
'label' => __( 'Number of forms per page', 'email-subscribers' ),
|
57 |
'default' => 20,
|
58 |
-
'option' => self::$option_per_page
|
59 |
);
|
60 |
|
61 |
add_screen_option( $option, $args );
|
@@ -72,30 +74,31 @@ class ES_Forms_Table extends WP_List_Table {
|
|
72 |
$action = ig_es_get_request_data( 'action' );
|
73 |
?>
|
74 |
<div class="wrap">
|
75 |
-
<?php
|
|
|
76 |
$this->es_new_form_callback();
|
77 |
} elseif ( 'edit' === $action ) {
|
78 |
$form = ig_es_get_request_data( 'form' );
|
79 |
-
echo $this->edit_form( absint( $form ) );
|
80 |
-
} else {
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
92 |
ES_Common::show_message( $message, 'success' );
|
93 |
-
|
94 |
-
|
95 |
-
$message = __( 'Form has been updated successfully!', 'email-subscribers' );
|
96 |
ES_Common::show_message( $message, 'success' );
|
97 |
-
|
98 |
-
|
99 |
<div id="poststuff" class="es-items-lists">
|
100 |
<div id="post-body" class="metabox-holder column-1">
|
101 |
<div id="post-body-content">
|
@@ -103,7 +106,8 @@ class ES_Forms_Table extends WP_List_Table {
|
|
103 |
<form method="post">
|
104 |
<?php
|
105 |
$this->prepare_items();
|
106 |
-
$this->display();
|
|
|
107 |
</form>
|
108 |
</div>
|
109 |
|
@@ -112,7 +116,8 @@ class ES_Forms_Table extends WP_List_Table {
|
|
112 |
<br class="clear">
|
113 |
</div>
|
114 |
</div>
|
115 |
-
|
|
|
116 |
}
|
117 |
|
118 |
public function validate_data( $data ) {
|
@@ -143,7 +148,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
143 |
|
144 |
$response = array(
|
145 |
'status' => $status,
|
146 |
-
'message' => $message
|
147 |
);
|
148 |
|
149 |
return $response;
|
@@ -160,14 +165,14 @@ class ES_Forms_Table extends WP_List_Table {
|
|
160 |
$form_data = ig_es_get_request_data( 'form_data', array(), false );
|
161 |
$lists = ig_es_get_request_data( 'lists' );
|
162 |
|
163 |
-
$form_data['captcha'] = ! empty($form_data['captcha']) ? $form_data['captcha'] : 'no';
|
164 |
|
165 |
$form_data['lists'] = $lists;
|
166 |
|
167 |
$validate_data = array(
|
168 |
'nonce' => $nonce,
|
169 |
'name' => ! empty( $form_data['name'] ) ? sanitize_text_field( $form_data['name'] ) : '',
|
170 |
-
'lists' => ! empty( $form_data['lists'] ) ? $form_data['lists'] : array()
|
171 |
);
|
172 |
|
173 |
$response = $this->validate_data( $validate_data );
|
@@ -197,7 +202,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
197 |
|
198 |
$form_data = array();
|
199 |
|
200 |
-
$data = $wpdb->
|
201 |
|
202 |
if ( count( $data ) > 0 ) {
|
203 |
|
@@ -209,14 +214,14 @@ class ES_Forms_Table extends WP_List_Table {
|
|
209 |
$form_data = ig_es_get_request_data( 'form_data', array(), false );
|
210 |
$lists = ig_es_get_request_data( 'lists' );
|
211 |
|
212 |
-
$form_data['captcha'] = ! empty($form_data['captcha']) ? $form_data['captcha'] : 'no';
|
213 |
|
214 |
$form_data['lists'] = $lists;
|
215 |
|
216 |
$validate_data = array(
|
217 |
'nonce' => $nonce,
|
218 |
'name' => $form_data['name'],
|
219 |
-
'lists' => $form_data['lists']
|
220 |
);
|
221 |
|
222 |
$response = $this->validate_data( $validate_data );
|
@@ -233,7 +238,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
233 |
$form_url = admin_url( 'admin.php?page=es_forms&action=form_updated' );
|
234 |
wp_safe_redirect( $form_url );
|
235 |
exit();
|
236 |
-
|
237 |
} else {
|
238 |
|
239 |
$data = $data[0];
|
@@ -272,7 +277,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
272 |
$form_data['lists'] = ! empty( $data['lists'] ) ? $data['lists'] : array();
|
273 |
$form_data['af_id'] = ! empty( $data['af_id'] ) ? $data['af_id'] : 0;
|
274 |
$form_data['desc'] = ! empty( $data['desc'] ) ? sanitize_text_field( $data['desc'] ) : '';
|
275 |
-
$form_data['captcha']
|
276 |
|
277 |
$lists = ES()->lists_db->get_list_id_name_map();
|
278 |
$nonce = wp_create_nonce( 'es_form' );
|
@@ -285,12 +290,12 @@ class ES_Forms_Table extends WP_List_Table {
|
|
285 |
<div class="flex-1 min-w-0">
|
286 |
<h1 class="text-2xl leading-7 text-gray-900 sm:leading-9 sm:truncate">
|
287 |
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate">
|
288 |
-
<a href="admin.php?page=es_forms"><?php
|
289 |
<?php
|
290 |
if ( $is_new ) {
|
291 |
-
|
292 |
} else {
|
293 |
-
|
294 |
}
|
295 |
|
296 |
?>
|
@@ -303,19 +308,19 @@ class ES_Forms_Table extends WP_List_Table {
|
|
303 |
<div id="post-body" class="metabox-holder column-1">
|
304 |
<div id="post-body-content">
|
305 |
<div class="bg-white shadow-md rounded-lg">
|
306 |
-
<form class="pt-8 ml-5 mr-4 text-left flex-row mt-2 item-center " method="post" action="admin.php?page=es_forms&action=<?php echo $action; ?>&form=<?php echo $id; ?>&_wpnonce=<?php echo $nonce; ?>">
|
307 |
|
308 |
|
309 |
<div class="flex flex-row border-b border-gray-100">
|
310 |
<div class="flex w-1/5">
|
311 |
<div class="ml-4 pt-6">
|
312 |
-
<label for="tag-link"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
313 |
</div>
|
314 |
</div>
|
315 |
<div class="flex">
|
316 |
<div class="ml-16 mb-4 h-10 mr-4 mt-4">
|
317 |
<div class="h-10 relative">
|
318 |
-
<input id="ig_es_title" class="form-input block border-gray-400 w-full pl-3 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" placeholder="Enter form name" name="form_data[name]" value="<?php echo stripslashes( $form_data['name'] ); ?>" size="30" maxlength="100"/>
|
319 |
</div>
|
320 |
</div>
|
321 |
</div>
|
@@ -323,13 +328,13 @@ class ES_Forms_Table extends WP_List_Table {
|
|
323 |
<div class="flex flex-row border-b border-gray-100">
|
324 |
<div class="flex w-1/5">
|
325 |
<div class="ml-4 pt-6">
|
326 |
-
<label for="tag-link"><span class="block pt-1 ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
327 |
</div>
|
328 |
</div>
|
329 |
<div class="flex ">
|
330 |
<div class="ml-16 mb-4 h-10 mr-4 mt-4">
|
331 |
<div class="h-10 relative ">
|
332 |
-
<input id="ig_es_title" class="form-input block border-gray-400 w-full pl-3 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" placeholder="Enter description" name="form_data[desc]" id="ig_es_title" value="<?php echo stripslashes( $form_data['desc'] ); ?>" size="30" />
|
333 |
</div>
|
334 |
</div>
|
335 |
</div>
|
@@ -337,21 +342,21 @@ class ES_Forms_Table extends WP_List_Table {
|
|
337 |
<div class="flex flex-row border-b border-gray-100">
|
338 |
<div class="flex w-1/5">
|
339 |
<div class="ml-4 pt-4 mb-2">
|
340 |
-
<label for="tag-link"><span class="block ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
341 |
</div>
|
342 |
</div>
|
343 |
<div class="flex ">
|
344 |
<div class="ml-16 mr-4 mt-4">
|
345 |
<table class="ig-es-form-table">
|
346 |
<tr class="form-field">
|
347 |
-
<td class="pr-6 pb-8"><b class=" font-medium text-gray-500 pb-2"><?php
|
348 |
-
<td class="pr-6 pb-8"><b class=" font-medium text-gray-500 pb-2"><?php
|
349 |
-
<td class="pr-6 pb-8"><b class=" font-medium text-gray-500 pb-2"><?php
|
350 |
-
<td class="pr-6 pb-8"><b class=" font-medium text-gray-500 pb-2"><?php
|
351 |
-
<td class="pr-6 pb-8"><b class="font-medium text-gray-500 pb-2"><?php
|
352 |
</tr>
|
353 |
<tr class="form-field ">
|
354 |
-
<td class="pr-6 pb-8"><b class="text-gray-500 text-sm font-normal pb-2"><?php
|
355 |
<td class="pr-6 pb-8">
|
356 |
<input type="checkbox" class="form-checkbox opacity-0" name="form_data[email_visible]" value="yes" disabled="disabled" checked="checked" />
|
357 |
</td>
|
@@ -361,37 +366,53 @@ class ES_Forms_Table extends WP_List_Table {
|
|
361 |
<input type="checkbox" class="form-checkbox opacity-0" name="form_data[email_required]" value="yes" disabled="disabled" checked="checked"></td>
|
362 |
|
363 |
<td class="pr-6 pb-8">
|
364 |
-
<input class="form-input block border-gray-400 w-5/6 pr-12 h-8 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" name="form_data[email_label]" value="<?php echo $form_data['email_label']; ?>">
|
365 |
</td>
|
366 |
<td class="pr-6 pb-8">
|
367 |
-
<input class="form-input block border-gray-400 w-5/6 pr-12 h-8 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" name="form_data[email_place_holder]" value="<?php echo $form_data['email_place_holder']; ?>">
|
368 |
</td>
|
369 |
</tr>
|
370 |
<tr class="form-field">
|
371 |
-
<td class="pr-6 pb-8"><b class="text-gray-500 text-sm font-normal pb-2"><?php
|
372 |
|
373 |
<td class="pr-6 pb-8">
|
374 |
-
<input type="checkbox" class="form-checkbox es_visible" name="form_data[name_visible]" value="yes"
|
|
|
|
|
375 |
echo 'checked="checked"';
|
376 |
-
}
|
|
|
|
|
377 |
</td>
|
378 |
<td class="pr-6 pb-8">
|
379 |
-
<input type="checkbox" class="form-checkbox es_required" name="form_data[name_required]" value="yes"
|
380 |
-
|
381 |
-
|
|
|
|
|
|
|
|
|
382 |
</td>
|
383 |
-
<td class="pr-6 pb-8"><input class="es_name_label form-input block border-gray-400 w-5/6 pr-12 h-8 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" name="form_data[name_label]" value="<?php echo $form_data['name_label']; ?>"
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
</tr>
|
390 |
<tr class="form-field">
|
391 |
-
<td class="pr-6 pb-6"><b class="text-gray-500 text-sm font-normal pb-2"><?php
|
392 |
<td class="pr-6 pb-6"><input type="checkbox" class="form-checkbox" name="form_data[button_visible]" value="yes" disabled="disabled" checked="checked"></td>
|
393 |
<td class="pr-6 pb-6"><input type="checkbox" class="form-checkbox" name="form_data[button_required]" value="yes" disabled="disabled" checked="checked"></td>
|
394 |
-
<td class="pr-6 pb-6"><input class="form-input block border-gray-400 w-5/6 pr-12 h-8 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" name="form_data[button_label]" value="<?php echo $form_data['button_label']; ?>"></td>
|
395 |
</tr>
|
396 |
|
397 |
</table>
|
@@ -401,22 +422,27 @@ class ES_Forms_Table extends WP_List_Table {
|
|
401 |
<div class="flex flex-row border-b border-gray-100">
|
402 |
<div class="flex w-1/5">
|
403 |
<div class="ml-4 pt-4 mb-2">
|
404 |
-
<label for="tag-link"><span class="block ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
405 |
-
<p class="italic text-xs text-gray-400 mt-2 ml-4 leading-snug pb-8"><?php
|
406 |
</div>
|
407 |
</div>
|
408 |
<div class="flex">
|
409 |
<div class="ml-16 mb-6 mr-4 mt-4">
|
410 |
<?php
|
411 |
-
|
412 |
if ( count( $lists ) > 0 ) {
|
413 |
-
|
414 |
-
echo
|
415 |
|
416 |
} else {
|
417 |
$create_list_link = admin_url( 'admin.php?page=es_lists&action=new' );
|
418 |
?>
|
419 |
-
<span><b class="text-sm font-normal text-gray-600 pb-2"
|
|
|
|
|
|
|
|
|
|
|
420 |
<?php } ?>
|
421 |
</div>
|
422 |
</div>
|
@@ -425,19 +451,22 @@ class ES_Forms_Table extends WP_List_Table {
|
|
425 |
<div class="flex flex-row border-b border-gray-100">
|
426 |
<div class="flex w-1/5">
|
427 |
<div class="ml-4 pt-4 mb-2">
|
428 |
-
<label for="tag-link"><span class="block ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
429 |
-
<p class="italic text-xs text-gray-400 mt-2 ml-4 leading-snug pb-4"><?php
|
430 |
</div>
|
431 |
</div>
|
432 |
<div class="flex ">
|
433 |
<div class="ml-16 mb-4 mr-4 mt-12">
|
434 |
<label for="allow_contact" class=" inline-flex items-center cursor-pointer">
|
435 |
<span class="relative">
|
436 |
-
<input id="allow_contact" type="checkbox" class=" absolute es-check-toggle opacity-0 w-0 h-0" name="form_data[list_visible]" value="yes"
|
|
|
|
|
437 |
echo 'checked="checked"';
|
438 |
}
|
439 |
|
440 |
-
?>
|
|
|
441 |
|
442 |
<span class="relative es-mail-toggle-line block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
443 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline "></span>
|
@@ -450,14 +479,14 @@ class ES_Forms_Table extends WP_List_Table {
|
|
450 |
</div>
|
451 |
|
452 |
|
453 |
-
<?php do_action('ig_es_add_additional_options', $form_data)
|
454 |
|
455 |
|
456 |
<div class="flex flex-row border-b border-gray-100">
|
457 |
<div class="flex w-1/5">
|
458 |
<div class="ml-4 pt-4 mb-2">
|
459 |
-
<label for="tag-link"><span class="block ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php
|
460 |
-
<p class="italic text-xs text-gray-400 mt-2 ml-4 leading-snug pb-8"><?php
|
461 |
</div>
|
462 |
</div>
|
463 |
<div class="flex ">
|
@@ -467,10 +496,13 @@ class ES_Forms_Table extends WP_List_Table {
|
|
467 |
<td>
|
468 |
<label for="gdpr_consent" class=" inline-flex items-center cursor-pointer">
|
469 |
<span class="relative">
|
470 |
-
<input id="gdpr_consent" type="checkbox" class="absolute es-check-toggle opacity-0 w-0 h-0" name="form_data[gdpr_consent]" value="yes"
|
|
|
|
|
471 |
echo 'checked="checked"';
|
472 |
}
|
473 |
-
?>
|
|
|
474 |
|
475 |
<span class="relative es-mail-toggle-line block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
476 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline "></span>
|
@@ -480,30 +512,28 @@ class ES_Forms_Table extends WP_List_Table {
|
|
480 |
</tr>
|
481 |
<tr>
|
482 |
<td>
|
483 |
-
<textarea class="form-textarea" rows="2" cols="50" name="form_data[gdpr_consent_text]"><?php echo $form_data['gdpr_consent_text']; ?></textarea>
|
484 |
-
<p class="italic text-xs text-gray-400 mt-2 leading-snug pb-4"><?php
|
485 |
</td>
|
486 |
</tr>
|
487 |
</table>
|
488 |
</div>
|
489 |
</div>
|
490 |
</div>
|
491 |
-
<input type="hidden" name="form_data[af_id]" value="<?php echo $form_data['af_id']; ?>"/>
|
492 |
<input type="hidden" name="submitted" value="submitted"/>
|
493 |
-
<?php
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
?>"/>
|
502 |
-
<a href="admin.php?page=es_forms" class="cursor-pointer align-middle rounded-md border border-indigo-600 hover:shadow-md focus:outline-none focus:shadow-outline-indigo text-sm leading-5 font-medium transition ease-in-out duration-150 px-4 my-2 py-2 mx-2 ">Cancel</a></p>
|
503 |
-
<?php } else {
|
504 |
$lists_page_url = admin_url( 'admin.php?page=es_lists' );
|
505 |
-
|
506 |
-
$
|
|
|
507 |
ES_Common::show_message( $message, $status );
|
508 |
}
|
509 |
?>
|
@@ -516,171 +546,171 @@ class ES_Forms_Table extends WP_List_Table {
|
|
516 |
|
517 |
<?php
|
518 |
|
519 |
-
|
520 |
|
521 |
-
|
522 |
|
523 |
-
|
524 |
|
525 |
-
|
526 |
|
527 |
-
|
528 |
-
|
529 |
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
|
537 |
-
|
538 |
-
|
539 |
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
|
616 |
-
|
617 |
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
|
628 |
-
|
629 |
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
|
639 |
-
|
640 |
-
|
641 |
|
642 |
-
|
643 |
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
|
650 |
-
|
651 |
-
|
652 |
|
653 |
-
|
654 |
-
|
655 |
|
656 |
-
|
657 |
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
|
685 |
/**
|
686 |
* Retrieve lists data from the database
|
@@ -692,7 +722,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
692 |
*/
|
693 |
public function get_lists( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
694 |
|
695 |
-
global $wpdb;
|
696 |
|
697 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
698 |
$order = ig_es_get_request_data( 'order' );
|
@@ -705,24 +735,25 @@ class ES_Forms_Table extends WP_List_Table {
|
|
705 |
$sql = "SELECT * FROM {$forms_table}";
|
706 |
}
|
707 |
|
708 |
-
$args
|
|
|
709 |
|
710 |
$add_where_clause = false;
|
711 |
|
712 |
if ( ! empty( $search ) ) {
|
713 |
-
$query[] =
|
714 |
-
$args[] =
|
715 |
|
716 |
$add_where_clause = true;
|
717 |
}
|
718 |
|
719 |
if ( $add_where_clause ) {
|
720 |
-
$sql .=
|
721 |
|
722 |
if ( count( $query ) > 0 ) {
|
723 |
-
$sql .= implode(
|
724 |
if ( count( $args ) > 0 ) {
|
725 |
-
$sql = $
|
726 |
}
|
727 |
}
|
728 |
}
|
@@ -750,9 +781,9 @@ class ES_Forms_Table extends WP_List_Table {
|
|
750 |
$sql .= " LIMIT $per_page";
|
751 |
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
|
752 |
|
753 |
-
$result = $
|
754 |
} else {
|
755 |
-
$result = $
|
756 |
}
|
757 |
|
758 |
return $result;
|
@@ -761,7 +792,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
761 |
/**
|
762 |
* Render a column when no column specific method exist.
|
763 |
*
|
764 |
-
* @param array
|
765 |
* @param string $column_name
|
766 |
*
|
767 |
* @return mixed
|
@@ -769,17 +800,17 @@ class ES_Forms_Table extends WP_List_Table {
|
|
769 |
public function column_default( $item, $column_name ) {
|
770 |
switch ( $column_name ) {
|
771 |
// case 'status':
|
772 |
-
//
|
773 |
case 'created_at':
|
774 |
-
|
775 |
break;
|
776 |
case 'shortcode':
|
777 |
-
|
778 |
|
779 |
-
|
780 |
break;
|
781 |
default:
|
782 |
-
|
783 |
}
|
784 |
}
|
785 |
|
@@ -790,9 +821,10 @@ class ES_Forms_Table extends WP_List_Table {
|
|
790 |
*
|
791 |
* @return string
|
792 |
*/
|
793 |
-
function column_cb( $item ) {
|
794 |
return sprintf(
|
795 |
-
'<input type="checkbox" name="forms[]" value="%s" />',
|
|
|
796 |
);
|
797 |
}
|
798 |
|
@@ -803,7 +835,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
803 |
*
|
804 |
* @return string
|
805 |
*/
|
806 |
-
function column_name( $item ) {
|
807 |
|
808 |
$list_nonce = wp_create_nonce( 'es_form' );
|
809 |
|
@@ -811,8 +843,10 @@ class ES_Forms_Table extends WP_List_Table {
|
|
811 |
|
812 |
$page = ig_es_get_request_data( 'page' );
|
813 |
$actions = array(
|
814 |
-
|
815 |
-
'
|
|
|
|
|
816 |
);
|
817 |
|
818 |
return $title . $this->row_actions( $actions );
|
@@ -824,12 +858,12 @@ class ES_Forms_Table extends WP_List_Table {
|
|
824 |
*
|
825 |
* @return array
|
826 |
*/
|
827 |
-
function get_columns() {
|
828 |
$columns = array(
|
829 |
'cb' => '<input type="checkbox" />',
|
830 |
'name' => __( 'Name', 'email-subscribers' ),
|
831 |
'shortcode' => __( 'Shortcode', 'email-subscribers' ),
|
832 |
-
'created_at' => __( 'Created', 'email-subscribers' )
|
833 |
);
|
834 |
|
835 |
return $columns;
|
@@ -857,7 +891,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
857 |
*/
|
858 |
public function get_bulk_actions() {
|
859 |
return array(
|
860 |
-
'bulk_delete' => __( 'Delete', 'email-subscribers' )
|
861 |
);
|
862 |
}
|
863 |
|
@@ -870,13 +904,15 @@ class ES_Forms_Table extends WP_List_Table {
|
|
870 |
* @since 4.0.0
|
871 |
* @since 4.3.4 Added esc_attr()
|
872 |
*/
|
873 |
-
public function search_box( $text, $input_id ) {
|
|
|
874 |
<p class="search-box">
|
875 |
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $text ); ?>:</label>
|
876 |
-
<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
|
877 |
<?php submit_button( __( 'Search Forms', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
878 |
</p>
|
879 |
-
|
|
|
880 |
|
881 |
/**
|
882 |
* Handles data query and filter, sorting, and pagination.
|
@@ -895,10 +931,12 @@ class ES_Forms_Table extends WP_List_Table {
|
|
895 |
$current_page = $this->get_pagenum();
|
896 |
$total_items = $this->get_lists( 0, 0, true );
|
897 |
|
898 |
-
$this->set_pagination_args(
|
899 |
-
|
900 |
-
|
901 |
-
|
|
|
|
|
902 |
|
903 |
$this->items = $this->get_lists( $per_page, $current_page );
|
904 |
}
|
@@ -948,7 +986,7 @@ class ES_Forms_Table extends WP_List_Table {
|
|
948 |
|
949 |
$statuses = array(
|
950 |
'enable' => __( 'Enable', 'email-subscribers' ),
|
951 |
-
'disable' => __( 'Disable', 'email-subscribers' )
|
952 |
);
|
953 |
|
954 |
if ( ! in_array( $status, array_keys( $statuses ) ) ) {
|
@@ -960,6 +998,6 @@ class ES_Forms_Table extends WP_List_Table {
|
|
960 |
|
961 |
/** Text displayed when no list data is available */
|
962 |
public function no_items() {
|
963 |
-
|
964 |
}
|
965 |
-
}
|
6 |
}
|
7 |
|
8 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
9 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
10 |
}
|
11 |
|
12 |
class ES_Forms_Table extends WP_List_Table {
|
13 |
|
14 |
/**
|
15 |
+
* Number of form options per page
|
16 |
+
*
|
17 |
* @since 4.2.1
|
18 |
* @var string
|
|
|
19 |
*/
|
20 |
public static $option_per_page = 'es_forms_per_page';
|
21 |
|
24 |
*
|
25 |
* @since 4.3.1
|
26 |
* @var $db
|
|
|
27 |
*/
|
28 |
protected $db;
|
29 |
|
34 |
*/
|
35 |
public function __construct() {
|
36 |
|
37 |
+
parent::__construct(
|
38 |
+
array(
|
39 |
+
'singular' => __( 'Forms', 'email-subscribers' ), // singular name of the listed records
|
40 |
+
'plural' => __( 'Forms', 'email-subscribers' ), // plural name of the listed records
|
41 |
+
'ajax' => false, // does this table support ajax?,
|
42 |
+
'screen' => 'es_forms',
|
43 |
+
)
|
44 |
+
);
|
45 |
|
46 |
$this->db = new ES_DB_Forms();
|
47 |
}
|
57 |
$args = array(
|
58 |
'label' => __( 'Number of forms per page', 'email-subscribers' ),
|
59 |
'default' => 20,
|
60 |
+
'option' => self::$option_per_page,
|
61 |
);
|
62 |
|
63 |
add_screen_option( $option, $args );
|
74 |
$action = ig_es_get_request_data( 'action' );
|
75 |
?>
|
76 |
<div class="wrap">
|
77 |
+
<?php
|
78 |
+
if ( 'new' === $action ) {
|
79 |
$this->es_new_form_callback();
|
80 |
} elseif ( 'edit' === $action ) {
|
81 |
$form = ig_es_get_request_data( 'form' );
|
82 |
+
echo wp_kses_post( $this->edit_form( absint( $form ) ) );
|
83 |
+
} else {
|
84 |
+
?>
|
85 |
+
<h1 class=" wp-heading-inline">
|
86 |
+
<span class="text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate">
|
87 |
+
<?php esc_html_e( 'Forms', 'email-subscribers' ); ?>
|
88 |
+
<a href="admin.php?page=es_forms&action=new" class="pt-2 ig-es-title-button px-2 py-2 mx-2">
|
89 |
+
<?php esc_html_e('Add New', 'email-subscribers'); ?>
|
90 |
+
</a>
|
91 |
+
</span>
|
92 |
+
</h1>
|
93 |
+
<?php
|
94 |
+
if ( 'form_created' === $action ) {
|
95 |
+
$message = __( 'Form has been added successfully!', 'email-subscribers' );
|
96 |
ES_Common::show_message( $message, 'success' );
|
97 |
+
} elseif ( 'form_updated' === $action ) {
|
98 |
+
$message = __( 'Form has been updated successfully!', 'email-subscribers' );
|
|
|
99 |
ES_Common::show_message( $message, 'success' );
|
100 |
+
}
|
101 |
+
?>
|
102 |
<div id="poststuff" class="es-items-lists">
|
103 |
<div id="post-body" class="metabox-holder column-1">
|
104 |
<div id="post-body-content">
|
106 |
<form method="post">
|
107 |
<?php
|
108 |
$this->prepare_items();
|
109 |
+
$this->display();
|
110 |
+
?>
|
111 |
</form>
|
112 |
</div>
|
113 |
|
116 |
<br class="clear">
|
117 |
</div>
|
118 |
</div>
|
119 |
+
<?php
|
120 |
+
}
|
121 |
}
|
122 |
|
123 |
public function validate_data( $data ) {
|
148 |
|
149 |
$response = array(
|
150 |
'status' => $status,
|
151 |
+
'message' => $message,
|
152 |
);
|
153 |
|
154 |
return $response;
|
165 |
$form_data = ig_es_get_request_data( 'form_data', array(), false );
|
166 |
$lists = ig_es_get_request_data( 'lists' );
|
167 |
|
168 |
+
$form_data['captcha'] = ! empty( $form_data['captcha'] ) ? $form_data['captcha'] : 'no';
|
169 |
|
170 |
$form_data['lists'] = $lists;
|
171 |
|
172 |
$validate_data = array(
|
173 |
'nonce' => $nonce,
|
174 |
'name' => ! empty( $form_data['name'] ) ? sanitize_text_field( $form_data['name'] ) : '',
|
175 |
+
'lists' => ! empty( $form_data['lists'] ) ? $form_data['lists'] : array(),
|
176 |
);
|
177 |
|
178 |
$response = $this->validate_data( $validate_data );
|
202 |
|
203 |
$form_data = array();
|
204 |
|
205 |
+
$data = ES()->forms_db->get_by_conditions( $wpdb->prepare( ' id = %d', $id ) );
|
206 |
|
207 |
if ( count( $data ) > 0 ) {
|
208 |
|
214 |
$form_data = ig_es_get_request_data( 'form_data', array(), false );
|
215 |
$lists = ig_es_get_request_data( 'lists' );
|
216 |
|
217 |
+
$form_data['captcha'] = ! empty( $form_data['captcha'] ) ? $form_data['captcha'] : 'no';
|
218 |
|
219 |
$form_data['lists'] = $lists;
|
220 |
|
221 |
$validate_data = array(
|
222 |
'nonce' => $nonce,
|
223 |
'name' => $form_data['name'],
|
224 |
+
'lists' => $form_data['lists'],
|
225 |
);
|
226 |
|
227 |
$response = $this->validate_data( $validate_data );
|
238 |
$form_url = admin_url( 'admin.php?page=es_forms&action=form_updated' );
|
239 |
wp_safe_redirect( $form_url );
|
240 |
exit();
|
241 |
+
|
242 |
} else {
|
243 |
|
244 |
$data = $data[0];
|
277 |
$form_data['lists'] = ! empty( $data['lists'] ) ? $data['lists'] : array();
|
278 |
$form_data['af_id'] = ! empty( $data['af_id'] ) ? $data['af_id'] : 0;
|
279 |
$form_data['desc'] = ! empty( $data['desc'] ) ? sanitize_text_field( $data['desc'] ) : '';
|
280 |
+
$form_data['captcha'] = ES_Common::get_captcha_setting( 0, $data );
|
281 |
|
282 |
$lists = ES()->lists_db->get_list_id_name_map();
|
283 |
$nonce = wp_create_nonce( 'es_form' );
|
290 |
<div class="flex-1 min-w-0">
|
291 |
<h1 class="text-2xl leading-7 text-gray-900 sm:leading-9 sm:truncate">
|
292 |
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate">
|
293 |
+
<a href="admin.php?page=es_forms"><?php esc_html_e('Forms ', 'email-subscribers'); ?></a></span> <svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="w-4 h-4 inline-block align-middle"><path d="M9 5l7 7-7 7"></path></svg>
|
294 |
<?php
|
295 |
if ( $is_new ) {
|
296 |
+
esc_html_e( ' New Form', 'email-subscribers' );
|
297 |
} else {
|
298 |
+
esc_html_e( ' Edit Form', 'email-subscribers' );
|
299 |
}
|
300 |
|
301 |
?>
|
308 |
<div id="post-body" class="metabox-holder column-1">
|
309 |
<div id="post-body-content">
|
310 |
<div class="bg-white shadow-md rounded-lg">
|
311 |
+
<form class="pt-8 ml-5 mr-4 text-left flex-row mt-2 item-center " method="post" action="admin.php?page=es_forms&action=<?php echo esc_attr( $action ); ?>&form=<?php echo esc_attr( $id ); ?>&_wpnonce=<?php echo esc_attr( $nonce ); ?>">
|
312 |
|
313 |
|
314 |
<div class="flex flex-row border-b border-gray-100">
|
315 |
<div class="flex w-1/5">
|
316 |
<div class="ml-4 pt-6">
|
317 |
+
<label for="tag-link"><span class="block ml-4 pt-1 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Form Name', 'email-subscribers' ); ?></span></label>
|
318 |
</div>
|
319 |
</div>
|
320 |
<div class="flex">
|
321 |
<div class="ml-16 mb-4 h-10 mr-4 mt-4">
|
322 |
<div class="h-10 relative">
|
323 |
+
<input id="ig_es_title" class="form-input block border-gray-400 w-full pl-3 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" placeholder="Enter form name" name="form_data[name]" value="<?php echo esc_html( stripslashes( $form_data['name'] ) ); ?>" size="30" maxlength="100"/>
|
324 |
</div>
|
325 |
</div>
|
326 |
</div>
|
328 |
<div class="flex flex-row border-b border-gray-100">
|
329 |
<div class="flex w-1/5">
|
330 |
<div class="ml-4 pt-6">
|
331 |
+
<label for="tag-link"><span class="block pt-1 ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Description', 'email-subscribers' ); ?></span></label>
|
332 |
</div>
|
333 |
</div>
|
334 |
<div class="flex ">
|
335 |
<div class="ml-16 mb-4 h-10 mr-4 mt-4">
|
336 |
<div class="h-10 relative ">
|
337 |
+
<input id="ig_es_title" class="form-input block border-gray-400 w-full pl-3 pr-12 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" placeholder="Enter description" name="form_data[desc]" id="ig_es_title" value="<?php echo esc_html( stripslashes( $form_data['desc'] ) ); ?>" size="30" />
|
338 |
</div>
|
339 |
</div>
|
340 |
</div>
|
342 |
<div class="flex flex-row border-b border-gray-100">
|
343 |
<div class="flex w-1/5">
|
344 |
<div class="ml-4 pt-4 mb-2">
|
345 |
+
<label for="tag-link"><span class="block ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Form Fields', 'email-subscribers' ); ?></span></label>
|
346 |
</div>
|
347 |
</div>
|
348 |
<div class="flex ">
|
349 |
<div class="ml-16 mr-4 mt-4">
|
350 |
<table class="ig-es-form-table">
|
351 |
<tr class="form-field">
|
352 |
+
<td class="pr-6 pb-8"><b class=" font-medium text-gray-500 pb-2"><?php esc_html_e( 'Field', 'email-subscribers' ); ?></b></td>
|
353 |
+
<td class="pr-6 pb-8"><b class=" font-medium text-gray-500 pb-2"><?php esc_html_e( 'Show?', 'email-subscribers' ); ?></b></td>
|
354 |
+
<td class="pr-6 pb-8"><b class=" font-medium text-gray-500 pb-2"><?php esc_html_e( 'Required?', 'email-subscribers' ); ?></b></td>
|
355 |
+
<td class="pr-6 pb-8"><b class=" font-medium text-gray-500 pb-2"><?php esc_html_e( 'Label', 'email-subscribers' ); ?></b></td>
|
356 |
+
<td class="pr-6 pb-8"><b class="font-medium text-gray-500 pb-2"><?php esc_html_e( 'Place Holder', 'email-subscribers' ); ?></b></td>
|
357 |
</tr>
|
358 |
<tr class="form-field ">
|
359 |
+
<td class="pr-6 pb-8"><b class="text-gray-500 text-sm font-normal pb-2"><?php esc_html_e( 'Email', 'email-subscribers' ); ?></b></td>
|
360 |
<td class="pr-6 pb-8">
|
361 |
<input type="checkbox" class="form-checkbox opacity-0" name="form_data[email_visible]" value="yes" disabled="disabled" checked="checked" />
|
362 |
</td>
|
366 |
<input type="checkbox" class="form-checkbox opacity-0" name="form_data[email_required]" value="yes" disabled="disabled" checked="checked"></td>
|
367 |
|
368 |
<td class="pr-6 pb-8">
|
369 |
+
<input class="form-input block border-gray-400 w-5/6 pr-12 h-8 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" name="form_data[email_label]" value="<?php echo esc_attr( $form_data['email_label'] ); ?>">
|
370 |
</td>
|
371 |
<td class="pr-6 pb-8">
|
372 |
+
<input class="form-input block border-gray-400 w-5/6 pr-12 h-8 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" name="form_data[email_place_holder]" value="<?php echo esc_attr( $form_data['email_place_holder'] ); ?>">
|
373 |
</td>
|
374 |
</tr>
|
375 |
<tr class="form-field">
|
376 |
+
<td class="pr-6 pb-8"><b class="text-gray-500 text-sm font-normal pb-2"><?php esc_html_e( 'Name', 'email-subscribers' ); ?></b></td>
|
377 |
|
378 |
<td class="pr-6 pb-8">
|
379 |
+
<input type="checkbox" class="form-checkbox es_visible" name="form_data[name_visible]" value="yes"
|
380 |
+
<?php
|
381 |
+
if ( 'yes' === $form_data['name_visible'] ) {
|
382 |
echo 'checked="checked"';
|
383 |
+
}
|
384 |
+
?>
|
385 |
+
/>
|
386 |
</td>
|
387 |
<td class="pr-6 pb-8">
|
388 |
+
<input type="checkbox" class="form-checkbox es_required" name="form_data[name_required]" value="yes"
|
389 |
+
<?php
|
390 |
+
if ( 'yes' === $form_data['name_required'] ) {
|
391 |
+
echo 'checked="checked"';
|
392 |
+
}
|
393 |
+
?>
|
394 |
+
/>
|
395 |
</td>
|
396 |
+
<td class="pr-6 pb-8"><input class="es_name_label form-input block border-gray-400 w-5/6 pr-12 h-8 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" name="form_data[name_label]" value="<?php echo esc_attr( $form_data['name_label'] ); ?>"
|
397 |
+
<?php
|
398 |
+
if ( 'yes' === $form_data['name_required'] ) {
|
399 |
+
echo 'disabled=disabled';
|
400 |
+
}
|
401 |
+
?>
|
402 |
+
></td>
|
403 |
+
<td class="pr-6 pb-8"><input class="es_name_label form-input block border-gray-400 w-5/6 pr-12 h-8 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" name="form_data[name_place_holder]" value="<?php echo esc_attr( $form_data['name_place_holder'] ); ?>"
|
404 |
+
<?php
|
405 |
+
if ( 'yes' === $form_data['name_required'] ) {
|
406 |
+
echo 'disabled=disabled';
|
407 |
+
}
|
408 |
+
?>
|
409 |
+
></td>
|
410 |
</tr>
|
411 |
<tr class="form-field">
|
412 |
+
<td class="pr-6 pb-6"><b class="text-gray-500 text-sm font-normal pb-2"><?php esc_html_e( 'Button', 'email-subscribers' ); ?></b></td>
|
413 |
<td class="pr-6 pb-6"><input type="checkbox" class="form-checkbox" name="form_data[button_visible]" value="yes" disabled="disabled" checked="checked"></td>
|
414 |
<td class="pr-6 pb-6"><input type="checkbox" class="form-checkbox" name="form_data[button_required]" value="yes" disabled="disabled" checked="checked"></td>
|
415 |
+
<td class="pr-6 pb-6"><input class="form-input block border-gray-400 w-5/6 pr-12 h-8 shadow-sm focus:bg-gray-100 sm:text-sm sm:leading-5" name="form_data[button_label]" value="<?php echo esc_attr( $form_data['button_label'] ); ?>"></td>
|
416 |
</tr>
|
417 |
|
418 |
</table>
|
422 |
<div class="flex flex-row border-b border-gray-100">
|
423 |
<div class="flex w-1/5">
|
424 |
<div class="ml-4 pt-4 mb-2">
|
425 |
+
<label for="tag-link"><span class="block ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Lists', 'email-subscribers' ); ?></span></label>
|
426 |
+
<p class="italic text-xs text-gray-400 mt-2 ml-4 leading-snug pb-8"><?php esc_html_e( 'Contacts will be added into selected list(s)', 'email-subscribers' ); ?></p>
|
427 |
</div>
|
428 |
</div>
|
429 |
<div class="flex">
|
430 |
<div class="ml-16 mb-6 mr-4 mt-4">
|
431 |
<?php
|
432 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
433 |
if ( count( $lists ) > 0 ) {
|
434 |
+
$lists_checkboxes = ES_Shortcode::prepare_lists_checkboxes( $lists, array_keys( $lists ), 3, (array) $form_data['lists'] );
|
435 |
+
echo wp_kses( $lists_checkboxes , $allowedtags );
|
436 |
|
437 |
} else {
|
438 |
$create_list_link = admin_url( 'admin.php?page=es_lists&action=new' );
|
439 |
?>
|
440 |
+
<span><b class="text-sm font-normal text-gray-600 pb-2">
|
441 |
+
<?php
|
442 |
+
/* translators: %s: Create list page url */
|
443 |
+
echo sprintf( esc_html__('List not found. Please %s', 'email-subscribers' ), '<a href="' . esc_url( $create_list_link ) . '"> ' . esc_html( 'create your first list', 'email-subscribers') . '</a>' );
|
444 |
+
?>
|
445 |
+
</b></span>
|
446 |
<?php } ?>
|
447 |
</div>
|
448 |
</div>
|
451 |
<div class="flex flex-row border-b border-gray-100">
|
452 |
<div class="flex w-1/5">
|
453 |
<div class="ml-4 pt-4 mb-2">
|
454 |
+
<label for="tag-link"><span class="block ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Allow contact to choose list(s)', 'email-subscribers' ); ?></span></label>
|
455 |
+
<p class="italic text-xs text-gray-400 mt-2 ml-4 leading-snug pb-4"><?php esc_html_e( 'Allow contacts to choose list(s) in which they want to subscribe.', 'email-subscribers' ); ?></p>
|
456 |
</div>
|
457 |
</div>
|
458 |
<div class="flex ">
|
459 |
<div class="ml-16 mb-4 mr-4 mt-12">
|
460 |
<label for="allow_contact" class=" inline-flex items-center cursor-pointer">
|
461 |
<span class="relative">
|
462 |
+
<input id="allow_contact" type="checkbox" class=" absolute es-check-toggle opacity-0 w-0 h-0" name="form_data[list_visible]" value="yes"
|
463 |
+
<?php
|
464 |
+
if ( 'yes' === $form_data['list_visible'] ) {
|
465 |
echo 'checked="checked"';
|
466 |
}
|
467 |
|
468 |
+
?>
|
469 |
+
/>
|
470 |
|
471 |
<span class="relative es-mail-toggle-line block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
472 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline "></span>
|
479 |
</div>
|
480 |
|
481 |
|
482 |
+
<?php do_action('ig_es_add_additional_options', $form_data); ?>
|
483 |
|
484 |
|
485 |
<div class="flex flex-row border-b border-gray-100">
|
486 |
<div class="flex w-1/5">
|
487 |
<div class="ml-4 pt-4 mb-2">
|
488 |
+
<label for="tag-link"><span class="block ml-4 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Show GDPR consent checkbox', 'email-subscribers' ); ?></span></label>
|
489 |
+
<p class="italic text-xs text-gray-400 mt-2 ml-4 leading-snug pb-8"><?php esc_html_e( 'Show consent checkbox to get the consent of a contact before adding them to list(s)', 'email-subscribers' ); ?></p>
|
490 |
</div>
|
491 |
</div>
|
492 |
<div class="flex ">
|
496 |
<td>
|
497 |
<label for="gdpr_consent" class=" inline-flex items-center cursor-pointer">
|
498 |
<span class="relative">
|
499 |
+
<input id="gdpr_consent" type="checkbox" class="absolute es-check-toggle opacity-0 w-0 h-0" name="form_data[gdpr_consent]" value="yes"
|
500 |
+
<?php
|
501 |
+
if ( 'yes' === $form_data['gdpr_consent'] ) {
|
502 |
echo 'checked="checked"';
|
503 |
}
|
504 |
+
?>
|
505 |
+
/>
|
506 |
|
507 |
<span class="relative es-mail-toggle-line block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
508 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline "></span>
|
512 |
</tr>
|
513 |
<tr>
|
514 |
<td>
|
515 |
+
<textarea class="form-textarea" rows="2" cols="50" name="form_data[gdpr_consent_text]"><?php echo wp_kses_post( $form_data['gdpr_consent_text'] ); ?></textarea>
|
516 |
+
<p class="italic text-xs text-gray-400 mt-2 leading-snug pb-4"><?php esc_html_e( 'Consent text will show up at subscription form next to consent checkbox.', 'email-subscribers' ); ?></p>
|
517 |
</td>
|
518 |
</tr>
|
519 |
</table>
|
520 |
</div>
|
521 |
</div>
|
522 |
</div>
|
523 |
+
<input type="hidden" name="form_data[af_id]" value="<?php echo esc_attr( $form_data['af_id'] ); ?>"/>
|
524 |
<input type="hidden" name="submitted" value="submitted"/>
|
525 |
+
<?php
|
526 |
+
$submit_button_text = $is_new ? __( 'Save Form', 'email-subscribers' ) : __( 'Save Changes', 'email-subscribers' );
|
527 |
+
if ( count( $lists ) > 0 ) {
|
528 |
+
?>
|
529 |
+
<p class="submit"><input type="submit" name="submit" id="ig_es_campaign_post_notification_submit_button" class="cursor-pointer align-middle ig-es-primary-button px-4 py-2 ml-6 mr-2" value="<?php echo esc_attr( $submit_button_text ); ?>"/>
|
530 |
+
<a href="admin.php?page=es_forms" class="cursor-pointer align-middle rounded-md border border-indigo-600 hover:shadow-md focus:outline-none focus:shadow-outline-indigo text-sm leading-5 font-medium transition ease-in-out duration-150 px-4 my-2 py-2 mx-2 "><?php esc_html_e( 'Cancel', 'email-subscribers' ); ?></a></p>
|
531 |
+
<?php
|
532 |
+
} else {
|
|
|
|
|
|
|
533 |
$lists_page_url = admin_url( 'admin.php?page=es_lists' );
|
534 |
+
/* translators: %s: List Page url */
|
535 |
+
$message = __( sprintf( 'List(s) not found. Please create a first list from <a href="%s">here</a>', $lists_page_url ), 'email-subscribers' );
|
536 |
+
$status = 'error';
|
537 |
ES_Common::show_message( $message, $status );
|
538 |
}
|
539 |
?>
|
546 |
|
547 |
<?php
|
548 |
|
549 |
+
}
|
550 |
|
551 |
+
public function save_form( $id, $data ) {
|
552 |
|
553 |
+
global $wpdb;
|
554 |
|
555 |
+
$form_data = self::prepare_form_data( $data );
|
556 |
|
557 |
+
if ( ! empty( $id ) ) {
|
558 |
+
$form_data['updated_at'] = ig_get_current_date_time();
|
559 |
|
560 |
+
// We don't want to change the created_at date for update
|
561 |
+
unset( $form_data['created_at'] );
|
562 |
+
$return = $wpdb->update( IG_FORMS_TABLE, $form_data, array( 'id' => $id ) );
|
563 |
+
} else {
|
564 |
+
$return = $wpdb->insert( IG_FORMS_TABLE, $form_data );
|
565 |
+
}
|
566 |
|
567 |
+
return $return;
|
568 |
+
}
|
569 |
|
570 |
+
public static function prepare_form_data( $data ) {
|
571 |
+
|
572 |
+
$form_data = array();
|
573 |
+
$name = ! empty( $data['name'] ) ? sanitize_text_field( $data['name'] ) : '';
|
574 |
+
$desc = ! empty( $data['desc'] ) ? sanitize_text_field( $data['desc'] ) : '';
|
575 |
+
$email_label = ! empty( $data['email_label'] ) ? sanitize_text_field( $data['email_label'] ) : '';
|
576 |
+
$email_place_holder = ! empty( $data['email_place_holder'] ) ? sanitize_text_field( $data['email_place_holder'] ) : '';
|
577 |
+
$name_label = ! empty( $data['name_label'] ) ? sanitize_text_field( $data['name_label'] ) : '';
|
578 |
+
$name_place_holder = ! empty( $data['name_place_holder'] ) ? sanitize_text_field( $data['name_place_holder'] ) : '';
|
579 |
+
$button_label = ! empty( $data['button_label'] ) ? sanitize_text_field( $data['button_label'] ) : '';
|
580 |
+
$name_visible = ( ! empty( $data['name_visible'] ) && 'yes' === $data['name_visible'] ) ? true : false;
|
581 |
+
$name_required = ( ! empty( $data['name_required'] ) && 'yes' === $data['name_required'] ) ? true : false;
|
582 |
+
$list_visible = ( ! empty( $data['list_visible'] ) && 'yes' === $data['list_visible'] ) ? true : false;
|
583 |
+
$list_required = true;
|
584 |
+
$list_ids = ! empty( $data['lists'] ) ? $data['lists'] : array();
|
585 |
+
$af_id = ! empty( $data['af_id'] ) ? $data['af_id'] : 0;
|
586 |
+
$gdpr_consent = ! empty( $data['gdpr_consent'] ) ? sanitize_text_field( $data['gdpr_consent'] ) : 'no';
|
587 |
+
$gdpr_consent_text = ! empty( $data['gdpr_consent_text'] ) ? wp_kses_post( $data['gdpr_consent_text'] ) : '';
|
588 |
+
$captcha = ! empty( $data['captcha'] ) ? ES_Common::get_captcha_setting(null, $data) : 'no';
|
589 |
+
|
590 |
+
$body = array(
|
591 |
+
array(
|
592 |
+
'type' => 'text',
|
593 |
+
'name' => 'Name',
|
594 |
+
'id' => 'name',
|
595 |
+
'params' => array(
|
596 |
+
'label' => $name_label,
|
597 |
+
'place_holder' => $name_place_holder,
|
598 |
+
'show' => $name_visible,
|
599 |
+
'required' => $name_required
|
600 |
+
),
|
601 |
+
|
602 |
+
'position' => 1
|
603 |
+
),
|
604 |
+
|
605 |
+
array(
|
606 |
+
'type' => 'text',
|
607 |
+
'name' => 'Email',
|
608 |
+
'id' => 'email',
|
609 |
+
'params' => array(
|
610 |
+
'label' => $email_label,
|
611 |
+
'place_holder' => $email_place_holder,
|
612 |
+
'show' => true,
|
613 |
+
'required' => true
|
614 |
+
),
|
615 |
+
|
616 |
+
'position' => 2
|
617 |
+
),
|
618 |
+
|
619 |
+
array(
|
620 |
+
'type' => 'checkbox',
|
621 |
+
'name' => 'Lists',
|
622 |
+
'id' => 'lists',
|
623 |
+
'params' => array(
|
624 |
+
'label' => 'Lists',
|
625 |
+
'show' => $list_visible,
|
626 |
+
'required' => $list_required,
|
627 |
+
'values' => $list_ids
|
628 |
+
),
|
629 |
+
|
630 |
+
'position' => 3
|
631 |
+
),
|
632 |
+
|
633 |
+
array(
|
634 |
+
'type' => 'submit',
|
635 |
+
'name' => 'submit',
|
636 |
+
'id' => 'submit',
|
637 |
+
'params' => array(
|
638 |
+
'label' => $button_label,
|
639 |
+
'show' => true,
|
640 |
+
'required' => true
|
641 |
+
),
|
642 |
+
|
643 |
+
'position' => 4
|
644 |
+
),
|
645 |
|
646 |
+
);
|
647 |
|
648 |
+
$settings = array(
|
649 |
+
'lists' => $list_ids,
|
650 |
+
'desc' => $desc,
|
651 |
+
'form_version' => ES()->forms_db->version,
|
652 |
+
'captcha' => $captcha,
|
653 |
+
'gdpr' => array(
|
654 |
+
'consent' => $gdpr_consent,
|
655 |
+
'consent_text' => $gdpr_consent_text
|
656 |
+
)
|
657 |
|
658 |
+
);
|
659 |
|
660 |
+
$form_data['name'] = $name;
|
661 |
+
$form_data['body'] = maybe_serialize( $body );
|
662 |
+
$form_data['settings'] = maybe_serialize( $settings );
|
663 |
+
$form_data['styles'] = null;
|
664 |
+
$form_data['created_at'] = ig_get_current_date_time();
|
665 |
+
$form_data['updated_at'] = null;
|
666 |
+
$form_data['deleted_at'] = null;
|
667 |
+
$form_data['af_id'] = $af_id;
|
668 |
|
669 |
+
return $form_data;
|
670 |
+
}
|
671 |
|
672 |
+
public static function get_form_data_from_body( $data ) {
|
673 |
|
674 |
+
$name = ! empty( $data['name'] ) ? $data['name'] : '';
|
675 |
+
$id = ! empty( $data['id'] ) ? $data['id'] : '';
|
676 |
+
$af_id = ! empty( $data['af_id'] ) ? $data['af_id'] : '';
|
677 |
+
$body_data = maybe_unserialize( $data['body'] );
|
678 |
+
$settings_data = maybe_unserialize( $data['settings'] );
|
679 |
|
680 |
+
$desc = ! empty( $settings_data['desc'] ) ? $settings_data['desc'] : '';
|
681 |
+
$form_version = ! empty( $settings_data['form_version'] ) ? $settings_data['form_version'] : '0.1';
|
682 |
|
683 |
+
$gdpr_consent = 'no';
|
684 |
+
$gdpr_consent_text = '';
|
685 |
|
686 |
+
$captcha = ES_Common::get_captcha_setting( $id , $settings_data);
|
687 |
|
688 |
+
if ( ! empty( $settings_data['gdpr'] ) ) {
|
689 |
+
$gdpr_consent = ! empty( $settings_data['gdpr']['consent'] ) ? $settings_data['gdpr']['consent'] : 'no';
|
690 |
+
$gdpr_consent_text = ! empty( $settings_data['gdpr']['consent_text'] ) ? $settings_data['gdpr']['consent_text'] : '';
|
691 |
+
}
|
692 |
|
693 |
+
$form_data = array( 'form_id' => $id, 'name' => $name, 'af_id' => $af_id, 'desc' => $desc, 'form_version' => $form_version, 'gdpr_consent' => $gdpr_consent, 'gdpr_consent_text' => $gdpr_consent_text, 'captcha' => $captcha );
|
694 |
+
|
695 |
+
foreach ( $body_data as $d ) {
|
696 |
+
if ( 'name' === $d['id'] ) {
|
697 |
+
$form_data['name_visible'] = ( true === $d['params']['show'] ) ? 'yes' : '';
|
698 |
+
$form_data['name_required'] = ( true === $d['params']['required'] ) ? 'yes' : '';
|
699 |
+
$form_data['name_label'] = ! empty( $d['params']['label'] ) ? $d['params']['label'] : '';
|
700 |
+
$form_data['name_place_holder'] = ! empty( $d['params']['place_holder'] ) ? $d['params']['place_holder'] : '';
|
701 |
+
} elseif ( 'lists' === $d['id'] ) {
|
702 |
+
$form_data['list_visible'] = ( true === $d['params']['show'] ) ? 'yes' : '';
|
703 |
+
$form_data['list_required'] = ( true === $d['params']['required'] ) ? 'yes' : '';
|
704 |
+
$form_data['lists'] = ! empty( $d['params']['values'] ) ? $d['params']['values'] : array();
|
705 |
+
} elseif ( 'email' === $d['id'] ) {
|
706 |
+
$form_data['email_label'] = ! empty( $d['params']['label'] ) ? $d['params']['label'] : '';
|
707 |
+
$form_data['email_place_holder'] = ! empty( $d['params']['place_holder'] ) ? $d['params']['place_holder'] : '';
|
708 |
+
} elseif ( 'submit' === $d['id'] ) {
|
709 |
+
$form_data['button_label'] = ! empty( $d['params']['label'] ) ? $d['params']['label'] : '';
|
710 |
+
}
|
711 |
+
}
|
712 |
+
return $form_data;
|
713 |
+
}
|
714 |
|
715 |
/**
|
716 |
* Retrieve lists data from the database
|
722 |
*/
|
723 |
public function get_lists( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
724 |
|
725 |
+
global $wpdb, $wpbd;
|
726 |
|
727 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
728 |
$order = ig_es_get_request_data( 'order' );
|
735 |
$sql = "SELECT * FROM {$forms_table}";
|
736 |
}
|
737 |
|
738 |
+
$args = array();
|
739 |
+
$query = array();
|
740 |
|
741 |
$add_where_clause = false;
|
742 |
|
743 |
if ( ! empty( $search ) ) {
|
744 |
+
$query[] = ' name LIKE %s ';
|
745 |
+
$args[] = '%' . $wpdb->esc_like( $search ) . '%';
|
746 |
|
747 |
$add_where_clause = true;
|
748 |
}
|
749 |
|
750 |
if ( $add_where_clause ) {
|
751 |
+
$sql .= ' WHERE ';
|
752 |
|
753 |
if ( count( $query ) > 0 ) {
|
754 |
+
$sql .= implode( ' AND ', $query );
|
755 |
if ( count( $args ) > 0 ) {
|
756 |
+
$sql = $wpbd->prepare( $sql, $args );
|
757 |
}
|
758 |
}
|
759 |
}
|
781 |
$sql .= " LIMIT $per_page";
|
782 |
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
|
783 |
|
784 |
+
$result = $wpbd->get_results( $sql, 'ARRAY_A' );
|
785 |
} else {
|
786 |
+
$result = $wpbd->get_var( $sql );
|
787 |
}
|
788 |
|
789 |
return $result;
|
792 |
/**
|
793 |
* Render a column when no column specific method exist.
|
794 |
*
|
795 |
+
* @param array $item
|
796 |
* @param string $column_name
|
797 |
*
|
798 |
* @return mixed
|
800 |
public function column_default( $item, $column_name ) {
|
801 |
switch ( $column_name ) {
|
802 |
// case 'status':
|
803 |
+
// return $this->status_label_map( $item[ $column_name ] );
|
804 |
case 'created_at':
|
805 |
+
return ig_es_format_date_time( $item[ $column_name ] );
|
806 |
break;
|
807 |
case 'shortcode':
|
808 |
+
$shortcode = '[email-subscribers-form id="' . $item['id'] . '"]';
|
809 |
|
810 |
+
return '<code id="es-shortcode">' . $shortcode . '</code>';
|
811 |
break;
|
812 |
default:
|
813 |
+
return '';
|
814 |
}
|
815 |
}
|
816 |
|
821 |
*
|
822 |
* @return string
|
823 |
*/
|
824 |
+
public function column_cb( $item ) {
|
825 |
return sprintf(
|
826 |
+
'<input type="checkbox" name="forms[]" value="%s" />',
|
827 |
+
$item['id']
|
828 |
);
|
829 |
}
|
830 |
|
835 |
*
|
836 |
* @return string
|
837 |
*/
|
838 |
+
public function column_name( $item ) {
|
839 |
|
840 |
$list_nonce = wp_create_nonce( 'es_form' );
|
841 |
|
843 |
|
844 |
$page = ig_es_get_request_data( 'page' );
|
845 |
$actions = array(
|
846 |
+
/* translators: 1: Page 2: Edit Action 3: Form id 4. WP Nonce */
|
847 |
+
'edit' => sprintf( __( '<a href="?page=%1$s&action=%2$s&form=%3$s&_wpnonce=%4$s" class="text-indigo-600">Edit</a>', 'email-subscribers' ), esc_attr( $page ), 'edit', absint( $item['id'] ), $list_nonce ),
|
848 |
+
/* translators: 1: Page 2: Delete Action 3: Form id 4. WP Nonce */
|
849 |
+
'delete' => sprintf( __( '<a href="?page=%1$s&action=%2$s&form=%3$s&_wpnonce=%4$s" onclick="return checkDelete()">Delete</a>', 'email-subscribers' ), esc_attr( $page ), 'delete', absint( $item['id'] ), $list_nonce )
|
850 |
);
|
851 |
|
852 |
return $title . $this->row_actions( $actions );
|
858 |
*
|
859 |
* @return array
|
860 |
*/
|
861 |
+
public function get_columns() {
|
862 |
$columns = array(
|
863 |
'cb' => '<input type="checkbox" />',
|
864 |
'name' => __( 'Name', 'email-subscribers' ),
|
865 |
'shortcode' => __( 'Shortcode', 'email-subscribers' ),
|
866 |
+
'created_at' => __( 'Created', 'email-subscribers' ),
|
867 |
);
|
868 |
|
869 |
return $columns;
|
891 |
*/
|
892 |
public function get_bulk_actions() {
|
893 |
return array(
|
894 |
+
'bulk_delete' => __( 'Delete', 'email-subscribers' ),
|
895 |
);
|
896 |
}
|
897 |
|
904 |
* @since 4.0.0
|
905 |
* @since 4.3.4 Added esc_attr()
|
906 |
*/
|
907 |
+
public function search_box( $text, $input_id ) {
|
908 |
+
?>
|
909 |
<p class="search-box">
|
910 |
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $text ); ?>:</label>
|
911 |
+
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>"/>
|
912 |
<?php submit_button( __( 'Search Forms', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
913 |
</p>
|
914 |
+
<?php
|
915 |
+
}
|
916 |
|
917 |
/**
|
918 |
* Handles data query and filter, sorting, and pagination.
|
931 |
$current_page = $this->get_pagenum();
|
932 |
$total_items = $this->get_lists( 0, 0, true );
|
933 |
|
934 |
+
$this->set_pagination_args(
|
935 |
+
array(
|
936 |
+
'total_items' => $total_items, // WE have to calculate the total number of items
|
937 |
+
'per_page' => $per_page, // WE have to determine how many items to show on a page
|
938 |
+
)
|
939 |
+
);
|
940 |
|
941 |
$this->items = $this->get_lists( $per_page, $current_page );
|
942 |
}
|
986 |
|
987 |
$statuses = array(
|
988 |
'enable' => __( 'Enable', 'email-subscribers' ),
|
989 |
+
'disable' => __( 'Disable', 'email-subscribers' ),
|
990 |
);
|
991 |
|
992 |
if ( ! in_array( $status, array_keys( $statuses ) ) ) {
|
998 |
|
999 |
/** Text displayed when no list data is available */
|
1000 |
public function no_items() {
|
1001 |
+
esc_html_e( 'No Forms avaliable.', 'email-subscribers' );
|
1002 |
}
|
1003 |
+
}
|
lite/includes/classes/class-es-geolocation.php
CHANGED
@@ -1,4 +1,10 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
* Geolocation class
|
4 |
*
|
@@ -7,8 +13,6 @@
|
|
7 |
* @version 4.5.0
|
8 |
*/
|
9 |
|
10 |
-
defined( 'ABSPATH' ) || exit;
|
11 |
-
|
12 |
/**
|
13 |
* ES_Geolocation Class.
|
14 |
*/
|
@@ -134,7 +138,7 @@ class ES_Geolocation {
|
|
134 |
* @since 4.5.0
|
135 |
*/
|
136 |
public static function get_countries_iso_code_name_map( $country_code = '' ) {
|
137 |
-
$countries_data =
|
138 |
'AF' => 'Afghanistan',
|
139 |
'AX' => 'Aland Islands',
|
140 |
'AL' => 'Albania',
|
@@ -380,7 +384,7 @@ class ES_Geolocation {
|
|
380 |
'YE' => 'Yemen',
|
381 |
'ZM' => 'Zambia',
|
382 |
'ZW' => 'Zimbabwe',
|
383 |
-
|
384 |
|
385 |
if ( isset( $countries_data[ $country_code ] ) ) {
|
386 |
return $countries_data[ $country_code ];
|
1 |
<?php
|
2 |
+
|
3 |
+
// Exit if accessed directly
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit;
|
6 |
+
}
|
7 |
+
|
8 |
/**
|
9 |
* Geolocation class
|
10 |
*
|
13 |
* @version 4.5.0
|
14 |
*/
|
15 |
|
|
|
|
|
16 |
/**
|
17 |
* ES_Geolocation Class.
|
18 |
*/
|
138 |
* @since 4.5.0
|
139 |
*/
|
140 |
public static function get_countries_iso_code_name_map( $country_code = '' ) {
|
141 |
+
$countries_data = array(
|
142 |
'AF' => 'Afghanistan',
|
143 |
'AX' => 'Aland Islands',
|
144 |
'AL' => 'Albania',
|
384 |
'YE' => 'Yemen',
|
385 |
'ZM' => 'Zambia',
|
386 |
'ZW' => 'Zimbabwe',
|
387 |
+
);
|
388 |
|
389 |
if ( isset( $countries_data[ $country_code ] ) ) {
|
390 |
return $countries_data[ $country_code ];
|
lite/includes/classes/class-es-handle-post-notification.php
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class ES_Handle_Post_Notification {
|
4 |
|
5 |
public $is_wp_5 = false;
|
@@ -51,7 +57,7 @@ class ES_Handle_Post_Notification {
|
|
51 |
|
52 |
public function es_post_publish_callback( $post_status, $original_post_status, $post ) {
|
53 |
|
54 |
-
if ( (
|
55 |
|
56 |
if ( is_object( $post ) ) {
|
57 |
|
@@ -82,10 +88,10 @@ class ES_Handle_Post_Notification {
|
|
82 |
$template = get_post( $template_id ); // to confirm if template exists in ES->Templates
|
83 |
if ( is_object( $template ) ) {
|
84 |
$list_id = $notification['list_ids'];
|
85 |
-
$list_id
|
86 |
$subscribers = ES()->contacts_db->get_active_contacts_by_list_id( $list_id );
|
87 |
|
88 |
-
//schedule
|
89 |
if ( count( $subscribers ) > 0 ) {
|
90 |
/*
|
91 |
* Prepare Subject
|
@@ -101,7 +107,8 @@ class ES_Handle_Post_Notification {
|
|
101 |
$existing_contacts[] = $subscriber['id'];
|
102 |
}
|
103 |
}
|
104 |
-
/*
|
|
|
105 |
if unique count it 0 then skip this report
|
106 |
*/
|
107 |
if ( count( $subscribers ) <= 0 ) {
|
@@ -131,7 +138,12 @@ class ES_Handle_Post_Notification {
|
|
131 |
'finish_at' => '',
|
132 |
'created_at' => ig_get_current_date_time(),
|
133 |
'updated_at' => ig_get_current_date_time(),
|
134 |
-
'meta' => maybe_serialize(
|
|
|
|
|
|
|
|
|
|
|
135 |
);
|
136 |
|
137 |
// Add entry into mailing queue table
|
@@ -154,7 +166,7 @@ class ES_Handle_Post_Notification {
|
|
154 |
}
|
155 |
|
156 |
public static function prepare_subject( $post, $template ) {
|
157 |
-
//convert post subject here
|
158 |
|
159 |
$post_title = $post->post_title;
|
160 |
$template_title = $template->post_title;
|
@@ -172,18 +184,21 @@ class ES_Handle_Post_Notification {
|
|
172 |
}
|
173 |
|
174 |
public static function prepare_body( $es_templ_body, $post_id, $email_template_id ) {
|
175 |
-
|
176 |
-
$
|
177 |
-
$
|
178 |
-
$
|
179 |
-
|
|
|
|
|
|
|
180 |
$post_title = get_the_title( $post );
|
181 |
$es_templ_body = str_replace( '{{POSTTITLE}}', $post_title, $es_templ_body );
|
182 |
$post_link = get_permalink( $post_id );
|
183 |
|
184 |
// Size of {{POSTIMAGE}}
|
185 |
-
$post_thumbnail =
|
186 |
-
$post_thumbnail_link =
|
187 |
if ( ( function_exists( 'has_post_thumbnail' ) ) && ( has_post_thumbnail( $post_id ) ) ) {
|
188 |
$es_post_image_size = get_option( 'ig_es_post_image_size', 'full' );
|
189 |
switch ( $es_post_image_size ) {
|
@@ -200,8 +215,8 @@ class ES_Handle_Post_Notification {
|
|
200 |
}
|
201 |
}
|
202 |
|
203 |
-
if (
|
204 |
-
$post_thumbnail_link = "<a href='" . $post_link . "' target='_blank'>" . $post_thumbnail .
|
205 |
}
|
206 |
|
207 |
$es_templ_body = str_replace( '{{POSTIMAGE}}', $post_thumbnail_link, $es_templ_body );
|
@@ -227,19 +242,19 @@ class ES_Handle_Post_Notification {
|
|
227 |
$post_author = get_the_author_meta( 'display_name', $post_author_id );
|
228 |
$es_templ_body = str_replace( '{{POSTAUTHOR}}', $post_author, $es_templ_body );
|
229 |
$es_templ_body = str_replace( '{{POSTLINK-ONLY}}', $post_link, $es_templ_body );
|
230 |
-
|
231 |
// Check if template has {{POSTCATS}} placeholder.
|
232 |
-
if( strpos( $es_templ_body, '{{POSTCATS}}' ) >= 0 ) {
|
233 |
-
$taxonomies
|
234 |
-
$post_cats
|
235 |
|
236 |
-
if( ! empty( $taxonomies ) ) {
|
237 |
foreach ( $taxonomies as $taxonomy ) {
|
238 |
$taxonomy_object = get_taxonomy( $taxonomy );
|
239 |
// Check if taxonomy is hierarchical e.g. have parent-child relationship like categories
|
240 |
-
if( $taxonomy_object->hierarchical ) {
|
241 |
$post_terms = get_the_terms( $post, $taxonomy );
|
242 |
-
if( ! empty( $post_terms ) ) {
|
243 |
foreach ( $post_terms as $term ) {
|
244 |
$term_name = $term->name;
|
245 |
$post_cats[] = $term_name;
|
@@ -249,13 +264,13 @@ class ES_Handle_Post_Notification {
|
|
249 |
}
|
250 |
}
|
251 |
|
252 |
-
$es_templ_body
|
253 |
}
|
254 |
|
255 |
-
if (
|
256 |
-
$post_link_with_title = "<a href='" . $post_link . "' target='_blank'>" . $post_title .
|
257 |
$es_templ_body = str_replace( '{{POSTLINK-WITHTITLE}}', $post_link_with_title, $es_templ_body );
|
258 |
-
$post_link = "<a href='" . $post_link . "' target='_blank'>" . $post_link .
|
259 |
}
|
260 |
$es_templ_body = str_replace( '{{POSTLINK}}', $post_link, $es_templ_body );
|
261 |
|
1 |
<?php
|
2 |
|
3 |
+
// Exit if accessed directly
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit;
|
6 |
+
}
|
7 |
+
|
8 |
+
|
9 |
class ES_Handle_Post_Notification {
|
10 |
|
11 |
public $is_wp_5 = false;
|
57 |
|
58 |
public function es_post_publish_callback( $post_status, $original_post_status, $post ) {
|
59 |
|
60 |
+
if ( ( 'publish' == $post_status ) && ( 'publish' != $original_post_status ) ) {
|
61 |
|
62 |
if ( is_object( $post ) ) {
|
63 |
|
88 |
$template = get_post( $template_id ); // to confirm if template exists in ES->Templates
|
89 |
if ( is_object( $template ) ) {
|
90 |
$list_id = $notification['list_ids'];
|
91 |
+
$list_id = explode( ',', $list_id );
|
92 |
$subscribers = ES()->contacts_db->get_active_contacts_by_list_id( $list_id );
|
93 |
|
94 |
+
// schedule
|
95 |
if ( count( $subscribers ) > 0 ) {
|
96 |
/*
|
97 |
* Prepare Subject
|
107 |
$existing_contacts[] = $subscriber['id'];
|
108 |
}
|
109 |
}
|
110 |
+
/*
|
111 |
+
check again for unique subscribers count
|
112 |
if unique count it 0 then skip this report
|
113 |
*/
|
114 |
if ( count( $subscribers ) <= 0 ) {
|
138 |
'finish_at' => '',
|
139 |
'created_at' => ig_get_current_date_time(),
|
140 |
'updated_at' => ig_get_current_date_time(),
|
141 |
+
'meta' => maybe_serialize(
|
142 |
+
array(
|
143 |
+
'post_id' => $post_id,
|
144 |
+
'type' => 'post_notification',
|
145 |
+
)
|
146 |
+
),
|
147 |
);
|
148 |
|
149 |
// Add entry into mailing queue table
|
166 |
}
|
167 |
|
168 |
public static function prepare_subject( $post, $template ) {
|
169 |
+
// convert post subject here
|
170 |
|
171 |
$post_title = $post->post_title;
|
172 |
$template_title = $template->post_title;
|
184 |
}
|
185 |
|
186 |
public static function prepare_body( $es_templ_body, $post_id, $email_template_id ) {
|
187 |
+
$post = get_post( $post_id );
|
188 |
+
$post_key = 'post';
|
189 |
+
// Making $post as global using $GLOBALS['post'] key. Can't use 'post' key directly into $GLOBALS since PHPCS throws global variable assignment warning for 'post'.
|
190 |
+
$GLOBALS[ $post_key ] = $post;
|
191 |
+
|
192 |
+
$post_date = ES_Common::convert_date_to_wp_date( $post->post_modified );
|
193 |
+
$es_templ_body = str_replace( '{{DATE}}', $post_date, $es_templ_body );
|
194 |
+
|
195 |
$post_title = get_the_title( $post );
|
196 |
$es_templ_body = str_replace( '{{POSTTITLE}}', $post_title, $es_templ_body );
|
197 |
$post_link = get_permalink( $post_id );
|
198 |
|
199 |
// Size of {{POSTIMAGE}}
|
200 |
+
$post_thumbnail = '';
|
201 |
+
$post_thumbnail_link = '';
|
202 |
if ( ( function_exists( 'has_post_thumbnail' ) ) && ( has_post_thumbnail( $post_id ) ) ) {
|
203 |
$es_post_image_size = get_option( 'ig_es_post_image_size', 'full' );
|
204 |
switch ( $es_post_image_size ) {
|
215 |
}
|
216 |
}
|
217 |
|
218 |
+
if ( '' != $post_thumbnail ) {
|
219 |
+
$post_thumbnail_link = "<a href='" . $post_link . "' target='_blank'>" . $post_thumbnail . '</a>';
|
220 |
}
|
221 |
|
222 |
$es_templ_body = str_replace( '{{POSTIMAGE}}', $post_thumbnail_link, $es_templ_body );
|
242 |
$post_author = get_the_author_meta( 'display_name', $post_author_id );
|
243 |
$es_templ_body = str_replace( '{{POSTAUTHOR}}', $post_author, $es_templ_body );
|
244 |
$es_templ_body = str_replace( '{{POSTLINK-ONLY}}', $post_link, $es_templ_body );
|
245 |
+
|
246 |
// Check if template has {{POSTCATS}} placeholder.
|
247 |
+
if ( strpos( $es_templ_body, '{{POSTCATS}}' ) >= 0 ) {
|
248 |
+
$taxonomies = get_object_taxonomies( $post );
|
249 |
+
$post_cats = array();
|
250 |
|
251 |
+
if ( ! empty( $taxonomies ) ) {
|
252 |
foreach ( $taxonomies as $taxonomy ) {
|
253 |
$taxonomy_object = get_taxonomy( $taxonomy );
|
254 |
// Check if taxonomy is hierarchical e.g. have parent-child relationship like categories
|
255 |
+
if ( $taxonomy_object->hierarchical ) {
|
256 |
$post_terms = get_the_terms( $post, $taxonomy );
|
257 |
+
if ( ! empty( $post_terms ) ) {
|
258 |
foreach ( $post_terms as $term ) {
|
259 |
$term_name = $term->name;
|
260 |
$post_cats[] = $term_name;
|
264 |
}
|
265 |
}
|
266 |
|
267 |
+
$es_templ_body = str_replace( '{{POSTCATS}}', implode( ', ', $post_cats ), $es_templ_body );
|
268 |
}
|
269 |
|
270 |
+
if ( '' != $post_link ) {
|
271 |
+
$post_link_with_title = "<a href='" . $post_link . "' target='_blank'>" . $post_title . '</a>';
|
272 |
$es_templ_body = str_replace( '{{POSTLINK-WITHTITLE}}', $post_link_with_title, $es_templ_body );
|
273 |
+
$post_link = "<a href='" . $post_link . "' target='_blank'>" . $post_link . '</a>';
|
274 |
}
|
275 |
$es_templ_body = str_replace( '{{POSTLINK}}', $post_link, $es_templ_body );
|
276 |
|
lite/includes/classes/class-es-handle-subscription.php
CHANGED
@@ -15,78 +15,104 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
15 |
*/
|
16 |
class ES_Handle_Subscription {
|
17 |
/**
|
|
|
|
|
18 |
* @since 4.0.0
|
19 |
* @var
|
20 |
*
|
21 |
*/
|
22 |
public $email;
|
23 |
/**
|
|
|
|
|
24 |
* @since 4.0.0
|
25 |
* @var
|
26 |
*
|
27 |
*/
|
28 |
public $name;
|
29 |
/**
|
|
|
|
|
30 |
* @since 4.0.0
|
31 |
* @var
|
32 |
*
|
33 |
*/
|
34 |
public $first_name;
|
35 |
/**
|
|
|
|
|
36 |
* @since 4.0.0
|
37 |
* @var
|
38 |
*
|
39 |
*/
|
40 |
public $last_name;
|
41 |
/**
|
|
|
|
|
42 |
* @since 4.0.0
|
43 |
* @var
|
44 |
*
|
45 |
*/
|
46 |
public $es_optin_type;
|
47 |
/**
|
|
|
|
|
48 |
* @since 4.0.0
|
49 |
* @var
|
50 |
*
|
51 |
*/
|
52 |
public $list_ids;
|
53 |
/**
|
|
|
|
|
54 |
* @since 4.0.0
|
55 |
* @var
|
56 |
*
|
57 |
*/
|
58 |
public $es_nonce;
|
59 |
/**
|
|
|
|
|
60 |
* @since 4.0.0
|
61 |
* @var
|
62 |
*
|
63 |
*/
|
64 |
public $status;
|
65 |
/**
|
|
|
|
|
66 |
* @since 4.0.0
|
67 |
* @var
|
68 |
*
|
69 |
*/
|
70 |
public $is_double_optin = false;
|
71 |
/**
|
|
|
|
|
72 |
* @since 4.0.0
|
73 |
* @var
|
74 |
*
|
75 |
*/
|
76 |
public $guid;
|
77 |
/**
|
|
|
|
|
78 |
* @since 4.0.0
|
79 |
* @var
|
80 |
*
|
81 |
*/
|
82 |
public $db_id;
|
83 |
/**
|
|
|
|
|
84 |
* @since 4.0.0
|
85 |
* @var
|
86 |
*
|
87 |
*/
|
88 |
public $form_id;
|
89 |
/**
|
|
|
|
|
90 |
* @since 4.0.0
|
91 |
* @var
|
92 |
*
|
@@ -116,7 +142,10 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
116 |
*/
|
117 |
public function process_request() {
|
118 |
|
119 |
-
$response = array(
|
|
|
|
|
|
|
120 |
|
121 |
$es = ig_es_get_post_data( 'es' );
|
122 |
$es_subscribe = ig_es_get_post_data( 'esfpx_es-subscribe' );
|
@@ -125,11 +154,11 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
125 |
|
126 |
$form_data = ig_es_get_post_data();
|
127 |
$validate_response = $this->validate_data( $form_data );
|
128 |
-
if ( $validate_response['status']
|
129 |
|
130 |
// We want to pretend as "SUCCESS" for blocked emails.
|
131 |
// So, we are setting as "SUCCESS" even if this email is blocked
|
132 |
-
if ( $validate_response['message']
|
133 |
$validate_response['status'] = 'SUCCESS';
|
134 |
$validate_response['message'] = 'es_optin_success_message';
|
135 |
}
|
@@ -141,7 +170,8 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
141 |
$email = ! empty( $form_data['esfpx_email'] ) ? sanitize_email( $form_data['esfpx_email'] ) : '';
|
142 |
$name = ! empty( $form_data['esfpx_name'] ) ? sanitize_text_field( $form_data['esfpx_name'] ) : '';
|
143 |
|
144 |
-
$first_name =
|
|
|
145 |
if ( ! empty( $name ) ) {
|
146 |
// Get First Name and Last Name from Name
|
147 |
$name_parts = ES_Common::prepare_first_name_last_name( $name );
|
@@ -163,9 +193,9 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
163 |
|
164 |
if ( in_array( $this->es_optin_type, array( 'double_opt_in', 'double_optin' ) ) ) { // Backward Compatibility
|
165 |
$this->is_double_optin = true;
|
166 |
-
$this->status =
|
167 |
} else {
|
168 |
-
$this->status =
|
169 |
}
|
170 |
|
171 |
if ( count( $this->list_ids ) > 0 ) {
|
@@ -197,13 +227,12 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
197 |
|
198 |
$contact_id = ES()->contacts_db->insert( $data );
|
199 |
|
200 |
-
//do_action( 'ig_es_contact_added', $data);
|
201 |
|
202 |
}
|
203 |
|
204 |
-
|
205 |
$contact_lists = ES()->lists_contacts_db->get_list_ids_by_contact( $contact_id, 'subscribed' );
|
206 |
-
if (
|
207 |
$response['message'] = 'es_email_exists_notice';
|
208 |
$this->do_response( $response );
|
209 |
exit;
|
@@ -212,9 +241,9 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
212 |
$list_contact_data = array(
|
213 |
'contact_id' => $contact_id,
|
214 |
'status' => $this->status,
|
215 |
-
'subscribed_at' => ( $this->status
|
216 |
'optin_type' => $optin_type,
|
217 |
-
'subscribed_ip' => ig_es_get_ip()
|
218 |
);
|
219 |
|
220 |
ES()->lists_contacts_db->add_contact_to_lists( $list_contact_data, $this->list_ids );
|
@@ -235,7 +264,7 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
235 |
'first_name' => $this->first_name,
|
236 |
'last_name' => $this->last_name,
|
237 |
'guid' => $this->guid,
|
238 |
-
'list_name' => $list_name
|
239 |
);
|
240 |
|
241 |
if ( $this->is_double_optin ) {
|
@@ -300,13 +329,16 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
300 |
*/
|
301 |
public function validate_data( $data ) {
|
302 |
|
303 |
-
$es_response = array(
|
|
|
|
|
|
|
304 |
|
305 |
if ( ! $this->from_rainmaker ) {
|
306 |
|
307 |
// Honeypot validation
|
308 |
//$hp_key = "esfpx_es_hp" . wp_create_nonce( 'es_hp' );
|
309 |
-
$hp_key =
|
310 |
if ( ! isset( $data[ $hp_key ] ) || ! empty( $data[ $hp_key ] ) ) {
|
311 |
$es_response['message'] = 'es_unexpected_error_notice';
|
312 |
|
@@ -335,7 +367,7 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
335 |
if ( $is_domain_blocked ) {
|
336 |
$data = array(
|
337 |
'email' => $email,
|
338 |
-
'ip' => ig_es_get_ip()
|
339 |
);
|
340 |
|
341 |
ES()->blocked_emails_db->insert( $data );
|
@@ -367,6 +399,8 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
367 |
}
|
368 |
|
369 |
/**
|
|
|
|
|
370 |
* @param $email
|
371 |
*
|
372 |
* @return bool
|
@@ -428,7 +462,7 @@ if ( ! class_exists( 'ES_Handle_Subscription' ) ) {
|
|
428 |
'es_db_error_notice' => __( 'Oops...unable to add subscriber', 'email-subscribers' ),
|
429 |
'es_permission_denied_notice' => __( 'You do not have permission to add subscriber', 'email-subscribers' ),
|
430 |
'es_no_list_selected' => __( 'Please select the list', 'email-subscribers' ),
|
431 |
-
'es_invalid_captcha' => __( 'Invalid Captcha', 'email-subscribers' )
|
432 |
);
|
433 |
|
434 |
$messages = apply_filters( 'ig_es_subscription_messages', $messages );
|
15 |
*/
|
16 |
class ES_Handle_Subscription {
|
17 |
/**
|
18 |
+
* Subscriber Email
|
19 |
+
*
|
20 |
* @since 4.0.0
|
21 |
* @var
|
22 |
*
|
23 |
*/
|
24 |
public $email;
|
25 |
/**
|
26 |
+
* Subscriber Name
|
27 |
+
*
|
28 |
* @since 4.0.0
|
29 |
* @var
|
30 |
*
|
31 |
*/
|
32 |
public $name;
|
33 |
/**
|
34 |
+
* Subscriber First Name
|
35 |
+
*
|
36 |
* @since 4.0.0
|
37 |
* @var
|
38 |
*
|
39 |
*/
|
40 |
public $first_name;
|
41 |
/**
|
42 |
+
* Subscriber Last Name
|
43 |
+
*
|
44 |
* @since 4.0.0
|
45 |
* @var
|
46 |
*
|
47 |
*/
|
48 |
public $last_name;
|
49 |
/**
|
50 |
+
* Optin type
|
51 |
+
*
|
52 |
* @since 4.0.0
|
53 |
* @var
|
54 |
*
|
55 |
*/
|
56 |
public $es_optin_type;
|
57 |
/**
|
58 |
+
* List Id
|
59 |
+
*
|
60 |
* @since 4.0.0
|
61 |
* @var
|
62 |
*
|
63 |
*/
|
64 |
public $list_ids;
|
65 |
/**
|
66 |
+
* Nonce value
|
67 |
+
*
|
68 |
* @since 4.0.0
|
69 |
* @var
|
70 |
*
|
71 |
*/
|
72 |
public $es_nonce;
|
73 |
/**
|
74 |
+
* Subscriber Status
|
75 |
+
*
|
76 |
* @since 4.0.0
|
77 |
* @var
|
78 |
*
|
79 |
*/
|
80 |
public $status;
|
81 |
/**
|
82 |
+
* To check if double-optin or not
|
83 |
+
*
|
84 |
* @since 4.0.0
|
85 |
* @var
|
86 |
*
|
87 |
*/
|
88 |
public $is_double_optin = false;
|
89 |
/**
|
90 |
+
* Guid
|
91 |
+
*
|
92 |
* @since 4.0.0
|
93 |
* @var
|
94 |
*
|
95 |
*/
|
96 |
public $guid;
|
97 |
/**
|
98 |
+
* Database Id
|
99 |
+
*
|
100 |
* @since 4.0.0
|
101 |
* @var
|
102 |
*
|
103 |
*/
|
104 |
public $db_id;
|
105 |
/**
|
106 |
+
* Form id
|
107 |
+
*
|
108 |
* @since 4.0.0
|
109 |
* @var
|
110 |
*
|
111 |
*/
|
112 |
public $form_id;
|
113 |
/**
|
114 |
+
* If the user is subscribed from Rainmaker
|
115 |
+
*
|
116 |
* @since 4.0.0
|
117 |
* @var
|
118 |
*
|
142 |
*/
|
143 |
public function process_request() {
|
144 |
|
145 |
+
$response = array(
|
146 |
+
'status' => 'ERROR',
|
147 |
+
'message' => '',
|
148 |
+
);
|
149 |
|
150 |
$es = ig_es_get_post_data( 'es' );
|
151 |
$es_subscribe = ig_es_get_post_data( 'esfpx_es-subscribe' );
|
154 |
|
155 |
$form_data = ig_es_get_post_data();
|
156 |
$validate_response = $this->validate_data( $form_data );
|
157 |
+
if ( 'ERROR' === $validate_response['status'] ) {
|
158 |
|
159 |
// We want to pretend as "SUCCESS" for blocked emails.
|
160 |
// So, we are setting as "SUCCESS" even if this email is blocked
|
161 |
+
if ( 'es_email_address_blocked' === $validate_response['message'] ) {
|
162 |
$validate_response['status'] = 'SUCCESS';
|
163 |
$validate_response['message'] = 'es_optin_success_message';
|
164 |
}
|
170 |
$email = ! empty( $form_data['esfpx_email'] ) ? sanitize_email( $form_data['esfpx_email'] ) : '';
|
171 |
$name = ! empty( $form_data['esfpx_name'] ) ? sanitize_text_field( $form_data['esfpx_name'] ) : '';
|
172 |
|
173 |
+
$first_name = '';
|
174 |
+
$last_name = '';
|
175 |
if ( ! empty( $name ) ) {
|
176 |
// Get First Name and Last Name from Name
|
177 |
$name_parts = ES_Common::prepare_first_name_last_name( $name );
|
193 |
|
194 |
if ( in_array( $this->es_optin_type, array( 'double_opt_in', 'double_optin' ) ) ) { // Backward Compatibility
|
195 |
$this->is_double_optin = true;
|
196 |
+
$this->status = 'unconfirmed';
|
197 |
} else {
|
198 |
+
$this->status = 'subscribed';
|
199 |
}
|
200 |
|
201 |
if ( count( $this->list_ids ) > 0 ) {
|
227 |
|
228 |
$contact_id = ES()->contacts_db->insert( $data );
|
229 |
|
230 |
+
// do_action( 'ig_es_contact_added', $data);
|
231 |
|
232 |
}
|
233 |
|
|
|
234 |
$contact_lists = ES()->lists_contacts_db->get_list_ids_by_contact( $contact_id, 'subscribed' );
|
235 |
+
if ( empty( array_diff( $this->list_ids, $contact_lists ) ) ) {
|
236 |
$response['message'] = 'es_email_exists_notice';
|
237 |
$this->do_response( $response );
|
238 |
exit;
|
241 |
$list_contact_data = array(
|
242 |
'contact_id' => $contact_id,
|
243 |
'status' => $this->status,
|
244 |
+
'subscribed_at' => ( 'subscribed' === $this->status ) ? ig_get_current_date_time() : '',
|
245 |
'optin_type' => $optin_type,
|
246 |
+
'subscribed_ip' => ig_es_get_ip(),
|
247 |
);
|
248 |
|
249 |
ES()->lists_contacts_db->add_contact_to_lists( $list_contact_data, $this->list_ids );
|
264 |
'first_name' => $this->first_name,
|
265 |
'last_name' => $this->last_name,
|
266 |
'guid' => $this->guid,
|
267 |
+
'list_name' => $list_name,
|
268 |
);
|
269 |
|
270 |
if ( $this->is_double_optin ) {
|
329 |
*/
|
330 |
public function validate_data( $data ) {
|
331 |
|
332 |
+
$es_response = array(
|
333 |
+
'status' => 'ERROR',
|
334 |
+
'message' => '',
|
335 |
+
);
|
336 |
|
337 |
if ( ! $this->from_rainmaker ) {
|
338 |
|
339 |
// Honeypot validation
|
340 |
//$hp_key = "esfpx_es_hp" . wp_create_nonce( 'es_hp' );
|
341 |
+
$hp_key = 'esfpx_es_hp_email';
|
342 |
if ( ! isset( $data[ $hp_key ] ) || ! empty( $data[ $hp_key ] ) ) {
|
343 |
$es_response['message'] = 'es_unexpected_error_notice';
|
344 |
|
367 |
if ( $is_domain_blocked ) {
|
368 |
$data = array(
|
369 |
'email' => $email,
|
370 |
+
'ip' => ig_es_get_ip(),
|
371 |
);
|
372 |
|
373 |
ES()->blocked_emails_db->insert( $data );
|
399 |
}
|
400 |
|
401 |
/**
|
402 |
+
* Check if the domain is blocked based on email
|
403 |
+
*
|
404 |
* @param $email
|
405 |
*
|
406 |
* @return bool
|
462 |
'es_db_error_notice' => __( 'Oops...unable to add subscriber', 'email-subscribers' ),
|
463 |
'es_permission_denied_notice' => __( 'You do not have permission to add subscriber', 'email-subscribers' ),
|
464 |
'es_no_list_selected' => __( 'Please select the list', 'email-subscribers' ),
|
465 |
+
'es_invalid_captcha' => __( 'Invalid Captcha', 'email-subscribers' ),
|
466 |
);
|
467 |
|
468 |
$messages = apply_filters( 'ig_es_subscription_messages', $messages );
|
lite/includes/classes/class-es-handle-sync-wp-user.php
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class ES_Handle_Sync_Wp_User {
|
4 |
|
5 |
public static $instance;
|
@@ -8,9 +14,8 @@ class ES_Handle_Sync_Wp_User {
|
|
8 |
// Sync upcoming WordPress users
|
9 |
add_action( 'ig_es_sync_users_tabs_wordpress', array( $this, 'sync_wordpress_users_settings' ) );
|
10 |
|
11 |
-
//add_action( 'user_register', array( $this, 'sync_registered_wp_user' ) );
|
12 |
-
//add_action( '
|
13 |
-
//add_action( 'delete_user', array( $this, 'delete_contact' ), 10, 1 );
|
14 |
}
|
15 |
|
16 |
public function sync_wordpress_users_settings( $wordpress_tab ) {
|
@@ -27,7 +32,7 @@ class ES_Handle_Sync_Wp_User {
|
|
27 |
$error = false;
|
28 |
if ( ! empty( $form_data['es_registered'] ) && 'YES' === $form_data['es_registered'] ) {
|
29 |
$list_id = ! empty( $form_data['es_registered_group'] ) ? $form_data['es_registered_group'] : 0;
|
30 |
-
if ( $list_id
|
31 |
$message = __( 'Please select list', 'email-subscribers' );
|
32 |
ES_Common::show_message( $message, 'error' );
|
33 |
$error = true;
|
@@ -51,50 +56,64 @@ class ES_Handle_Sync_Wp_User {
|
|
51 |
|
52 |
?>
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
<?php
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
66 |
echo "selected='selected'";
|
67 |
-
}
|
68 |
-
|
|
|
|
|
|
|
|
|
69 |
echo "selected='selected'";
|
70 |
-
}
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
<?php
|
95 |
}
|
96 |
|
97 |
/**
|
|
|
|
|
98 |
* @param $user_id
|
99 |
*
|
100 |
* @since 4.0
|
@@ -112,7 +131,7 @@ class ES_Handle_Sync_Wp_User {
|
|
112 |
|
113 |
if ( 'YES' === $ig_es_registered ) {
|
114 |
$list_id = $ig_es_sync_wp_users['es_registered_group'];
|
115 |
-
//get user info
|
116 |
$user_info = get_userdata( $user_id );
|
117 |
if ( $user_info instanceof WP_User ) {
|
118 |
$user_first_name = $user_info->display_name;
|
@@ -121,7 +140,7 @@ class ES_Handle_Sync_Wp_User {
|
|
121 |
if ( empty( $user_first_name ) ) {
|
122 |
$user_first_name = ES_Common::get_name_from_email( $email );
|
123 |
}
|
124 |
-
//prepare data
|
125 |
$data = array(
|
126 |
'first_name' => $user_first_name,
|
127 |
'email' => $email,
|
@@ -129,51 +148,13 @@ class ES_Handle_Sync_Wp_User {
|
|
129 |
'status' => 'verified',
|
130 |
'hash' => ES_Common::generate_guid(),
|
131 |
'created_at' => ig_get_current_date_time(),
|
132 |
-
'wp_user_id' => $user_id
|
133 |
);
|
134 |
|
135 |
do_action( 'ig_es_add_contact', $data, $list_id );
|
136 |
}
|
137 |
-
|
138 |
-
}
|
139 |
-
}
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Update ES Contact detail
|
144 |
-
*
|
145 |
-
* @param $user_id
|
146 |
-
*
|
147 |
-
* @since 4.0
|
148 |
-
*
|
149 |
-
* @modify 4.3.12
|
150 |
-
*/
|
151 |
-
public function update_es_contact( $user_id ) {
|
152 |
-
$ig_es_sync_wp_users = get_option( 'ig_es_sync_wp_users', array() );
|
153 |
-
|
154 |
-
if ( ! empty( $ig_es_sync_wp_users ) ) {
|
155 |
-
|
156 |
-
$ig_es_sync_wp_users = maybe_unserialize( $ig_es_sync_wp_users );
|
157 |
-
|
158 |
-
$ig_es_registered = ( ! empty( $ig_es_sync_wp_users['es_registered'] ) ) ? $ig_es_sync_wp_users['es_registered'] : 'NO';
|
159 |
-
|
160 |
-
if ( 'YES' === $ig_es_registered ) {
|
161 |
-
|
162 |
-
$user_info = get_userdata( $user_id );
|
163 |
-
if ( ! ( $user_info instanceof WP_User ) ) {
|
164 |
-
return;
|
165 |
-
}
|
166 |
-
//check if user exist with this email
|
167 |
-
$es_contact_id = ES()->contacts_db->get_contact_id_by_email( $user_info->user_email );
|
168 |
-
if ( $es_contact_id ) {
|
169 |
-
$contact['email'] = $_POST['email'];
|
170 |
-
$contact['first_name'] = $_POST['display_name'];
|
171 |
-
ES()->contacts_db->update_contact( $es_contact_id, $contact );
|
172 |
-
}
|
173 |
}
|
174 |
}
|
175 |
-
|
176 |
-
|
177 |
}
|
178 |
|
179 |
/**
|
@@ -203,7 +184,7 @@ class ES_Handle_Sync_Wp_User {
|
|
203 |
if ( $user instanceof WP_User ) {
|
204 |
$email = $user->user_email;
|
205 |
|
206 |
-
$where = $wpdb->prepare(
|
207 |
$contact_id = ES()->contacts_db->get_column_by_condition( 'id', $where );
|
208 |
|
209 |
if ( $contact_id ) {
|
@@ -223,13 +204,15 @@ class ES_Handle_Sync_Wp_User {
|
|
223 |
$audience_tab_main_navigation = apply_filters( 'ig_es_audience_tab_main_navigation', $active_tab, $audience_tab_main_navigation );
|
224 |
|
225 |
?>
|
226 |
-
|
227 |
-
|
|
|
|
|
228 |
ES_Common::prepare_main_header_navigation( $audience_tab_main_navigation );
|
229 |
-
|
230 |
-
|
231 |
<?php $this->sync_users_callback(); ?>
|
232 |
-
|
233 |
|
234 |
<?php
|
235 |
}
|
@@ -238,30 +221,31 @@ class ES_Handle_Sync_Wp_User {
|
|
238 |
|
239 |
$logger = get_ig_logger();
|
240 |
$logger->trace( 'Sync Users' );
|
241 |
-
$active_tab = ig_es_get_request_data( 'tab', '
|
242 |
|
243 |
$tabs = array(
|
244 |
'wordpress' => array(
|
245 |
'name' => __( 'WordPress', 'email-subscribers' ),
|
246 |
-
'url' => admin_url( 'admin.php?page=es_subscribers&action=sync&tab=wordpress' )
|
247 |
-
)
|
248 |
);
|
249 |
|
250 |
$tabs = apply_filters( 'ig_es_sync_users_tabs', $tabs );
|
251 |
?>
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
|
|
265 |
<?php
|
266 |
}
|
267 |
|
1 |
<?php
|
2 |
|
3 |
+
// Exit if accessed directly
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit;
|
6 |
+
}
|
7 |
+
|
8 |
+
|
9 |
class ES_Handle_Sync_Wp_User {
|
10 |
|
11 |
public static $instance;
|
14 |
// Sync upcoming WordPress users
|
15 |
add_action( 'ig_es_sync_users_tabs_wordpress', array( $this, 'sync_wordpress_users_settings' ) );
|
16 |
|
17 |
+
// add_action( 'user_register', array( $this, 'sync_registered_wp_user' ) );
|
18 |
+
// add_action( 'delete_user', array( $this, 'delete_contact' ), 10, 1 );
|
|
|
19 |
}
|
20 |
|
21 |
public function sync_wordpress_users_settings( $wordpress_tab ) {
|
32 |
$error = false;
|
33 |
if ( ! empty( $form_data['es_registered'] ) && 'YES' === $form_data['es_registered'] ) {
|
34 |
$list_id = ! empty( $form_data['es_registered_group'] ) ? $form_data['es_registered_group'] : 0;
|
35 |
+
if (0 === $list_id ) {
|
36 |
$message = __( 'Please select list', 'email-subscribers' );
|
37 |
ES_Common::show_message( $message, 'error' );
|
38 |
$error = true;
|
56 |
|
57 |
?>
|
58 |
|
59 |
+
<table class="form-table">
|
60 |
+
<tbody>
|
61 |
+
<tr>
|
62 |
+
<th scope="row">
|
63 |
+
<label for="tag-image">
|
64 |
+
<?php esc_html_e( 'Sync WordPress Users?', 'email-subscribers' ); ?>
|
65 |
+
</label>
|
66 |
+
<p class="description"><?php esc_html_e( 'Whenever someone signup, it will automatically be added into selected list', 'email-subscribers' ); ?></p>
|
67 |
+
</th>
|
68 |
+
<td>
|
69 |
+
<select name="form_data[es_registered]" id="es_email_status">
|
70 |
+
<option value='NO'
|
71 |
+
<?php
|
72 |
+
if ('NO' == $form_data['es_registered'] ) {
|
73 |
echo "selected='selected'";
|
74 |
+
}
|
75 |
+
?>
|
76 |
+
><?php esc_html_e( 'No', 'email-subscribers' ); ?></option>
|
77 |
+
<option value='YES'
|
78 |
+
<?php
|
79 |
+
if ( 'YES' == $form_data['es_registered'] ) {
|
80 |
echo "selected='selected'";
|
81 |
+
}
|
82 |
+
?>
|
83 |
+
><?php esc_html_e( 'Yes', 'email-subscribers' ); ?></option>
|
84 |
+
</select>
|
85 |
+
</td>
|
86 |
+
</tr>
|
87 |
+
<tr>
|
88 |
+
<th>
|
89 |
+
<label for="tag-display-status">
|
90 |
+
<?php esc_html_e( 'Select List', 'email-subscribers' ); ?>
|
91 |
+
</label>
|
92 |
+
<p class="description"><?php esc_html_e( 'Select the list in which newly registered user will be subscribed to', 'email-subscribers' ); ?></p>
|
93 |
+
</th>
|
94 |
+
<td>
|
95 |
+
<select name="form_data[es_registered_group]">
|
96 |
+
<?php
|
97 |
+
$lists_dropdown = ES_Common::prepare_list_dropdown_options( $form_data['es_registered_group'], 'Select List' );
|
98 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
99 |
+
echo wp_kses( $lists_dropdown , $allowedtags );
|
100 |
+
?>
|
101 |
+
</select>
|
102 |
+
</td>
|
103 |
+
</tr>
|
104 |
+
</tbody>
|
105 |
+
</table>
|
106 |
+
<input type="hidden" name="submitted" value="submitted"/>
|
107 |
+
<p style="padding-top:5px;">
|
108 |
+
<input type="submit" class="button-primary" value="<?php esc_html_e( 'Save Settings', 'email-subscribers' ); ?>"/>
|
109 |
+
</p>
|
110 |
|
111 |
<?php
|
112 |
}
|
113 |
|
114 |
/**
|
115 |
+
* Sync/Add WP new user into ES
|
116 |
+
*
|
117 |
* @param $user_id
|
118 |
*
|
119 |
* @since 4.0
|
131 |
|
132 |
if ( 'YES' === $ig_es_registered ) {
|
133 |
$list_id = $ig_es_sync_wp_users['es_registered_group'];
|
134 |
+
// get user info
|
135 |
$user_info = get_userdata( $user_id );
|
136 |
if ( $user_info instanceof WP_User ) {
|
137 |
$user_first_name = $user_info->display_name;
|
140 |
if ( empty( $user_first_name ) ) {
|
141 |
$user_first_name = ES_Common::get_name_from_email( $email );
|
142 |
}
|
143 |
+
// prepare data
|
144 |
$data = array(
|
145 |
'first_name' => $user_first_name,
|
146 |
'email' => $email,
|
148 |
'status' => 'verified',
|
149 |
'hash' => ES_Common::generate_guid(),
|
150 |
'created_at' => ig_get_current_date_time(),
|
151 |
+
'wp_user_id' => $user_id,
|
152 |
);
|
153 |
|
154 |
do_action( 'ig_es_add_contact', $data, $list_id );
|
155 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
157 |
}
|
|
|
|
|
158 |
}
|
159 |
|
160 |
/**
|
184 |
if ( $user instanceof WP_User ) {
|
185 |
$email = $user->user_email;
|
186 |
|
187 |
+
$where = $wpdb->prepare( 'email = %s', $email );
|
188 |
$contact_id = ES()->contacts_db->get_column_by_condition( 'id', $where );
|
189 |
|
190 |
if ( $contact_id ) {
|
204 |
$audience_tab_main_navigation = apply_filters( 'ig_es_audience_tab_main_navigation', $active_tab, $audience_tab_main_navigation );
|
205 |
|
206 |
?>
|
207 |
+
<div class="wrap">
|
208 |
+
<h2>
|
209 |
+
<?php
|
210 |
+
esc_html_e( 'Audience > Sync Contacts', 'email-subscribers' );
|
211 |
ES_Common::prepare_main_header_navigation( $audience_tab_main_navigation );
|
212 |
+
?>
|
213 |
+
</h2>
|
214 |
<?php $this->sync_users_callback(); ?>
|
215 |
+
</div>
|
216 |
|
217 |
<?php
|
218 |
}
|
221 |
|
222 |
$logger = get_ig_logger();
|
223 |
$logger->trace( 'Sync Users' );
|
224 |
+
$active_tab = ig_es_get_request_data( 'tab', 'WordPress' );
|
225 |
|
226 |
$tabs = array(
|
227 |
'wordpress' => array(
|
228 |
'name' => __( 'WordPress', 'email-subscribers' ),
|
229 |
+
'url' => admin_url( 'admin.php?page=es_subscribers&action=sync&tab=wordpress' ),
|
230 |
+
),
|
231 |
);
|
232 |
|
233 |
$tabs = apply_filters( 'ig_es_sync_users_tabs', $tabs );
|
234 |
?>
|
235 |
+
<div class="ig-es-sync-settings-notice">
|
236 |
+
<div class="text-center py-4 lg:px-4 my-8">
|
237 |
+
<div class="p-2 bg-indigo-800 items-center text-indigo-100 leading-none lg:rounded-full flex lg:inline-flex mx-4 leading-normal" role="alert">
|
238 |
+
<span class="flex rounded-full bg-indigo-500 uppercase px-2 py-1 text-xs font-bold mr-3"><?php echo esc_html__( 'New', 'email-subscribers' ); ?></span>
|
239 |
+
<span class="font-semibold text-left flex-auto">
|
240 |
+
<?php
|
241 |
+
$workflows_page_url = menu_page_url( 'es_workflows', false );
|
242 |
+
/* translators: %s: Link to Workflow page */
|
243 |
+
echo wp_kses_post( sprintf( __( 'Hey!!! now sync users using Email Subscribers\' workflows. <a href="%s" class="text-indigo-400">Create new workflows</a>', 'email-subscribers' ), $workflows_page_url ) );
|
244 |
+
?>
|
245 |
+
</span>
|
246 |
+
</div>
|
247 |
+
</div>
|
248 |
+
</div>
|
249 |
<?php
|
250 |
}
|
251 |
|
lite/includes/classes/class-es-ig-redirect.php
CHANGED
@@ -21,7 +21,7 @@ if ( ! class_exists( 'ES_IG_Redirect' ) ) {
|
|
21 |
|
22 |
$action = ig_es_get_request_data( 'action' );
|
23 |
|
24 |
-
$redirect_url
|
25 |
$ig_activate_url = admin_url( 'plugins.php?plugin_status=inactive' );
|
26 |
|
27 |
if ( 'create_campaign' === $action ) {
|
@@ -46,111 +46,118 @@ if ( ! class_exists( 'ES_IG_Redirect' ) ) {
|
|
46 |
*
|
47 |
* If Icegram is not installed
|
48 |
* - Show Intermediate page & ask them to Install & activate Icegram
|
49 |
-
*
|
50 |
*/
|
51 |
|
52 |
if ( in_array( $icegram_plugin, $active_plugins ) ) {
|
53 |
wp_safe_redirect( $redirect_url );
|
54 |
exit;
|
55 |
} else { ?>
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
<?php echo $info; ?>
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
}
|
155 |
}
|
156 |
}
|
21 |
|
22 |
$action = ig_es_get_request_data( 'action' );
|
23 |
|
24 |
+
$redirect_url = admin_url( 'post-new.php?post_type=ig_campaign' );
|
25 |
$ig_activate_url = admin_url( 'plugins.php?plugin_status=inactive' );
|
26 |
|
27 |
if ( 'create_campaign' === $action ) {
|
46 |
*
|
47 |
* If Icegram is not installed
|
48 |
* - Show Intermediate page & ask them to Install & activate Icegram
|
|
|
49 |
*/
|
50 |
|
51 |
if ( in_array( $icegram_plugin, $active_plugins ) ) {
|
52 |
wp_safe_redirect( $redirect_url );
|
53 |
exit;
|
54 |
} else { ?>
|
55 |
+
<div class="wrap" id="ig-es-container">
|
56 |
+
<header class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 ">
|
57 |
+
<div class="md:flex md:items-center md:justify-between">
|
58 |
+
<div class="flex-1 min-w-0">
|
59 |
+
<h2 class="text-2xl font-bold text-gray-900 sm:text-3xl sm:leading-9 sm:truncate">
|
60 |
+
<?php echo wp_kses_post( $info ); ?>
|
61 |
+
</h2>
|
62 |
+
</div>
|
63 |
+
|
64 |
+
<div class="mt-4 flex md:mt-0 md:ml-4">
|
65 |
+
<span class="ml-3 shadow-sm rounded-md">
|
66 |
+
<div id="ig-es-create-button" class="relative inline-block text-left">
|
67 |
+
<div>
|
68 |
+
<span class="rounded-md shadow-sm">
|
69 |
+
|
70 |
+
<?php
|
71 |
+
if ( in_array( $icegram_plugin, $inactive_plugins ) ) {
|
72 |
+
?>
|
73 |
+
<a href="<?php echo esc_url( $ig_activate_url ); ?>"><button type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 bg-white text-sm leading-5 font-medium text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:shadow-outline-blue transition ease-in-out duration-150">
|
74 |
+
<?php
|
75 |
+
esc_html_e( 'Activate Icegram', 'email-subscribers' );
|
76 |
+
} else {
|
77 |
+
?>
|
78 |
+
<a href="<?php echo esc_url( $ig_install_url ); ?>"><button type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 bg-white text-sm leading-5 font-medium text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:shadow-outline-blue transition ease-in-out duration-150">
|
79 |
+
<?php
|
80 |
+
esc_html_e( 'Install Icegram', 'email-subscribers' );
|
81 |
+
}
|
82 |
+
?>
|
83 |
+
</button></a>
|
84 |
+
</span>
|
85 |
+
</div>
|
86 |
+
</div>
|
87 |
+
</span>
|
88 |
+
</div>
|
89 |
+
|
90 |
+
</header>
|
91 |
+
|
92 |
+
<main class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
93 |
+
<section class="md:flex md:items-start md:justify-between sm:px-4 py-2 my-4 sm:px-0 rounded-lg bg-white shadow sm:grid sm:grid-cols-3">
|
94 |
+
|
95 |
+
<div class="flex min-w-0 mr-4 pl-1">
|
96 |
+
<div class="relative bg-white rounded ">
|
97 |
+
<picture class="block">
|
98 |
+
<img class="border-0 h-20 mx-auto my-2" src="<?php echo esc_url( ES_PLUGIN_URL ); ?>lite/admin/images/icegram-engage-visitors-person-flow.png" alt="feature-img">
|
99 |
+
</picture>
|
100 |
+
<div class="pt-2 block mr-6">
|
101 |
+
<h3 class="text-gray-700 font-bold md:text-base lg:text-lg"><?php esc_html_e( 'Engage Visitors', 'email-subscribers' ); ?></h3>
|
102 |
+
<p class="md:pt-6 lg:pt-2 text-sm font-normal text-gray-600 leading-snug">
|
103 |
+
<?php esc_html_e( 'Show right messages to right people at the right time in the right place. Drive people to landing pages, promotions and stop them from bouncing away.', 'email-subscribers' ); ?>
|
104 |
+
</p>
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
</div>
|
108 |
+
|
109 |
+
<div class="flex min-w-0 mr-4 pl-2">
|
110 |
+
<div class="relative bg-white rounded">
|
111 |
+
<picture class="block">
|
112 |
+
<img class="border-0 h-20 mx-auto my-2" src="<?php echo esc_url( ES_PLUGIN_URL ); ?>lite/admin/images/icegram-engage-more-subscribers-and-visitors.png" alt="feature-img">
|
113 |
+
</picture>
|
114 |
+
<div class="pt-2 block mr-6">
|
115 |
+
<h3 class="text-lg text-gray-700 font-bold md:text-base lg:text-lg"><?php esc_html_e( 'More Subscribers & Customers', 'email-subscribers' ); ?></h3>
|
116 |
+
<p class="text-sm pt-2 font-normal text-gray-600 leading-snug">
|
117 |
+
<?php esc_html_e( 'Dramatically increase opt-ins and sales. Easily run powerful onsite marketing campaigns. Marketers, owners and visitors– everyone loves Icegram!', 'email-subscribers' ); ?>
|
118 |
+
</p>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
</div>
|
122 |
+
|
123 |
+
<div class="flex min-w-0 mr-4 pl-2">
|
124 |
+
<div class="relative bg-white rounded">
|
125 |
+
<picture class="block">
|
126 |
+
<img class="border-0 h-20 mx-auto my-2" src="<?php echo esc_url( ES_PLUGIN_URL ); ?>lite/admin/images/icegram-engage-optimize-results.png" alt="feature-img">
|
127 |
+
</picture>
|
128 |
+
<div class="pt-2 block mr-6">
|
129 |
+
<h3 class="text-lg text-gray-700 font-bold md:text-base lg:text-lg"><?php esc_html_e( 'Optimize Results', 'email-subscribers' ); ?></h3>
|
130 |
+
<p class="md:pt-6 lg:pt-2 lg:text-sm font-normal text-gray-600 leading-snug">
|
131 |
+
<?php esc_html_e( 'Keep growing. Get everything you need to target, measure, re-target, behavior rules, personalize, split test, segment, automate and optimize.', 'email-subscribers' ); ?>
|
132 |
+
</p>
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
</div>
|
136 |
+
</section>
|
137 |
+
</main>
|
138 |
+
|
139 |
+
<main class="max-w-7xl mx-auto sm:px-6 lg:px-8 -py-4">
|
140 |
+
<section class="md:flex md:items-start md:justify-between sm:px-4 py-2 my-8 sm:px-0 sm:grid sm:grid-cols-2">
|
141 |
+
<div class="flex min-w-0 mr-2 pl-1 mx-8 my-4">
|
142 |
+
<div class="relative">
|
143 |
+
<picture class="block ">
|
144 |
+
<img class="w-11/12 border-0 h-62 rounded-lg bg-white shadow" src="<?php echo esc_url( ES_PLUGIN_URL ); ?>lite/admin/images/optin_form_1.png" alt="feature-img">
|
145 |
+
</picture>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
<div class="flex min-w-0 mr-2 pl-2 mx-8 my-4">
|
149 |
+
<div class="relative">
|
150 |
+
<picture class="block">
|
151 |
+
<img class="w-11/12 border-0 h-62 rounded-lg bg-white shadow" src="<?php echo esc_url( ES_PLUGIN_URL ); ?>lite/admin/images/optin_form_2.png" alt="feature-img">
|
152 |
+
</picture>
|
153 |
+
</div>
|
154 |
+
</div>
|
155 |
+
</section>
|
156 |
+
</main>
|
157 |
+
</div>
|
158 |
+
|
159 |
+
<?php
|
160 |
+
}
|
161 |
}
|
162 |
}
|
163 |
}
|
lite/includes/classes/class-es-import-subscribers.php
CHANGED
@@ -25,33 +25,33 @@ class ES_Import_Subscribers {
|
|
25 |
*/
|
26 |
public function import_callback() {
|
27 |
|
28 |
-
require_once
|
29 |
|
30 |
$submit = ig_es_get_post_data( 'submit' );
|
31 |
if ( $submit ) {
|
32 |
$import_contacts_nonce = ig_es_get_post_data( 'import_contacts' );
|
33 |
if ( ! isset( $_POST['import_contacts'] ) || ! wp_verify_nonce( sanitize_key( $import_contacts_nonce ), 'import-contacts' ) ) {
|
34 |
-
$message = __(
|
35 |
ES_Common::show_message( $message, 'error' );
|
36 |
}
|
37 |
|
38 |
-
if ( isset( $_FILES[
|
39 |
|
40 |
$max_upload_size = $this->get_max_upload_size();
|
41 |
-
if ( is_uploaded_file( $_FILES[
|
42 |
|
43 |
-
$tmp_file = $_FILES[
|
44 |
-
$file = $_FILES['file']['name'];
|
45 |
|
46 |
-
$ext = strtolower( substr( $file, strrpos( $file,
|
47 |
|
48 |
-
if (
|
49 |
-
$file_size = $_FILES['file']['size'];
|
50 |
|
51 |
// Check if CSV file size is less than or equal to max upload size.
|
52 |
-
if( $file_size <= $max_upload_size ) {
|
53 |
-
if ( ! ini_get(
|
54 |
-
ini_set(
|
55 |
}
|
56 |
|
57 |
$statuses = ES_Common::get_statuses_key_name_map();
|
@@ -81,6 +81,11 @@ class ES_Import_Subscribers {
|
|
81 |
// Get Headers
|
82 |
$headers = array_map( 'trim', fgetcsv( $handle, 0, $delimiter ) );
|
83 |
|
|
|
|
|
|
|
|
|
|
|
84 |
$existing_contacts_email_id_map = ES()->contacts_db->get_email_id_map();
|
85 |
|
86 |
$existing_contacts = array();
|
@@ -89,21 +94,25 @@ class ES_Import_Subscribers {
|
|
89 |
$existing_contacts = array_map( 'strtolower', $existing_contacts );
|
90 |
}
|
91 |
|
92 |
-
$invalid_emails_count
|
93 |
-
$
|
|
|
|
|
94 |
|
95 |
-
$values =
|
|
|
|
|
96 |
$current_date_time = ig_get_current_date_time();
|
97 |
|
98 |
$headers_column_count = count( $headers );
|
99 |
while ( ( $data = fgetcsv( $handle, 0, $delimiter ) ) !== false ) {
|
100 |
|
101 |
-
$data
|
102 |
$data_column_count = count( $data );
|
103 |
|
104 |
// Verify if number of headers columns are equal to number of data columns.
|
105 |
-
if( $headers_column_count !== $data_column_count ) {
|
106 |
-
|
107 |
continue;
|
108 |
}
|
109 |
|
@@ -111,7 +120,7 @@ class ES_Import_Subscribers {
|
|
111 |
|
112 |
$email = isset( $data['Email'] ) ? strtolower( sanitize_email( trim( $data['Email'] ) ) ) : '';
|
113 |
|
114 |
-
if ( empty( $email ) || ! filter_var( $email, FILTER_VALIDATE_EMAIL )) {
|
115 |
$invalid_emails_count ++;
|
116 |
continue;
|
117 |
}
|
@@ -119,9 +128,9 @@ class ES_Import_Subscribers {
|
|
119 |
if ( ! in_array( $email, $existing_contacts ) ) {
|
120 |
|
121 |
// Convert emoji characters to equivalent HTML entities to avoid WordPress sanitization error in SQL query while bulk inserting contacts.
|
122 |
-
$name
|
123 |
$first_name = isset( $data['First Name'] ) ? ES_Common::handle_emoji_characters( sanitize_text_field( trim( $data['First Name'] ) ) ) : '';
|
124 |
-
$last_name
|
125 |
|
126 |
// If we don't get the first_name & last_name, consider Name field.
|
127 |
// If name empty, get the name from Email
|
@@ -148,19 +157,20 @@ class ES_Import_Subscribers {
|
|
148 |
|
149 |
$existing_contacts[] = $email;
|
150 |
|
151 |
-
|
152 |
|
153 |
-
|
154 |
} else {
|
155 |
$existing_contacts_count ++;
|
156 |
}
|
157 |
}
|
158 |
|
159 |
-
$message
|
160 |
$response_status = 'error';
|
|
|
161 |
if ( count( $emails ) > 0 ) {
|
162 |
|
163 |
-
|
164 |
|
165 |
ES()->contacts_db->bulk_insert( $contacts_data );
|
166 |
|
@@ -169,48 +179,52 @@ class ES_Import_Subscribers {
|
|
169 |
ES()->lists_contacts_db->remove_contacts_from_lists( $contact_ids, $list_id );
|
170 |
ES()->lists_contacts_db->do_import_contacts_into_list( $list_id, $contact_ids, $status, 1, $current_date_time );
|
171 |
}
|
172 |
-
|
173 |
$message = sprintf( __( 'Total %d contacts have been imported successfully!', 'email-subscribers' ), $imported_subscribers_count );
|
174 |
|
175 |
}
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
|
|
181 |
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
|
|
186 |
|
187 |
fclose( $handle );
|
188 |
-
|
189 |
ES_Common::show_message( $message, $response_status );
|
190 |
|
191 |
} else {
|
192 |
-
$message = __(
|
193 |
ES_Common::show_message( $message, 'error' );
|
194 |
}
|
195 |
} else {
|
196 |
-
$message = __(
|
197 |
ES_Common::show_message( $message, 'error' );
|
198 |
}
|
199 |
} else {
|
|
|
200 |
$message = sprintf( __( 'The file you are trying to upload is larger than %s. Please upload a smaller file.', 'email-subscribers' ), esc_html( size_format( $max_upload_size ) ) );
|
201 |
ES_Common::show_message( $message, 'error' );
|
202 |
}
|
203 |
} else {
|
204 |
-
$message = __(
|
205 |
ES_Common::show_message( $message, 'error' );
|
206 |
}
|
207 |
} else {
|
208 |
-
if( ! empty( $_FILES['file']['error'] ) ) {
|
209 |
-
switch( $_FILES['file']['error'] ) {
|
210 |
-
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
|
|
|
211 |
$message = sprintf( __( 'The file you are trying to upload is larger than %s. Please upload a smaller file.', 'email-subscribers' ), esc_html( size_format( $max_upload_size ) ) );
|
212 |
break;
|
213 |
-
default: //a default error, just in case! :)
|
214 |
$message = __( 'There was a problem with your upload.', 'email-subscribers' );
|
215 |
break;
|
216 |
}
|
@@ -221,7 +235,7 @@ class ES_Import_Subscribers {
|
|
221 |
ES_Common::show_message( $message, 'error' );
|
222 |
}
|
223 |
} else {
|
224 |
-
$message = __(
|
225 |
ES_Common::show_message( $message, 'error' );
|
226 |
}
|
227 |
}
|
@@ -232,10 +246,11 @@ class ES_Import_Subscribers {
|
|
232 |
|
233 |
public function prepare_import_subscriber_form() {
|
234 |
$max_upload_size = $this->get_max_upload_size();
|
|
|
235 |
?>
|
236 |
|
237 |
<div class="tool-box">
|
238 |
-
<div class="meta-box-sortables ui-sortable bg-white shadow-md ml-
|
239 |
<form class="ml-5 mr-4 text-left pt-4 mt-2 item-center" method="post" name="form_addemail" id="form_addemail" action="#" enctype="multipart/form-data">
|
240 |
<table class="max-w-full form-table">
|
241 |
<tbody>
|
@@ -243,12 +258,17 @@ class ES_Import_Subscribers {
|
|
243 |
<tr class="border-b border-gray-100">
|
244 |
<th scope="row" class="w-3/12 pt-3 pb-8 text-left">
|
245 |
<label for="tag-image"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-1">
|
246 |
-
<?php
|
247 |
</span>
|
248 |
-
<p class="italic text-xs font-normal text-gray-400 mt-2 ml-6 leading-snug"><?php echo sprintf( __( 'File size should be less than %s', 'email-subscribers' ), esc_html( size_format( $max_upload_size ) ) ); ?></p>
|
249 |
<p class="italic text-xs font-normal text-gray-400 mt-2 ml-6 leading-snug">
|
250 |
-
<?php
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
</th>
|
253 |
<td class="w-9/12 pb-3 ">
|
254 |
<input class="ml-12" type="file" name="file" id="file"/>
|
@@ -257,25 +277,30 @@ class ES_Import_Subscribers {
|
|
257 |
<tr class="border-b border-gray-100">
|
258 |
<th scope="row" class="w-3/12 pt-3 pb-8 text-left">
|
259 |
<label for="tag-email-status"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-2">
|
260 |
-
<?php
|
261 |
</label>
|
262 |
</th>
|
263 |
<td class="w-9/12 pb-3">
|
264 |
<select class="relative form-select shadow-sm border border-gray-400 w-1/3 ml-12" name="es_email_status" id="es_email_status">
|
265 |
-
<?php
|
|
|
|
|
|
|
266 |
</select>
|
267 |
</td>
|
268 |
</tr>
|
269 |
<tr class="border-b border-gray-100">
|
270 |
<th scope="row" class="w-3/12 pt-3 pb-8 text-left">
|
271 |
<label for="tag-email-group"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-2">
|
272 |
-
<?php
|
273 |
</label>
|
274 |
</th>
|
275 |
<td class="w-9/12 pb-3">
|
276 |
-
<select class="relative form-select shadow-sm border border-gray-400 w-1/3 ml-12"
|
277 |
-
|
278 |
-
|
|
|
|
|
279 |
</select>
|
280 |
</td>
|
281 |
</tr>
|
@@ -283,13 +308,13 @@ class ES_Import_Subscribers {
|
|
283 |
</table>
|
284 |
<p style="padding-top:10px;">
|
285 |
<?php wp_nonce_field( 'import-contacts', 'import_contacts' ); ?>
|
286 |
-
<input type="submit" name="submit" class="cursor-pointer ig-es-primary-button px-4 py-2 ml-6 mr-2 my-4" value="<?php
|
287 |
</p>
|
288 |
</form>
|
289 |
</div>
|
290 |
|
291 |
<?php
|
292 |
-
|
293 |
|
294 |
/**
|
295 |
* Show import contacts
|
@@ -305,11 +330,11 @@ class ES_Import_Subscribers {
|
|
305 |
?>
|
306 |
|
307 |
<div class="wrap max-w-full mt-1 font-sans">
|
308 |
-
<header class="ml-
|
309 |
|
310 |
<div class="mt-2">
|
311 |
<h2 class="text-2xl font-medium text-gray-800 sm:leading-9 sm:truncate">
|
312 |
-
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate"> <a href="admin.php?page=es_subscribers"><?php
|
313 |
<?php
|
314 |
ES_Common::prepare_main_header_navigation( $audience_tab_main_navigation );
|
315 |
?>
|
@@ -318,18 +343,18 @@ class ES_Import_Subscribers {
|
|
318 |
|
319 |
</header>
|
320 |
|
321 |
-
<div class="ml-
|
322 |
<?php $this->import_callback(); ?>
|
323 |
</div>
|
324 |
|
325 |
-
|
326 |
}
|
327 |
|
328 |
/**
|
329 |
* Get CSV file delimiter
|
330 |
*
|
331 |
* @param $file
|
332 |
-
* @param int
|
333 |
*
|
334 |
* @return mixed
|
335 |
*
|
25 |
*/
|
26 |
public function import_callback() {
|
27 |
|
28 |
+
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
29 |
|
30 |
$submit = ig_es_get_post_data( 'submit' );
|
31 |
if ( $submit ) {
|
32 |
$import_contacts_nonce = ig_es_get_post_data( 'import_contacts' );
|
33 |
if ( ! isset( $_POST['import_contacts'] ) || ! wp_verify_nonce( sanitize_key( $import_contacts_nonce ), 'import-contacts' ) ) {
|
34 |
+
$message = __( 'Sorry, you do not have permission to import contacts.', 'email-subscribers' );
|
35 |
ES_Common::show_message( $message, 'error' );
|
36 |
}
|
37 |
|
38 |
+
if ( isset( $_FILES['file'] ) ) {
|
39 |
|
40 |
$max_upload_size = $this->get_max_upload_size();
|
41 |
+
if ( isset( $_FILES['file']['tmp_name'] ) && is_uploaded_file( sanitize_text_field( $_FILES['file']['tmp_name'] ) ) ) {
|
42 |
|
43 |
+
$tmp_file = sanitize_text_field( $_FILES['file']['tmp_name'] );
|
44 |
+
$file = isset( $_FILES['file']['name'] ) ? sanitize_text_field( $_FILES['file']['name'] ) : '';
|
45 |
|
46 |
+
$ext = strtolower( substr( $file, strrpos( $file, '.' ), ( strlen( $file ) - strrpos( $file, '.' ) ) ) );
|
47 |
|
48 |
+
if ( '.csv' == $ext ) {
|
49 |
+
$file_size = isset( $_FILES['file']['size'] ) ? sanitize_text_field( $_FILES['file']['size'] ) : '';
|
50 |
|
51 |
// Check if CSV file size is less than or equal to max upload size.
|
52 |
+
if ( $file_size <= $max_upload_size ) {
|
53 |
+
if ( ! ini_get( 'auto_detect_line_endings' ) ) {
|
54 |
+
ini_set( 'auto_detect_line_endings', '1' );
|
55 |
}
|
56 |
|
57 |
$statuses = ES_Common::get_statuses_key_name_map();
|
81 |
// Get Headers
|
82 |
$headers = array_map( 'trim', fgetcsv( $handle, 0, $delimiter ) );
|
83 |
|
84 |
+
// Remove BOM characters from the first item.
|
85 |
+
if ( isset( $headers[0] ) ) {
|
86 |
+
$headers[0] = ig_es_remove_utf8_bom( $headers[0] );
|
87 |
+
}
|
88 |
+
|
89 |
$existing_contacts_email_id_map = ES()->contacts_db->get_email_id_map();
|
90 |
|
91 |
$existing_contacts = array();
|
94 |
$existing_contacts = array_map( 'strtolower', $existing_contacts );
|
95 |
}
|
96 |
|
97 |
+
$invalid_emails_count = 0;
|
98 |
+
$imported_subscribers_count = 0;
|
99 |
+
$existing_contacts_count = 0;
|
100 |
+
$emails = array();
|
101 |
|
102 |
+
$values = array();
|
103 |
+
$place_holders = array();
|
104 |
+
$contacts_data = array();
|
105 |
$current_date_time = ig_get_current_date_time();
|
106 |
|
107 |
$headers_column_count = count( $headers );
|
108 |
while ( ( $data = fgetcsv( $handle, 0, $delimiter ) ) !== false ) {
|
109 |
|
110 |
+
$data = array_map( 'trim', $data );
|
111 |
$data_column_count = count( $data );
|
112 |
|
113 |
// Verify if number of headers columns are equal to number of data columns.
|
114 |
+
if ( $headers_column_count !== $data_column_count ) {
|
115 |
+
$invalid_emails_count ++;
|
116 |
continue;
|
117 |
}
|
118 |
|
120 |
|
121 |
$email = isset( $data['Email'] ) ? strtolower( sanitize_email( trim( $data['Email'] ) ) ) : '';
|
122 |
|
123 |
+
if ( empty( $email ) || ! filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
|
124 |
$invalid_emails_count ++;
|
125 |
continue;
|
126 |
}
|
128 |
if ( ! in_array( $email, $existing_contacts ) ) {
|
129 |
|
130 |
// Convert emoji characters to equivalent HTML entities to avoid WordPress sanitization error in SQL query while bulk inserting contacts.
|
131 |
+
$name = isset( $data['Name'] ) ? ES_Common::handle_emoji_characters( sanitize_text_field( trim( $data['Name'] ) ) ) : '';
|
132 |
$first_name = isset( $data['First Name'] ) ? ES_Common::handle_emoji_characters( sanitize_text_field( trim( $data['First Name'] ) ) ) : '';
|
133 |
+
$last_name = isset( $data['Last Name'] ) ? ES_Common::handle_emoji_characters( sanitize_text_field( trim( $data['Last Name'] ) ) ) : '';
|
134 |
|
135 |
// If we don't get the first_name & last_name, consider Name field.
|
136 |
// If name empty, get the name from Email
|
157 |
|
158 |
$existing_contacts[] = $email;
|
159 |
|
160 |
+
$emails[] = $email;
|
161 |
|
162 |
+
$imported_subscribers_count ++;
|
163 |
} else {
|
164 |
$existing_contacts_count ++;
|
165 |
}
|
166 |
}
|
167 |
|
168 |
+
$message = '';
|
169 |
$response_status = 'error';
|
170 |
+
|
171 |
if ( count( $emails ) > 0 ) {
|
172 |
|
173 |
+
$response_status = 'success';
|
174 |
|
175 |
ES()->contacts_db->bulk_insert( $contacts_data );
|
176 |
|
179 |
ES()->lists_contacts_db->remove_contacts_from_lists( $contact_ids, $list_id );
|
180 |
ES()->lists_contacts_db->do_import_contacts_into_list( $list_id, $contact_ids, $status, 1, $current_date_time );
|
181 |
}
|
182 |
+
/* translators: %s: Total imported contacts */
|
183 |
$message = sprintf( __( 'Total %d contacts have been imported successfully!', 'email-subscribers' ), $imported_subscribers_count );
|
184 |
|
185 |
}
|
186 |
|
187 |
+
if ( $existing_contacts_count > 0 ) {
|
188 |
+
$message .= ' ';
|
189 |
+
/* translators: %s: Exisiting contacts count */
|
190 |
+
$message .= sprintf( __( '%d contact(s) are already exists.', 'email-subscribers' ), $existing_contacts_count );
|
191 |
+
}
|
192 |
|
193 |
+
if ( $invalid_emails_count > 0 ) {
|
194 |
+
$message .= ' ';
|
195 |
+
/* translators: %s: Invalid contacts count */
|
196 |
+
$message .= sprintf( __( '%d contact(s) are invalid.', 'email-subscribers' ), $invalid_emails_count );
|
197 |
+
}
|
198 |
|
199 |
fclose( $handle );
|
200 |
+
|
201 |
ES_Common::show_message( $message, $response_status );
|
202 |
|
203 |
} else {
|
204 |
+
$message = __( 'Error: Please Select List', 'email-subscribers' );
|
205 |
ES_Common::show_message( $message, 'error' );
|
206 |
}
|
207 |
} else {
|
208 |
+
$message = __( 'Error: Please select status', 'email-subscribers' );
|
209 |
ES_Common::show_message( $message, 'error' );
|
210 |
}
|
211 |
} else {
|
212 |
+
/* translators: %s: Max upload file size */
|
213 |
$message = sprintf( __( 'The file you are trying to upload is larger than %s. Please upload a smaller file.', 'email-subscribers' ), esc_html( size_format( $max_upload_size ) ) );
|
214 |
ES_Common::show_message( $message, 'error' );
|
215 |
}
|
216 |
} else {
|
217 |
+
$message = __( 'Error: Please Upload only CSV File', 'email-subscribers' );
|
218 |
ES_Common::show_message( $message, 'error' );
|
219 |
}
|
220 |
} else {
|
221 |
+
if ( ! empty( $_FILES['file']['error'] ) ) {
|
222 |
+
switch ( $_FILES['file']['error'] ) {
|
223 |
+
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
|
224 |
+
/* translators: %s: Max upload file size */
|
225 |
$message = sprintf( __( 'The file you are trying to upload is larger than %s. Please upload a smaller file.', 'email-subscribers' ), esc_html( size_format( $max_upload_size ) ) );
|
226 |
break;
|
227 |
+
default: // a default error, just in case! :)
|
228 |
$message = __( 'There was a problem with your upload.', 'email-subscribers' );
|
229 |
break;
|
230 |
}
|
235 |
ES_Common::show_message( $message, 'error' );
|
236 |
}
|
237 |
} else {
|
238 |
+
$message = __( 'Error: Please Upload File', 'email-subscribers' );
|
239 |
ES_Common::show_message( $message, 'error' );
|
240 |
}
|
241 |
}
|
246 |
|
247 |
public function prepare_import_subscriber_form() {
|
248 |
$max_upload_size = $this->get_max_upload_size();
|
249 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
250 |
?>
|
251 |
|
252 |
<div class="tool-box">
|
253 |
+
<div class="meta-box-sortables ui-sortable bg-white shadow-md ml-4 mt-6 rounded-lg">
|
254 |
<form class="ml-5 mr-4 text-left pt-4 mt-2 item-center" method="post" name="form_addemail" id="form_addemail" action="#" enctype="multipart/form-data">
|
255 |
<table class="max-w-full form-table">
|
256 |
<tbody>
|
258 |
<tr class="border-b border-gray-100">
|
259 |
<th scope="row" class="w-3/12 pt-3 pb-8 text-left">
|
260 |
<label for="tag-image"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-1">
|
261 |
+
<?php esc_html_e( 'Select CSV file', 'email-subscribers' ); ?>
|
262 |
</span>
|
|
|
263 |
<p class="italic text-xs font-normal text-gray-400 mt-2 ml-6 leading-snug">
|
264 |
+
<?php
|
265 |
+
/* translators: %s: Max upload size */
|
266 |
+
echo sprintf( esc_html__( 'File size should be less than %s', 'email-subscribers' ), esc_html( size_format( $max_upload_size ) ) );
|
267 |
+
?>
|
268 |
+
</p>
|
269 |
+
<p class="italic text-xs font-normal text-gray-400 mt-2 ml-6 leading-snug">
|
270 |
+
<?php esc_html_e( 'Check CSV structure', 'email-subscribers' ); ?>
|
271 |
+
<a class="font-medium" target="_blank" href="<?php echo esc_attr( plugin_dir_url( __FILE__ ) ) . '../../admin/partials/sample.csv'; ?>"><?php esc_html_e( 'from here', 'email-subscribers' ); ?></a></p></label>
|
272 |
</th>
|
273 |
<td class="w-9/12 pb-3 ">
|
274 |
<input class="ml-12" type="file" name="file" id="file"/>
|
277 |
<tr class="border-b border-gray-100">
|
278 |
<th scope="row" class="w-3/12 pt-3 pb-8 text-left">
|
279 |
<label for="tag-email-status"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-2">
|
280 |
+
<?php esc_html_e( 'Select status', 'email-subscribers' ); ?> </span><p></p>
|
281 |
</label>
|
282 |
</th>
|
283 |
<td class="w-9/12 pb-3">
|
284 |
<select class="relative form-select shadow-sm border border-gray-400 w-1/3 ml-12" name="es_email_status" id="es_email_status">
|
285 |
+
<?php
|
286 |
+
$statuses_dropdown = ES_Common::prepare_statuses_dropdown_options();
|
287 |
+
echo wp_kses( $statuses_dropdown , $allowedtags );
|
288 |
+
?>
|
289 |
</select>
|
290 |
</td>
|
291 |
</tr>
|
292 |
<tr class="border-b border-gray-100">
|
293 |
<th scope="row" class="w-3/12 pt-3 pb-8 text-left">
|
294 |
<label for="tag-email-group"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-2">
|
295 |
+
<?php esc_html_e( 'Select list', 'email-subscribers' ); ?>
|
296 |
</label>
|
297 |
</th>
|
298 |
<td class="w-9/12 pb-3">
|
299 |
+
<select name="list_id" id="list_id" class="relative form-select shadow-sm border border-gray-400 w-1/3 ml-12">
|
300 |
+
<?php
|
301 |
+
$lists_dropdown = ES_Common::prepare_list_dropdown_options();
|
302 |
+
echo wp_kses( $lists_dropdown , $allowedtags );
|
303 |
+
?>
|
304 |
</select>
|
305 |
</td>
|
306 |
</tr>
|
308 |
</table>
|
309 |
<p style="padding-top:10px;">
|
310 |
<?php wp_nonce_field( 'import-contacts', 'import_contacts' ); ?>
|
311 |
+
<input type="submit" name="submit" class="cursor-pointer ig-es-primary-button px-4 py-2 ml-6 mr-2 my-4" value="<?php esc_html_e( 'Import', 'email-subscribers' ); ?>" />
|
312 |
</p>
|
313 |
</form>
|
314 |
</div>
|
315 |
|
316 |
<?php
|
317 |
+
}
|
318 |
|
319 |
/**
|
320 |
* Show import contacts
|
330 |
?>
|
331 |
|
332 |
<div class="wrap max-w-full mt-1 font-sans">
|
333 |
+
<header class="ml-4 wp-heading-inline">
|
334 |
|
335 |
<div class="mt-2">
|
336 |
<h2 class="text-2xl font-medium text-gray-800 sm:leading-9 sm:truncate">
|
337 |
+
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate"> <a href="admin.php?page=es_subscribers"><?php esc_html_e( 'Audience', 'email-subscribers' ); ?> </a> </span> <svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="w-4 h-4 mt-1 inline-block align-middle"><path d="M9 5l7 7-7 7"></path></svg> <?php esc_html_e( 'Import Contacts', 'email-subscribers' ); ?>
|
338 |
<?php
|
339 |
ES_Common::prepare_main_header_navigation( $audience_tab_main_navigation );
|
340 |
?>
|
343 |
|
344 |
</header>
|
345 |
|
346 |
+
<div class="ml-4"><hr class="wp-header-end"></div>
|
347 |
<?php $this->import_callback(); ?>
|
348 |
</div>
|
349 |
|
350 |
+
<?php
|
351 |
}
|
352 |
|
353 |
/**
|
354 |
* Get CSV file delimiter
|
355 |
*
|
356 |
* @param $file
|
357 |
+
* @param int $check_lines
|
358 |
*
|
359 |
* @return mixed
|
360 |
*
|
lite/includes/classes/class-es-info.php
CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
class ES_Info {
|
9 |
|
10 |
-
static $instance;
|
11 |
|
12 |
public function __construct() {
|
13 |
add_action( 'admin_menu', array( $this, 'plugin_menu' ) );
|
@@ -17,8 +17,8 @@ class ES_Info {
|
|
17 |
$help_title = __( 'Help & Info', 'email-subscribers' );
|
18 |
add_submenu_page( 'es_dashboard', $help_title, $help_title, 'edit_posts', 'es_general_information', array( $this, 'es_information_callback' ) );
|
19 |
|
20 |
-
$pro_title
|
21 |
-
if( ! ES()->is_pro() ){
|
22 |
add_submenu_page( 'es_dashboard', $pro_title, $pro_title, 'edit_posts', 'es_pricing', array( $this, 'es_pricing_callback' ) );
|
23 |
}
|
24 |
}
|
@@ -35,11 +35,11 @@ class ES_Info {
|
|
35 |
$update_url = add_query_arg( 'from_db_version', '3.5.18', $update_url );
|
36 |
$update_url = wp_nonce_url( $update_url, 'ig_es_db_update', 'ig_es_db_update_nonce' );
|
37 |
|
38 |
-
include_once
|
39 |
}
|
40 |
|
41 |
public static function es_pricing_callback() {
|
42 |
-
//remove because of warning
|
43 |
// $url = 'https://www.icegram.com/email-subscribers-pricing/';
|
44 |
// header('Location: ' . $url );
|
45 |
}
|
@@ -52,4 +52,4 @@ class ES_Info {
|
|
52 |
return self::$instance;
|
53 |
}
|
54 |
|
55 |
-
}
|
7 |
|
8 |
class ES_Info {
|
9 |
|
10 |
+
public static $instance;
|
11 |
|
12 |
public function __construct() {
|
13 |
add_action( 'admin_menu', array( $this, 'plugin_menu' ) );
|
17 |
$help_title = __( 'Help & Info', 'email-subscribers' );
|
18 |
add_submenu_page( 'es_dashboard', $help_title, $help_title, 'edit_posts', 'es_general_information', array( $this, 'es_information_callback' ) );
|
19 |
|
20 |
+
$pro_title = __( '<span class="es-fire-sale"> 🔥 </span> Go Pro', 'email-subscribers' );
|
21 |
+
if ( ! ES()->is_pro() ) {
|
22 |
add_submenu_page( 'es_dashboard', $pro_title, $pro_title, 'edit_posts', 'es_pricing', array( $this, 'es_pricing_callback' ) );
|
23 |
}
|
24 |
}
|
35 |
$update_url = add_query_arg( 'from_db_version', '3.5.18', $update_url );
|
36 |
$update_url = wp_nonce_url( $update_url, 'ig_es_db_update', 'ig_es_db_update_nonce' );
|
37 |
|
38 |
+
include_once ES_PLUGIN_DIR . '/lite/admin/partials/help.php';
|
39 |
}
|
40 |
|
41 |
public static function es_pricing_callback() {
|
42 |
+
// remove because of warning
|
43 |
// $url = 'https://www.icegram.com/email-subscribers-pricing/';
|
44 |
// header('Location: ' . $url );
|
45 |
}
|
52 |
return self::$instance;
|
53 |
}
|
54 |
|
55 |
+
}
|
lite/includes/classes/class-es-lists-table.php
CHANGED
@@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
}
|
7 |
|
8 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
9 |
-
require_once
|
10 |
}
|
11 |
|
12 |
class ES_Lists_Table extends WP_List_Table {
|
@@ -15,13 +15,13 @@ class ES_Lists_Table extends WP_List_Table {
|
|
15 |
*
|
16 |
* @since 4.2.1
|
17 |
* @var $db
|
18 |
-
*
|
19 |
*/
|
20 |
protected $db;
|
21 |
/**
|
|
|
|
|
22 |
* @since 4.2.1
|
23 |
* @var string
|
24 |
-
*
|
25 |
*/
|
26 |
public static $option_per_page = 'es_lists_per_page';
|
27 |
|
@@ -32,12 +32,14 @@ class ES_Lists_Table extends WP_List_Table {
|
|
32 |
*/
|
33 |
public function __construct() {
|
34 |
|
35 |
-
parent::__construct(
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
41 |
|
42 |
$this->db = new ES_DB_Lists();
|
43 |
}
|
@@ -53,7 +55,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
53 |
$args = array(
|
54 |
'label' => __( 'Number of lists per page', 'email-subscribers' ),
|
55 |
'default' => 20,
|
56 |
-
'option' => self::$option_per_page
|
57 |
);
|
58 |
|
59 |
add_screen_option( $option, $args );
|
@@ -66,15 +68,17 @@ class ES_Lists_Table extends WP_List_Table {
|
|
66 |
|
67 |
?>
|
68 |
<div class="wrap">
|
69 |
-
<?php
|
|
|
70 |
$this->es_new_lists_callback();
|
71 |
} elseif ( 'edit' === $action ) {
|
72 |
$list = ig_es_get_request_data( 'list' );
|
73 |
-
echo $this->edit_list( absint( $list ) );
|
74 |
-
} else {
|
|
|
75 |
|
76 |
-
<h1 class=" wp-heading-inline "><span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate"><a href="admin.php?page=es_subscribers"><?php
|
77 |
-
</span> <svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="w-4 h-4 mt-1 inline-block align-middle"><path d="M9 5l7 7-7 7"></path></svg><span class="text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate"> <?php
|
78 |
<br>
|
79 |
|
80 |
<div id="poststuff" class="es-items-lists es-lists-table">
|
@@ -84,7 +88,8 @@ class ES_Lists_Table extends WP_List_Table {
|
|
84 |
<form method="post">
|
85 |
<?php
|
86 |
$this->prepare_items();
|
87 |
-
$this->display();
|
|
|
88 |
</form>
|
89 |
</div>
|
90 |
</div>
|
@@ -92,8 +97,9 @@ class ES_Lists_Table extends WP_List_Table {
|
|
92 |
<br class="clear">
|
93 |
</div>
|
94 |
</div>
|
95 |
-
|
96 |
-
|
|
|
97 |
|
98 |
/**
|
99 |
* Validate data
|
@@ -121,7 +127,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
121 |
|
122 |
$response = array(
|
123 |
'status' => $status,
|
124 |
-
'message' => $message
|
125 |
);
|
126 |
|
127 |
return $response;
|
@@ -161,8 +167,6 @@ class ES_Lists_Table extends WP_List_Table {
|
|
161 |
if ( $save ) {
|
162 |
$message = __( 'List has been added successfully!', 'email-subscribers' );
|
163 |
ES_Common::show_message( $message, 'success' );
|
164 |
-
} else {
|
165 |
-
|
166 |
}
|
167 |
}
|
168 |
|
@@ -210,9 +214,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
210 |
if ( $save ) {
|
211 |
$message = __( 'List has been updated successfully!', 'email-subscribers' );
|
212 |
ES_Common::show_message( $message, 'success' );
|
213 |
-
}
|
214 |
-
|
215 |
-
}
|
216 |
} else {
|
217 |
|
218 |
$id = $list['id'];
|
@@ -251,14 +253,14 @@ class ES_Lists_Table extends WP_List_Table {
|
|
251 |
<div class="flex-1 min-w-0">
|
252 |
<h2 class="text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate">
|
253 |
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate">
|
254 |
-
<a href="admin.php?page=es_subscribers"><?php
|
255 |
-
<a class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate" href="admin.php?page=es_lists&action=manage-lists"><?php
|
256 |
|
257 |
<?php
|
258 |
if ( $is_new ) {
|
259 |
-
|
260 |
} else {
|
261 |
-
|
262 |
}
|
263 |
|
264 |
?>
|
@@ -272,12 +274,12 @@ class ES_Lists_Table extends WP_List_Table {
|
|
272 |
<div id="post-body" class="metabox-holder column-1">
|
273 |
<div id="post-body-content">
|
274 |
<div class="bg-white shadow-md rounded-lg">
|
275 |
-
<form class="ml-5 mr-4 text-left pt-8 flex-row mt-2 item-center " method="post" action="admin.php?page=es_lists&action=<?php echo $action; ?>&list=<?php echo $id; ?>&_wpnonce=<?php echo $nonce; ?>">
|
276 |
|
277 |
<div class="flex flex-row ">
|
278 |
<div class="flex w-1/5">
|
279 |
<div class="ml-4 pt-6 px-3 ">
|
280 |
-
<label for="name" class="block text-sm leading-5 font-medium text-gray-600"><?php
|
281 |
</div>
|
282 |
</div>
|
283 |
<div class="flex">
|
@@ -289,17 +291,12 @@ class ES_Lists_Table extends WP_List_Table {
|
|
289 |
</div>
|
290 |
</div>
|
291 |
</div>
|
292 |
-
|
|
|
|
|
293 |
<input type="hidden" name="submitted" value="submitted"/>
|
294 |
-
<input type="submit" name="submit" id="submit" class="cursor-pointer align-middle ig-es-primary-button px-4 py-2 my-4 ml-6 mr-2" value="<?php
|
295 |
-
|
296 |
-
}
|
297 |
-
else{
|
298 |
-
_e( 'Save Changes', 'email-subscribers' );
|
299 |
-
}
|
300 |
-
|
301 |
-
?>"/><!-- <?php submit_button(); ?> -->
|
302 |
-
<a href="admin.php?page=es_lists&action=manage-lists" class="cursor-pointer align-middle rounded-md border border-indigo-600 hover:shadow-md focus:outline-none focus:shadow-outline-indigo text-sm leading-5 font-medium transition ease-in-out duration-150 px-4 my-2 py-2 mx-2 ">Cancel</a>
|
303 |
</form>
|
304 |
</div>
|
305 |
</div>
|
@@ -312,7 +309,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
312 |
|
313 |
<?php
|
314 |
|
315 |
-
|
316 |
|
317 |
/**
|
318 |
* Save list
|
@@ -345,37 +342,37 @@ class ES_Lists_Table extends WP_List_Table {
|
|
345 |
* @return mixed
|
346 |
*/
|
347 |
public function get_lists( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
348 |
-
|
349 |
-
global $wpdb;
|
350 |
|
351 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
352 |
$order = ig_es_get_request_data( 'order' );
|
353 |
$search = ig_es_get_request_data( 's' );
|
354 |
|
355 |
if ( $do_count_only ) {
|
356 |
-
$sql =
|
357 |
} else {
|
358 |
-
$sql =
|
359 |
}
|
360 |
|
361 |
-
$args
|
|
|
362 |
|
363 |
$add_where_clause = false;
|
364 |
|
365 |
if ( ! empty( $search ) ) {
|
366 |
-
$query[] =
|
367 |
-
$args[] =
|
368 |
|
369 |
$add_where_clause = true;
|
370 |
}
|
371 |
|
372 |
if ( $add_where_clause ) {
|
373 |
-
$sql .=
|
374 |
|
375 |
if ( count( $query ) > 0 ) {
|
376 |
-
$sql .= implode(
|
377 |
if ( count( $args ) > 0 ) {
|
378 |
-
$sql = $
|
379 |
}
|
380 |
}
|
381 |
}
|
@@ -404,10 +401,10 @@ class ES_Lists_Table extends WP_List_Table {
|
|
404 |
$sql .= " LIMIT $per_page";
|
405 |
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
|
406 |
|
407 |
-
$result = $
|
408 |
|
409 |
} else {
|
410 |
-
$result = $
|
411 |
}
|
412 |
|
413 |
return $result;
|
@@ -416,7 +413,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
416 |
/**
|
417 |
* Render a column when no column specific method exist.
|
418 |
*
|
419 |
-
* @param array
|
420 |
* @param string $column_name
|
421 |
*
|
422 |
* @return mixed
|
@@ -426,62 +423,59 @@ class ES_Lists_Table extends WP_List_Table {
|
|
426 |
switch ( $column_name ) {
|
427 |
|
428 |
case 'subscribed':
|
|
|
|
|
|
|
|
|
|
|
|
|
429 |
|
430 |
-
|
431 |
-
|
432 |
-
$url = admin_url( 'admin.php?page=es_subscribers&filter_by_status=subscribed&filter_by_list_id=' . $item['id'] );
|
433 |
-
$count = sprintf( __( '<a href="%s" target="_blank">%d</a>', 'email-subscribers' ), $url, $count );
|
434 |
-
}
|
435 |
-
|
436 |
-
return $count;
|
437 |
-
break;
|
438 |
|
439 |
case 'unsubscribed':
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
|
441 |
-
|
442 |
-
|
443 |
-
$url = admin_url( 'admin.php?page=es_subscribers&filter_by_status=unsubscribed&filter_by_list_id=' . $item['id'] );
|
444 |
-
$count = sprintf( __( '<a href="%s" target="_blank">%d</a>', 'email-subscribers' ), $url, $count );
|
445 |
-
}
|
446 |
-
|
447 |
-
return $count;
|
448 |
-
break;
|
449 |
|
450 |
case 'unconfirmed':
|
|
|
|
|
|
|
|
|
|
|
|
|
451 |
|
452 |
-
|
453 |
-
|
454 |
-
$url = admin_url( 'admin.php?page=es_subscribers&filter_by_status=unconfirmed&filter_by_list_id=' . $item['id'] );
|
455 |
-
$count = sprintf( __( '<a href="%s" target="_blank">%d</a>', 'email-subscribers' ), $url, $count );
|
456 |
-
}
|
457 |
-
|
458 |
-
return $count;
|
459 |
-
break;
|
460 |
|
461 |
case 'all_contacts':
|
|
|
|
|
|
|
|
|
|
|
|
|
462 |
|
463 |
-
|
464 |
-
|
465 |
-
$url = admin_url( 'admin.php?page=es_subscribers&filter_by_list_id=' . $item['id'] );
|
466 |
-
$count = sprintf( __( '<a href="%s" target="_blank">%d</a>', 'email-subscribers' ), $url, $count );
|
467 |
-
}
|
468 |
-
|
469 |
-
return $count;
|
470 |
-
break;
|
471 |
|
472 |
case 'created_at':
|
473 |
-
|
474 |
-
|
475 |
-
break;
|
476 |
|
477 |
case 'export':
|
478 |
-
|
479 |
-
|
480 |
-
break;
|
481 |
|
482 |
default:
|
483 |
-
|
484 |
-
return '';
|
485 |
}
|
486 |
}
|
487 |
|
@@ -492,9 +486,10 @@ class ES_Lists_Table extends WP_List_Table {
|
|
492 |
*
|
493 |
* @return string
|
494 |
*/
|
495 |
-
function column_cb( $item ) {
|
496 |
return sprintf(
|
497 |
-
'<input type="checkbox" name="lists[]" value="%s" />',
|
|
|
498 |
);
|
499 |
}
|
500 |
|
@@ -505,17 +500,19 @@ class ES_Lists_Table extends WP_List_Table {
|
|
505 |
*
|
506 |
* @return string
|
507 |
*/
|
508 |
-
function column_name( $item ) {
|
509 |
|
510 |
$list_nonce = wp_create_nonce( 'es_list' );
|
511 |
|
512 |
$title = '<strong>' . $item['name'] . '</strong>';
|
513 |
$actions = array();
|
514 |
-
if ( $item['id']
|
515 |
$page = ig_es_get_request_data( 'page' );
|
516 |
$actions = array(
|
517 |
-
|
518 |
-
'
|
|
|
|
|
519 |
);
|
520 |
}
|
521 |
|
@@ -528,7 +525,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
528 |
*
|
529 |
* @return array
|
530 |
*/
|
531 |
-
function get_columns() {
|
532 |
|
533 |
$columns = array(
|
534 |
'cb' => '<input type="checkbox" />',
|
@@ -538,7 +535,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
538 |
'unconfirmed' => __( 'Unconfirmed', 'email-subscribers' ),
|
539 |
'all_contacts' => __( 'All Contacts', 'email-subscribers' ),
|
540 |
'created_at' => __( 'Created', 'email-subscribers' ),
|
541 |
-
'export' => __( 'Export', 'email-subscribers' )
|
542 |
);
|
543 |
|
544 |
return apply_filters( 'ig_es_lists_columns', $columns );
|
@@ -566,7 +563,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
566 |
*/
|
567 |
public function get_bulk_actions() {
|
568 |
$actions = array(
|
569 |
-
'bulk_delete' => __( 'Delete', 'email-subscribers' )
|
570 |
);
|
571 |
|
572 |
return $actions;
|
@@ -581,13 +578,15 @@ class ES_Lists_Table extends WP_List_Table {
|
|
581 |
* @since 4.0.0
|
582 |
* @since 4.3.4 Added esc_attr()
|
583 |
*/
|
584 |
-
public function search_box( $text = '', $input_id = '' ) {
|
|
|
585 |
<p class="search-box">
|
586 |
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $text ); ?>:</label>
|
587 |
-
<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
|
588 |
<?php submit_button( __( 'Search Lists', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
589 |
</p>
|
590 |
-
|
|
|
591 |
|
592 |
/**
|
593 |
* Handles data query and filter, sorting, and pagination.
|
@@ -604,17 +603,19 @@ class ES_Lists_Table extends WP_List_Table {
|
|
604 |
$current_page = $this->get_pagenum();
|
605 |
$total_items = $this->get_lists( 0, 0, true );
|
606 |
|
607 |
-
$this->set_pagination_args(
|
608 |
-
|
609 |
-
|
610 |
-
|
|
|
|
|
611 |
|
612 |
$this->items = $this->get_lists( $per_page, $current_page );
|
613 |
}
|
614 |
|
615 |
public function process_bulk_action() {
|
616 |
|
617 |
-
//Detect when a bulk action is being triggered...
|
618 |
if ( 'edit' === $this->current_action() ) {
|
619 |
|
620 |
// In our file that handles the request, verify the nonce.
|
@@ -628,7 +629,6 @@ class ES_Lists_Table extends WP_List_Table {
|
|
628 |
$message = __( 'List has been updated successfully!', 'email-subscribers' );
|
629 |
ES_Common::show_message( $message, 'success' );
|
630 |
}
|
631 |
-
|
632 |
}
|
633 |
|
634 |
if ( 'delete' === $this->current_action() ) {
|
@@ -641,7 +641,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
641 |
ES_Common::show_message( $message, 'error' );
|
642 |
} else {
|
643 |
$list = ig_es_get_request_data( 'list' );
|
644 |
-
if (
|
645 |
$list = ig_es_get_request_data( 'list' );
|
646 |
$this->db->delete_lists( array( $list ) );
|
647 |
$message = __( 'List has been deleted successfully!', 'email-subscribers' );
|
@@ -674,7 +674,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
674 |
|
675 |
$statuses = array(
|
676 |
'enable' => __( 'Enable', 'email-subscribers' ),
|
677 |
-
'disable' => __( 'Disable', 'email-subscribers' )
|
678 |
);
|
679 |
|
680 |
if ( ! in_array( $status, array_keys( $statuses ) ) ) {
|
@@ -686,7 +686,7 @@ class ES_Lists_Table extends WP_List_Table {
|
|
686 |
|
687 |
/** Text displayed when no list data is available */
|
688 |
public function no_items() {
|
689 |
-
|
690 |
}
|
691 |
|
692 |
}
|
6 |
}
|
7 |
|
8 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
9 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
10 |
}
|
11 |
|
12 |
class ES_Lists_Table extends WP_List_Table {
|
15 |
*
|
16 |
* @since 4.2.1
|
17 |
* @var $db
|
|
|
18 |
*/
|
19 |
protected $db;
|
20 |
/**
|
21 |
+
* Numbers of list options per page
|
22 |
+
*
|
23 |
* @since 4.2.1
|
24 |
* @var string
|
|
|
25 |
*/
|
26 |
public static $option_per_page = 'es_lists_per_page';
|
27 |
|
32 |
*/
|
33 |
public function __construct() {
|
34 |
|
35 |
+
parent::__construct(
|
36 |
+
array(
|
37 |
+
'singular' => __( 'List', 'email-subscribers' ), // singular name of the listed records
|
38 |
+
'plural' => __( 'Lists', 'email-subscribers' ), // plural name of the listed records
|
39 |
+
'ajax' => false, // does this table support ajax?,
|
40 |
+
'screen' => 'es_lists',
|
41 |
+
)
|
42 |
+
);
|
43 |
|
44 |
$this->db = new ES_DB_Lists();
|
45 |
}
|
55 |
$args = array(
|
56 |
'label' => __( 'Number of lists per page', 'email-subscribers' ),
|
57 |
'default' => 20,
|
58 |
+
'option' => self::$option_per_page,
|
59 |
);
|
60 |
|
61 |
add_screen_option( $option, $args );
|
68 |
|
69 |
?>
|
70 |
<div class="wrap">
|
71 |
+
<?php
|
72 |
+
if ( 'new' === $action ) {
|
73 |
$this->es_new_lists_callback();
|
74 |
} elseif ( 'edit' === $action ) {
|
75 |
$list = ig_es_get_request_data( 'list' );
|
76 |
+
echo wp_kses_post( $this->edit_list( absint( $list ) ) );
|
77 |
+
} else {
|
78 |
+
?>
|
79 |
|
80 |
+
<h1 class=" wp-heading-inline "><span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate"><a href="admin.php?page=es_subscribers"><?php esc_html_e( 'Audience', 'email-subscribers' ); ?> </a>
|
81 |
+
</span> <svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="w-4 h-4 mt-1 inline-block align-middle"><path d="M9 5l7 7-7 7"></path></svg><span class="text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate"> <?php esc_html_e('Lists', 'email-subscribers'); ?></span> <a href="admin.php?page=es_lists&action=new" class="pt-2 ig-es-title-button px-2 py-2 mx-2"><?php esc_html_e('Add New', 'email-subscribers'); ?></a></h1>
|
82 |
<br>
|
83 |
|
84 |
<div id="poststuff" class="es-items-lists es-lists-table">
|
88 |
<form method="post">
|
89 |
<?php
|
90 |
$this->prepare_items();
|
91 |
+
$this->display();
|
92 |
+
?>
|
93 |
</form>
|
94 |
</div>
|
95 |
</div>
|
97 |
<br class="clear">
|
98 |
</div>
|
99 |
</div>
|
100 |
+
<?php
|
101 |
+
}
|
102 |
+
}
|
103 |
|
104 |
/**
|
105 |
* Validate data
|
127 |
|
128 |
$response = array(
|
129 |
'status' => $status,
|
130 |
+
'message' => $message,
|
131 |
);
|
132 |
|
133 |
return $response;
|
167 |
if ( $save ) {
|
168 |
$message = __( 'List has been added successfully!', 'email-subscribers' );
|
169 |
ES_Common::show_message( $message, 'success' );
|
|
|
|
|
170 |
}
|
171 |
}
|
172 |
|
214 |
if ( $save ) {
|
215 |
$message = __( 'List has been updated successfully!', 'email-subscribers' );
|
216 |
ES_Common::show_message( $message, 'success' );
|
217 |
+
}
|
|
|
|
|
218 |
} else {
|
219 |
|
220 |
$id = $list['id'];
|
253 |
<div class="flex-1 min-w-0">
|
254 |
<h2 class="text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate">
|
255 |
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate">
|
256 |
+
<a href="admin.php?page=es_subscribers"><?php esc_html_e('Audience ', 'email-subscribers'); ?></a></span> <svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="w-3 h-3 mt-1 inline-block align-middle"><path d="M9 5l7 7-7 7"></path></svg>
|
257 |
+
<a class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate" href="admin.php?page=es_lists&action=manage-lists"><?php esc_html_e(' Lists ', 'email-subscribers'); ?></a> <svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="w-3 h-3 mt-1 inline-block align-middle"><path d="M9 5l7 7-7 7"></path></svg>
|
258 |
|
259 |
<?php
|
260 |
if ( $is_new ) {
|
261 |
+
esc_html_e( 'Add New', 'email-subscribers' );
|
262 |
} else {
|
263 |
+
esc_html_e( 'Edit List', 'email-subscribers' );
|
264 |
}
|
265 |
|
266 |
?>
|
274 |
<div id="post-body" class="metabox-holder column-1">
|
275 |
<div id="post-body-content">
|
276 |
<div class="bg-white shadow-md rounded-lg">
|
277 |
+
<form class="ml-5 mr-4 text-left pt-8 flex-row mt-2 item-center " method="post" action="admin.php?page=es_lists&action=<?php echo esc_attr( $action ); ?>&list=<?php echo esc_attr( $id ); ?>&_wpnonce=<?php echo esc_attr( $nonce ); ?>">
|
278 |
|
279 |
<div class="flex flex-row ">
|
280 |
<div class="flex w-1/5">
|
281 |
<div class="ml-4 pt-6 px-3 ">
|
282 |
+
<label for="name" class="block text-sm leading-5 font-medium text-gray-600"><?php esc_html_e( 'List Name', 'email-subscribers' ); ?></label>
|
283 |
</div>
|
284 |
</div>
|
285 |
<div class="flex">
|
291 |
</div>
|
292 |
</div>
|
293 |
</div>
|
294 |
+
<?php
|
295 |
+
$submit_button_text = $is_new ? __( 'Save List', 'email-subscribers' ) : __( 'Save Changes', 'email-subscribers' );
|
296 |
+
?>
|
297 |
<input type="hidden" name="submitted" value="submitted"/>
|
298 |
+
<input type="submit" name="submit" id="submit" class="cursor-pointer align-middle ig-es-primary-button px-4 py-2 my-4 ml-6 mr-2" value="<?php echo esc_attr( $submit_button_text ); ?>"/>
|
299 |
+
<a href="admin.php?page=es_lists&action=manage-lists" class="cursor-pointer align-middle rounded-md border border-indigo-600 hover:shadow-md focus:outline-none focus:shadow-outline-indigo text-sm leading-5 font-medium transition ease-in-out duration-150 px-4 my-2 py-2 mx-2 "><?php esc_html_e( 'Cancel', 'email-subscribers' ); ?></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
</form>
|
301 |
</div>
|
302 |
</div>
|
309 |
|
310 |
<?php
|
311 |
|
312 |
+
}
|
313 |
|
314 |
/**
|
315 |
* Save list
|
342 |
* @return mixed
|
343 |
*/
|
344 |
public function get_lists( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
345 |
+
global $wpbd;
|
|
|
346 |
|
347 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
348 |
$order = ig_es_get_request_data( 'order' );
|
349 |
$search = ig_es_get_request_data( 's' );
|
350 |
|
351 |
if ( $do_count_only ) {
|
352 |
+
$sql = 'SELECT count(*) as total FROM ' . IG_LISTS_TABLE;
|
353 |
} else {
|
354 |
+
$sql = 'SELECT * FROM ' . IG_LISTS_TABLE;
|
355 |
}
|
356 |
|
357 |
+
$args = array();
|
358 |
+
$query = array();
|
359 |
|
360 |
$add_where_clause = false;
|
361 |
|
362 |
if ( ! empty( $search ) ) {
|
363 |
+
$query[] = ' name LIKE %s ';
|
364 |
+
$args[] = '%' . $wpbd->esc_like( $search ) . '%';
|
365 |
|
366 |
$add_where_clause = true;
|
367 |
}
|
368 |
|
369 |
if ( $add_where_clause ) {
|
370 |
+
$sql .= ' WHERE ';
|
371 |
|
372 |
if ( count( $query ) > 0 ) {
|
373 |
+
$sql .= implode( ' AND ', $query );
|
374 |
if ( count( $args ) > 0 ) {
|
375 |
+
$sql = $wpbd->prepare( $sql, $args );
|
376 |
}
|
377 |
}
|
378 |
}
|
401 |
$sql .= " LIMIT $per_page";
|
402 |
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
|
403 |
|
404 |
+
$result = $wpbd->get_results( $sql, 'ARRAY_A' );
|
405 |
|
406 |
} else {
|
407 |
+
$result = $wpbd->get_var( $sql );
|
408 |
}
|
409 |
|
410 |
return $result;
|
413 |
/**
|
414 |
* Render a column when no column specific method exist.
|
415 |
*
|
416 |
+
* @param array $item
|
417 |
* @param string $column_name
|
418 |
*
|
419 |
* @return mixed
|
423 |
switch ( $column_name ) {
|
424 |
|
425 |
case 'subscribed':
|
426 |
+
$count = ES()->lists_contacts_db->get_total_count_by_list( $item['id'], 'subscribed' );
|
427 |
+
if ( $count > 0 ) {
|
428 |
+
$url = admin_url( 'admin.php?page=es_subscribers&filter_by_status=subscribed&filter_by_list_id=' . $item['id'] );
|
429 |
+
/* translators: 1: Subscribed-Filter url 2: Count */
|
430 |
+
$count = sprintf( __( '<a href="%1$s" target="_blank">%2$d</a>', 'email-subscribers' ), $url, $count );
|
431 |
+
}
|
432 |
|
433 |
+
return $count;
|
434 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
435 |
|
436 |
case 'unsubscribed':
|
437 |
+
$count = ES()->lists_contacts_db->get_total_count_by_list( $item['id'], 'unsubscribed' );
|
438 |
+
if ( $count > 0 ) {
|
439 |
+
$url = admin_url( 'admin.php?page=es_subscribers&filter_by_status=unsubscribed&filter_by_list_id=' . $item['id'] );
|
440 |
+
/* translators: 1: Unsubscribed-Filter url 2: Count */
|
441 |
+
$count = sprintf( __( '<a href="%1$s" target="_blank">%2$d</a>', 'email-subscribers' ), $url, $count );
|
442 |
+
}
|
443 |
|
444 |
+
return $count;
|
445 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
|
447 |
case 'unconfirmed':
|
448 |
+
$count = ES()->lists_contacts_db->get_total_count_by_list( $item['id'], 'unconfirmed' );
|
449 |
+
if ( $count > 0 ) {
|
450 |
+
$url = admin_url( 'admin.php?page=es_subscribers&filter_by_status=unconfirmed&filter_by_list_id=' . $item['id'] );
|
451 |
+
/* translators: 1: Unconfirmed-Filter url 2: Count */
|
452 |
+
$count = sprintf( __( '<a href="%1$s" target="_blank">%2$d</a>', 'email-subscribers' ), $url, $count );
|
453 |
+
}
|
454 |
|
455 |
+
return $count;
|
456 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
|
458 |
case 'all_contacts':
|
459 |
+
$count = ES()->lists_contacts_db->get_total_count_by_list( $item['id'], 'all' );
|
460 |
+
if ( $count > 0 ) {
|
461 |
+
$url = admin_url( 'admin.php?page=es_subscribers&filter_by_list_id=' . $item['id'] );
|
462 |
+
/* translators: 1: All contacts flters 2: Count */
|
463 |
+
$count = sprintf( __( '<a href="%1$s" target="_blank">%2$d</a>', 'email-subscribers' ), $url, $count );
|
464 |
+
}
|
465 |
|
466 |
+
return $count;
|
467 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
|
469 |
case 'created_at':
|
470 |
+
return ig_es_format_date_time( $item[ $column_name ] );
|
471 |
+
break;
|
|
|
472 |
|
473 |
case 'export':
|
474 |
+
return "<a href='admin.php?page=download_report&report=users&status=select_list&list_id={$item['id']}'><svg fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24' class='w-8 h-8 text-indigo-600 hover:text-indigo-500 active:text-indigo-600'><path d='M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'></path></svg></a>";
|
475 |
+
break;
|
|
|
476 |
|
477 |
default:
|
478 |
+
return '';
|
|
|
479 |
}
|
480 |
}
|
481 |
|
486 |
*
|
487 |
* @return string
|
488 |
*/
|
489 |
+
public function column_cb( $item ) {
|
490 |
return sprintf(
|
491 |
+
'<input type="checkbox" name="lists[]" value="%s" />',
|
492 |
+
$item['id']
|
493 |
);
|
494 |
}
|
495 |
|
500 |
*
|
501 |
* @return string
|
502 |
*/
|
503 |
+
public function column_name( $item ) {
|
504 |
|
505 |
$list_nonce = wp_create_nonce( 'es_list' );
|
506 |
|
507 |
$title = '<strong>' . $item['name'] . '</strong>';
|
508 |
$actions = array();
|
509 |
+
if ( 1 != $item['id'] ) {
|
510 |
$page = ig_es_get_request_data( 'page' );
|
511 |
$actions = array(
|
512 |
+
/* translators: 1: Page 2: Edit action 3: List id 4: List nonce */
|
513 |
+
'edit' => sprintf( __( '<a href="?page=%1$s&action=%2$s&list=%3$s&_wpnonce=%4$s" class="text-indigo-600">Edit</a>', 'email-subscribers' ), esc_attr( $page ), 'edit', absint( $item['id'] ), $list_nonce ),
|
514 |
+
/* translators: 1: Page 2: Delete action 3: List id 4: List nonce */
|
515 |
+
'delete' => sprintf( __( '<a href="?page=%1$s&action=%2$s&list=%3$s&_wpnonce=%4$s" onclick="return checkDelete()">Delete</a>', 'email-subscribers' ), esc_attr( $page ), 'delete', absint( $item['id'] ), $list_nonce )
|
516 |
);
|
517 |
}
|
518 |
|
525 |
*
|
526 |
* @return array
|
527 |
*/
|
528 |
+
public function get_columns() {
|
529 |
|
530 |
$columns = array(
|
531 |
'cb' => '<input type="checkbox" />',
|
535 |
'unconfirmed' => __( 'Unconfirmed', 'email-subscribers' ),
|
536 |
'all_contacts' => __( 'All Contacts', 'email-subscribers' ),
|
537 |
'created_at' => __( 'Created', 'email-subscribers' ),
|
538 |
+
'export' => __( 'Export', 'email-subscribers' ),
|
539 |
);
|
540 |
|
541 |
return apply_filters( 'ig_es_lists_columns', $columns );
|
563 |
*/
|
564 |
public function get_bulk_actions() {
|
565 |
$actions = array(
|
566 |
+
'bulk_delete' => __( 'Delete', 'email-subscribers' ),
|
567 |
);
|
568 |
|
569 |
return $actions;
|
578 |
* @since 4.0.0
|
579 |
* @since 4.3.4 Added esc_attr()
|
580 |
*/
|
581 |
+
public function search_box( $text = '', $input_id = '' ) {
|
582 |
+
?>
|
583 |
<p class="search-box">
|
584 |
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $text ); ?>:</label>
|
585 |
+
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>"/>
|
586 |
<?php submit_button( __( 'Search Lists', 'email-subscribers' ), 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
587 |
</p>
|
588 |
+
<?php
|
589 |
+
}
|
590 |
|
591 |
/**
|
592 |
* Handles data query and filter, sorting, and pagination.
|
603 |
$current_page = $this->get_pagenum();
|
604 |
$total_items = $this->get_lists( 0, 0, true );
|
605 |
|
606 |
+
$this->set_pagination_args(
|
607 |
+
array(
|
608 |
+
'total_items' => $total_items, // WE have to calculate the total number of items
|
609 |
+
'per_page' => $per_page, // WE have to determine how many items to show on a page
|
610 |
+
)
|
611 |
+
);
|
612 |
|
613 |
$this->items = $this->get_lists( $per_page, $current_page );
|
614 |
}
|
615 |
|
616 |
public function process_bulk_action() {
|
617 |
|
618 |
+
// Detect when a bulk action is being triggered...
|
619 |
if ( 'edit' === $this->current_action() ) {
|
620 |
|
621 |
// In our file that handles the request, verify the nonce.
|
629 |
$message = __( 'List has been updated successfully!', 'email-subscribers' );
|
630 |
ES_Common::show_message( $message, 'success' );
|
631 |
}
|
|
|
632 |
}
|
633 |
|
634 |
if ( 'delete' === $this->current_action() ) {
|
641 |
ES_Common::show_message( $message, 'error' );
|
642 |
} else {
|
643 |
$list = ig_es_get_request_data( 'list' );
|
644 |
+
if ( 1 != $list ) {
|
645 |
$list = ig_es_get_request_data( 'list' );
|
646 |
$this->db->delete_lists( array( $list ) );
|
647 |
$message = __( 'List has been deleted successfully!', 'email-subscribers' );
|
674 |
|
675 |
$statuses = array(
|
676 |
'enable' => __( 'Enable', 'email-subscribers' ),
|
677 |
+
'disable' => __( 'Disable', 'email-subscribers' ),
|
678 |
);
|
679 |
|
680 |
if ( ! in_array( $status, array_keys( $statuses ) ) ) {
|
686 |
|
687 |
/** Text displayed when no list data is available */
|
688 |
public function no_items() {
|
689 |
+
esc_html_e( 'No lists avaliable.', 'email-subscribers' );
|
690 |
}
|
691 |
|
692 |
}
|
lite/includes/classes/class-es-mailer.php
CHANGED
@@ -18,85 +18,82 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
18 |
*
|
19 |
* @since 4.3.2
|
20 |
* @var array
|
21 |
-
*
|
22 |
*/
|
23 |
-
|
24 |
|
25 |
/**
|
26 |
* Is limits set?
|
27 |
*
|
28 |
* @since 4.3.2
|
29 |
* @var bool
|
30 |
-
*
|
31 |
*/
|
32 |
-
|
33 |
|
34 |
/**
|
35 |
* Max execution time
|
36 |
*
|
37 |
* @since 4.3.2
|
38 |
* @var int
|
39 |
-
*
|
40 |
*/
|
41 |
-
|
42 |
|
43 |
/**
|
44 |
* Start time of email sending
|
45 |
*
|
46 |
* @since 4.3.2
|
47 |
* @var int
|
48 |
-
*
|
49 |
*/
|
50 |
-
|
51 |
|
52 |
/**
|
53 |
* Maximum email send count
|
54 |
*
|
55 |
* @since 4.3.2
|
56 |
* @var int
|
57 |
-
*
|
58 |
*/
|
59 |
-
|
60 |
|
61 |
/**
|
62 |
* Keep map of email => id data
|
63 |
*
|
64 |
* @since 4.3.2
|
65 |
* @var array
|
66 |
-
*
|
67 |
*/
|
68 |
-
|
69 |
|
70 |
/**
|
|
|
|
|
71 |
* @since 4.3.2
|
72 |
* @var bool
|
73 |
-
*
|
74 |
*/
|
75 |
-
|
76 |
|
77 |
/**
|
|
|
|
|
78 |
* @since 4.3.2
|
79 |
* @var bool
|
80 |
-
*
|
81 |
*/
|
82 |
-
|
83 |
|
84 |
/**
|
85 |
* Added Logger Context
|
86 |
*
|
87 |
* @since 4.3.2
|
88 |
* @var array
|
89 |
-
*
|
90 |
*/
|
91 |
public $logger_context = array(
|
92 |
-
'source' => 'ig_es_mailer'
|
93 |
);
|
94 |
|
95 |
/**
|
|
|
|
|
96 |
* @since 4.3.2
|
97 |
* @var object|ES_Base_Mailer
|
98 |
*/
|
99 |
-
|
100 |
|
101 |
/**
|
102 |
* ES_Mailer constructor.
|
@@ -137,7 +134,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
137 |
|
138 |
// Set 95% of max_execution_time as a max limit. We can reduce it as well
|
139 |
$max_time = (int) ( @ini_get( 'max_execution_time' ) * 0.95 );
|
140 |
-
if (
|
141 |
$max_time = (int) ( $cron_interval * 0.95 );
|
142 |
}
|
143 |
|
@@ -147,13 +144,21 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
147 |
|
148 |
// We are doing heavy lifting..allocate more memory
|
149 |
if ( function_exists( 'memory_get_usage' ) && ( (int) @ini_get( 'memory_limit' ) < 128 ) ) {
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
|
153 |
$this->limits_set = true;
|
154 |
}
|
155 |
|
156 |
if ( time() > $this->time_limit ) {
|
|
|
157 |
return true;
|
158 |
}
|
159 |
|
@@ -250,7 +255,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
250 |
* Send Double Optin Email
|
251 |
*
|
252 |
* @param $emails
|
253 |
-
* @param array
|
254 |
*
|
255 |
* @since 4.3.2
|
256 |
*/
|
@@ -263,7 +268,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
263 |
return false;
|
264 |
}
|
265 |
|
266 |
-
$content = str_replace(
|
267 |
|
268 |
$this->add_unsubscribe_link = false;
|
269 |
$this->add_tracking_pixel = false;
|
@@ -327,9 +332,11 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
327 |
|
328 |
$subject = str_replace( '{{SUBJECT}}', $notification['subject'], $subject );
|
329 |
|
330 |
-
$email_count
|
331 |
-
$post_subject
|
332 |
-
$cron_date
|
|
|
|
|
333 |
|
334 |
$content = str_replace( '{{DATE}}', $cron_date, $content );
|
335 |
$content = str_replace( '{{COUNT}}', $email_count, $content );
|
@@ -416,7 +423,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
416 |
$content = $this->get_welcome_email_content();
|
417 |
|
418 |
// Backward Compatibility...Earlier we used to use {{LINK}} for Unsubscribe link
|
419 |
-
$content = str_replace(
|
420 |
|
421 |
// Don't add Unsubscribe link. It should be there in content
|
422 |
$this->add_unsubscribe_link = false;
|
@@ -460,7 +467,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
460 |
// Enable Welcome Email?
|
461 |
$enable_welcome_email = get_option( 'ig_es_enable_welcome_email', 'no' );
|
462 |
|
463 |
-
if (
|
464 |
return true;
|
465 |
}
|
466 |
|
@@ -471,7 +478,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
471 |
* Send Test Email
|
472 |
*
|
473 |
* @param string $email
|
474 |
-
* @param array
|
475 |
*
|
476 |
* @return bool
|
477 |
*
|
@@ -510,6 +517,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
510 |
* @since 4.3.2
|
511 |
*/
|
512 |
public function get_test_email_subject( $email = '' ) {
|
|
|
513 |
return 'Email Subscribers: ' . sprintf( esc_html__( 'Test email to %s', 'email-subscribers' ), $email );
|
514 |
}
|
515 |
|
@@ -523,16 +531,16 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
523 |
public function get_test_email_content() {
|
524 |
ob_start();
|
525 |
?>
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
|
537 |
<?php
|
538 |
$content = ob_get_clean();
|
@@ -545,9 +553,9 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
545 |
*
|
546 |
* @param $subject
|
547 |
* @param $content
|
548 |
-
* @param array
|
549 |
-
* @param array
|
550 |
-
* @param bool
|
551 |
*
|
552 |
* @return mixed
|
553 |
*
|
@@ -563,17 +571,15 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
563 |
|
564 |
$sender_data = array();
|
565 |
$campaign_type = '';
|
566 |
-
if( ! empty( $campaign_id ) ) {
|
567 |
$campaign = ES()->campaigns_db->get( $campaign_id );
|
568 |
-
if( ! empty( $campaign ) ) {
|
569 |
$campaign_type = $campaign['type'];
|
570 |
-
if( 'newsletter' === $campaign_type ) {
|
571 |
-
$from_name
|
572 |
-
$from_email
|
573 |
-
$reply_to_email = ! empty( $campaign['reply_to_email'] ) ? $campaign['reply_to_email'] : '';
|
574 |
$sender_data['from_name'] = $from_name;
|
575 |
$sender_data['from_email'] = $from_email;
|
576 |
-
$sender_data['reply_to_email'] = $reply_to_email;
|
577 |
}
|
578 |
}
|
579 |
}
|
@@ -596,7 +602,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
596 |
* In case of sequence message campaign, fetch contact-email mapping from contacts table, since sending_queue table isn't used to store sequence campaign data.
|
597 |
* TODO: Please check need for using sending_queue table for other campaigns type. If it is not required, then we can remove it for other campaigns types as well.
|
598 |
*/
|
599 |
-
if( 'sequence_message' === $campaign_type ) {
|
600 |
$this->email_id_map = ES()->contacts_db->get_email_id_map( (array) $emails );
|
601 |
} else {
|
602 |
// If the campaign isn't a sequence message, then we can fetch contact-email mapping data from sending_queue table
|
@@ -623,14 +629,14 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
623 |
'campaign_id' => $campaign_id,
|
624 |
'contact_id' => $contact_id,
|
625 |
'email' => $email,
|
626 |
-
'guid' => ig_es_get_data( $merge_tags, 'hash', '' )
|
627 |
);
|
628 |
|
629 |
do_action( 'ig_es_before_message_send', $contact_id, $campaign_id, $message_id );
|
630 |
|
631 |
$message = $this->build_message( $subject, $content, $email, $merge_tags, $nl2br, $sender_data );
|
632 |
|
633 |
-
//object | WP_Error
|
634 |
$send_response = $this->mailer->send( $message );
|
635 |
|
636 |
// Error Sending Email?
|
@@ -640,7 +646,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
640 |
|
641 |
do_action( 'ig_es_email_sending_error', $contact_id, $campaign_id, $message_id, $response );
|
642 |
|
643 |
-
//TODO: Log somewhere
|
644 |
}
|
645 |
|
646 |
do_action( 'ig_es_message_sent', $contact_id, $campaign_id, $message_id );
|
@@ -663,13 +669,13 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
663 |
* @param $subject
|
664 |
* @param $body
|
665 |
* @param $email
|
666 |
-
* @param array
|
667 |
-
* @param array
|
668 |
*
|
669 |
* @return ES_Message
|
670 |
*
|
671 |
* @since 4.3.2
|
672 |
-
*
|
673 |
* @since 4.4.7 Added sender data.
|
674 |
*/
|
675 |
public function build_message( $subject, $body, $email, $merge_tags = array(), $nl2br = false, $sender_data = array() ) {
|
@@ -679,23 +685,22 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
679 |
$sender_name = '';
|
680 |
$sender_email = '';
|
681 |
// If sender data is passed .i.g. set in the campaign then use it.
|
682 |
-
if( ! empty( $sender_data ) ) {
|
683 |
$sender_name = ! empty( $sender_data['from_name'] ) ? $sender_data['from_name'] : '';
|
684 |
$sender_email = ! empty( $sender_data['from_email'] ) ? $sender_data['from_email'] : '';
|
685 |
-
$reply_to_email = ! empty( $sender_data['reply_to_email'] ) ? $sender_data['reply_to_email'] : '';
|
686 |
}
|
687 |
|
688 |
// If sender name is not passed then fetch it from ES settings.
|
689 |
-
if( empty( $sender_name ) ) {
|
690 |
-
$sender_name
|
691 |
}
|
692 |
|
693 |
// If sender email is not passed then fetch it from ES settings.
|
694 |
-
if( empty( $sender_email ) ) {
|
695 |
$sender_email = $this->get_from_email();
|
696 |
}
|
697 |
|
698 |
-
if( empty( $reply_to_email ) ) {
|
699 |
$reply_to_email = $this->get_from_email();
|
700 |
}
|
701 |
|
@@ -709,14 +714,14 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
709 |
|
710 |
$headers = array(
|
711 |
"From: \"$sender_name\" <$sender_email>",
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
);
|
716 |
|
717 |
$message->headers = $headers;
|
718 |
|
719 |
-
|
720 |
$hash = ig_es_get_data( $merge_tags, 'hash', '' );
|
721 |
$campaign_id = ig_es_get_data( $merge_tags, 'campaign_id', 0 );
|
722 |
$contact_id = ig_es_get_data( $merge_tags, 'contact_id', 0 );
|
@@ -727,7 +732,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
727 |
'campaign_id' => $campaign_id,
|
728 |
'contact_id' => $contact_id,
|
729 |
'email' => $email,
|
730 |
-
'guid' => $hash
|
731 |
);
|
732 |
|
733 |
$message->body = preg_replace( '/data-json=".*?"/is', '', $message->body );
|
@@ -742,7 +747,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
742 |
$unsubscribe_message = $this->get_unsubscribe_text();
|
743 |
|
744 |
// Can Track Email Open? Add pixel.
|
745 |
-
$email_tracking_image
|
746 |
|
747 |
$message->body = $message->body . $unsubscribe_message . $email_tracking_image;
|
748 |
|
@@ -758,7 +763,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
758 |
* TODO: Enable after Fixing preheader issue.
|
759 |
$campaign_id = ! empty( $merge_tags['campaign_id'] ) ? $merge_tags['campaign_id'] : 0;
|
760 |
$message->body = $this->set_pre_header_text( $message->body, $campaign_id );
|
761 |
-
|
762 |
|
763 |
return $message;
|
764 |
}
|
@@ -767,7 +772,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
767 |
* Set Pre header text
|
768 |
*
|
769 |
* @param $content
|
770 |
-
* @param int
|
771 |
*
|
772 |
* @return string
|
773 |
*
|
@@ -818,7 +823,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
818 |
$content = ES_Common::handle_oembed_content( $content );
|
819 |
|
820 |
// Replaces double line-breaks with paragraph elements.
|
821 |
-
|
822 |
|
823 |
// Have shortcode? Execute it.
|
824 |
$content = do_shortcode( shortcode_unautop( $content ) );
|
@@ -871,7 +876,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
871 |
* Replace Merge Tags
|
872 |
*
|
873 |
* @param string $content
|
874 |
-
* @param array
|
875 |
*
|
876 |
* @return mixed|string
|
877 |
*
|
@@ -898,41 +903,43 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
898 |
'campaign_id' => $campaign_id,
|
899 |
'contact_id' => $contact_id,
|
900 |
'email' => $email,
|
901 |
-
'guid' => $hash
|
902 |
);
|
903 |
|
904 |
$this->link_data = $link_data;
|
905 |
|
906 |
$subscribe_link = $this->get_subscribe_link( $link_data );
|
907 |
$unsubscribe_link = $this->get_unsubscribe_link( $link_data );
|
908 |
-
|
909 |
-
$content = str_replace(
|
910 |
-
$content = str_replace(
|
911 |
-
$content = str_replace(
|
912 |
-
$content = str_replace(
|
913 |
|
914 |
// TODO: This is a quick workaround to handle <a href="{{LINK}}?utm_source=abc" >
|
915 |
// TODO: Implement some good solution
|
916 |
|
917 |
-
$content = str_replace(
|
918 |
-
$content = str_replace(
|
919 |
|
920 |
-
$content = str_replace(
|
921 |
-
$content = str_replace(
|
922 |
|
923 |
-
$content = str_replace(
|
924 |
-
$content = str_replace(
|
925 |
|
926 |
-
$content = str_replace(
|
927 |
-
$content = str_replace(
|
928 |
-
$content = str_replace(
|
929 |
-
$content = str_replace(
|
930 |
-
$content = str_replace(
|
931 |
|
932 |
return $content;
|
933 |
}
|
934 |
|
935 |
/**
|
|
|
|
|
936 |
* @param $html
|
937 |
* @param bool $links_only
|
938 |
*
|
@@ -953,7 +960,13 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
953 |
|
954 |
} else {
|
955 |
require_once ES_PLUGIN_DIR . 'lite/includes/libraries/class-es-html2text.php';
|
956 |
-
$htmlconverter = new ES_Html2Text(
|
|
|
|
|
|
|
|
|
|
|
|
|
957 |
|
958 |
$text = trim( $htmlconverter->get_text() );
|
959 |
$text = preg_replace( '/\s*$^\s*/mu', "\n\n", $text );
|
@@ -1000,7 +1013,6 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
1000 |
$message_id = ! empty( $link_data['message_id'] ) ? $link_data['message_id'] : 0;
|
1001 |
$contact_id = ! empty( $link_data['contact_id'] ) ? $link_data['contact_id'] : 0;
|
1002 |
|
1003 |
-
|
1004 |
foreach ( $links as $link ) {
|
1005 |
|
1006 |
if ( ! isset( $inserted_links[ $link ] ) ) {
|
@@ -1024,24 +1036,24 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
1024 |
'message_id' => $message_id,
|
1025 |
'campaign_id' => $campaign_id,
|
1026 |
'hash' => $hash,
|
1027 |
-
'i' => $index
|
1028 |
);
|
1029 |
|
1030 |
ES()->links_db->insert( $link_data );
|
1031 |
}
|
1032 |
|
1033 |
$data = array(
|
1034 |
-
'action'
|
1035 |
-
'link_hash'
|
1036 |
-
'contact_id' => $contact_id
|
1037 |
);
|
1038 |
|
1039 |
$new_link = $this->prepare_link( $data );
|
1040 |
|
1041 |
$link = ' href="' . $link . '"';
|
1042 |
$new_link = ' href="' . $new_link . '"';
|
1043 |
-
|
1044 |
-
if (
|
1045 |
$content = preg_replace( '/' . preg_quote( $link, '/' ) . '/', $new_link, $content, 1 );
|
1046 |
}
|
1047 |
}
|
@@ -1212,8 +1224,8 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
1212 |
$text = get_option( 'ig_es_unsubscribe_link_content', '' );
|
1213 |
|
1214 |
$text = stripslashes( $text );
|
1215 |
-
$text = str_replace(
|
1216 |
-
$text = str_replace(
|
1217 |
}
|
1218 |
|
1219 |
return $text;
|
@@ -1259,7 +1271,7 @@ if ( ! class_exists( 'ES_Mailer' ) ) {
|
|
1259 |
$current_date = ig_es_get_current_date();
|
1260 |
$current_hour = ig_es_get_current_hour();
|
1261 |
|
1262 |
-
//Get total emails sent in this hour
|
1263 |
$email_sent_data = ES_Common::get_ig_option( 'email_sent_data', array() );
|
1264 |
|
1265 |
$total_emails_sent = 0;
|
18 |
*
|
19 |
* @since 4.3.2
|
20 |
* @var array
|
|
|
21 |
*/
|
22 |
+
public $link_data = array();
|
23 |
|
24 |
/**
|
25 |
* Is limits set?
|
26 |
*
|
27 |
* @since 4.3.2
|
28 |
* @var bool
|
|
|
29 |
*/
|
30 |
+
public $limits_set = false;
|
31 |
|
32 |
/**
|
33 |
* Max execution time
|
34 |
*
|
35 |
* @since 4.3.2
|
36 |
* @var int
|
|
|
37 |
*/
|
38 |
+
public $time_limit = 0;
|
39 |
|
40 |
/**
|
41 |
* Start time of email sending
|
42 |
*
|
43 |
* @since 4.3.2
|
44 |
* @var int
|
|
|
45 |
*/
|
46 |
+
public $time_start = 0;
|
47 |
|
48 |
/**
|
49 |
* Maximum email send count
|
50 |
*
|
51 |
* @since 4.3.2
|
52 |
* @var int
|
|
|
53 |
*/
|
54 |
+
public $email_limit = 0;
|
55 |
|
56 |
/**
|
57 |
* Keep map of email => id data
|
58 |
*
|
59 |
* @since 4.3.2
|
60 |
* @var array
|
|
|
61 |
*/
|
62 |
+
public $email_id_map = array();
|
63 |
|
64 |
/**
|
65 |
+
* Need to add unsubscribe link ?
|
66 |
+
*
|
67 |
* @since 4.3.2
|
68 |
* @var bool
|
|
|
69 |
*/
|
70 |
+
public $add_unsubscribe_link = true;
|
71 |
|
72 |
/**
|
73 |
+
* Need to add tracking pixel ?
|
74 |
+
*
|
75 |
* @since 4.3.2
|
76 |
* @var bool
|
|
|
77 |
*/
|
78 |
+
public $add_tracking_pixel = true;
|
79 |
|
80 |
/**
|
81 |
* Added Logger Context
|
82 |
*
|
83 |
* @since 4.3.2
|
84 |
* @var array
|
|
|
85 |
*/
|
86 |
public $logger_context = array(
|
87 |
+
'source' => 'ig_es_mailer',
|
88 |
);
|
89 |
|
90 |
/**
|
91 |
+
* Mailer setting
|
92 |
+
*
|
93 |
* @since 4.3.2
|
94 |
* @var object|ES_Base_Mailer
|
95 |
*/
|
96 |
+
public $mailer;
|
97 |
|
98 |
/**
|
99 |
* ES_Mailer constructor.
|
134 |
|
135 |
// Set 95% of max_execution_time as a max limit. We can reduce it as well
|
136 |
$max_time = (int) ( @ini_get( 'max_execution_time' ) * 0.95 );
|
137 |
+
if ( 0 == $max_time || $max_time > $cron_interval ) {
|
138 |
$max_time = (int) ( $cron_interval * 0.95 );
|
139 |
}
|
140 |
|
144 |
|
145 |
// We are doing heavy lifting..allocate more memory
|
146 |
if ( function_exists( 'memory_get_usage' ) && ( (int) @ini_get( 'memory_limit' ) < 128 ) ) {
|
147 |
+
|
148 |
+
// Add filter to increase memory limit
|
149 |
+
add_filter( 'ig_es_memory_limit', 'ig_es_increase_memory_limit' );
|
150 |
+
|
151 |
+
wp_raise_memory_limit( 'ig_es' );
|
152 |
+
|
153 |
+
// Remove the added filter function so that it won't be called again if wp_raise_memory_limit called later on.
|
154 |
+
remove_filter( 'ig_es_memory_limit', 'ig_es_increase_memory_limit' );
|
155 |
}
|
156 |
|
157 |
$this->limits_set = true;
|
158 |
}
|
159 |
|
160 |
if ( time() > $this->time_limit ) {
|
161 |
+
|
162 |
return true;
|
163 |
}
|
164 |
|
255 |
* Send Double Optin Email
|
256 |
*
|
257 |
* @param $emails
|
258 |
+
* @param array $merge_tags
|
259 |
*
|
260 |
* @since 4.3.2
|
261 |
*/
|
268 |
return false;
|
269 |
}
|
270 |
|
271 |
+
$content = str_replace( '{{LINK}}', '{{SUBSCRIBE-LINK}}', $content );
|
272 |
|
273 |
$this->add_unsubscribe_link = false;
|
274 |
$this->add_tracking_pixel = false;
|
332 |
|
333 |
$subject = str_replace( '{{SUBJECT}}', $notification['subject'], $subject );
|
334 |
|
335 |
+
$email_count = $notification['count'];
|
336 |
+
$post_subject = $notification['subject'];
|
337 |
+
$cron_date = gmdate( 'Y-m-d H:i:s' );
|
338 |
+
$cron_local_date = get_date_from_gmt( $cron_date ); // Convert from GMT to local date/time based on WordPress time zone setting.
|
339 |
+
$cron_date = ES_Common::convert_date_to_wp_date( $cron_local_date ); // Get formatted date from WordPress date/time settings.
|
340 |
|
341 |
$content = str_replace( '{{DATE}}', $cron_date, $content );
|
342 |
$content = str_replace( '{{COUNT}}', $email_count, $content );
|
423 |
$content = $this->get_welcome_email_content();
|
424 |
|
425 |
// Backward Compatibility...Earlier we used to use {{LINK}} for Unsubscribe link
|
426 |
+
$content = str_replace( '{{LINK}}', '{{UNSUBSCRIBE-LINK}}', $content );
|
427 |
|
428 |
// Don't add Unsubscribe link. It should be there in content
|
429 |
$this->add_unsubscribe_link = false;
|
467 |
// Enable Welcome Email?
|
468 |
$enable_welcome_email = get_option( 'ig_es_enable_welcome_email', 'no' );
|
469 |
|
470 |
+
if ( 'yes' === $enable_welcome_email ) {
|
471 |
return true;
|
472 |
}
|
473 |
|
478 |
* Send Test Email
|
479 |
*
|
480 |
* @param string $email
|
481 |
+
* @param array $merge_tags
|
482 |
*
|
483 |
* @return bool
|
484 |
*
|
517 |
* @since 4.3.2
|
518 |
*/
|
519 |
public function get_test_email_subject( $email = '' ) {
|
520 |
+
/* translators: %s: Email address */
|
521 |
return 'Email Subscribers: ' . sprintf( esc_html__( 'Test email to %s', 'email-subscribers' ), $email );
|
522 |
}
|
523 |
|
531 |
public function get_test_email_content() {
|
532 |
ob_start();
|
533 |
?>
|
534 |
+
<html>
|
535 |
+
<head></head>
|
536 |
+
<body>
|
537 |
+
<p>Congrats, test email was sent successfully!</p>
|
538 |
+
<p>Thank you for trying out Email Subscribers. We are on a mission to make the best Email Marketing Automation plugin for WordPress.</p>
|
539 |
+
<p>If you find this plugin useful, please consider giving us <a href="https://wordpress.org/support/plugin/email-subscribers/reviews/?filter=5">5 stars review</a> on WordPress!</p>
|
540 |
+
<p>Nirav Mehta</p>
|
541 |
+
<p>Founder, <a href="https://www.icegram.com/">Icegram</a></p>
|
542 |
+
</body>
|
543 |
+
</html>
|
544 |
|
545 |
<?php
|
546 |
$content = ob_get_clean();
|
553 |
*
|
554 |
* @param $subject
|
555 |
* @param $content
|
556 |
+
* @param array $emails
|
557 |
+
* @param array $merge_tags
|
558 |
+
* @param bool $nl2br
|
559 |
*
|
560 |
* @return mixed
|
561 |
*
|
571 |
|
572 |
$sender_data = array();
|
573 |
$campaign_type = '';
|
574 |
+
if ( ! empty( $campaign_id ) ) {
|
575 |
$campaign = ES()->campaigns_db->get( $campaign_id );
|
576 |
+
if ( ! empty( $campaign ) ) {
|
577 |
$campaign_type = $campaign['type'];
|
578 |
+
if ( 'newsletter' === $campaign_type ) {
|
579 |
+
$from_name = ! empty( $campaign['from_name'] ) ? $campaign['from_name'] : '';
|
580 |
+
$from_email = ! empty( $campaign['from_email'] ) ? $campaign['from_email'] : '';
|
|
|
581 |
$sender_data['from_name'] = $from_name;
|
582 |
$sender_data['from_email'] = $from_email;
|
|
|
583 |
}
|
584 |
}
|
585 |
}
|
602 |
* In case of sequence message campaign, fetch contact-email mapping from contacts table, since sending_queue table isn't used to store sequence campaign data.
|
603 |
* TODO: Please check need for using sending_queue table for other campaigns type. If it is not required, then we can remove it for other campaigns types as well.
|
604 |
*/
|
605 |
+
if ( 'sequence_message' === $campaign_type ) {
|
606 |
$this->email_id_map = ES()->contacts_db->get_email_id_map( (array) $emails );
|
607 |
} else {
|
608 |
// If the campaign isn't a sequence message, then we can fetch contact-email mapping data from sending_queue table
|
629 |
'campaign_id' => $campaign_id,
|
630 |
'contact_id' => $contact_id,
|
631 |
'email' => $email,
|
632 |
+
'guid' => ig_es_get_data( $merge_tags, 'hash', '' ),
|
633 |
);
|
634 |
|
635 |
do_action( 'ig_es_before_message_send', $contact_id, $campaign_id, $message_id );
|
636 |
|
637 |
$message = $this->build_message( $subject, $content, $email, $merge_tags, $nl2br, $sender_data );
|
638 |
|
639 |
+
// object | WP_Error
|
640 |
$send_response = $this->mailer->send( $message );
|
641 |
|
642 |
// Error Sending Email?
|
646 |
|
647 |
do_action( 'ig_es_email_sending_error', $contact_id, $campaign_id, $message_id, $response );
|
648 |
|
649 |
+
// TODO: Log somewhere
|
650 |
}
|
651 |
|
652 |
do_action( 'ig_es_message_sent', $contact_id, $campaign_id, $message_id );
|
669 |
* @param $subject
|
670 |
* @param $body
|
671 |
* @param $email
|
672 |
+
* @param array $merge_tags
|
673 |
+
* @param array $sender_data
|
674 |
*
|
675 |
* @return ES_Message
|
676 |
*
|
677 |
* @since 4.3.2
|
678 |
+
*
|
679 |
* @since 4.4.7 Added sender data.
|
680 |
*/
|
681 |
public function build_message( $subject, $body, $email, $merge_tags = array(), $nl2br = false, $sender_data = array() ) {
|
685 |
$sender_name = '';
|
686 |
$sender_email = '';
|
687 |
// If sender data is passed .i.g. set in the campaign then use it.
|
688 |
+
if ( ! empty( $sender_data ) ) {
|
689 |
$sender_name = ! empty( $sender_data['from_name'] ) ? $sender_data['from_name'] : '';
|
690 |
$sender_email = ! empty( $sender_data['from_email'] ) ? $sender_data['from_email'] : '';
|
|
|
691 |
}
|
692 |
|
693 |
// If sender name is not passed then fetch it from ES settings.
|
694 |
+
if ( empty( $sender_name ) ) {
|
695 |
+
$sender_name = $this->get_from_name();
|
696 |
}
|
697 |
|
698 |
// If sender email is not passed then fetch it from ES settings.
|
699 |
+
if ( empty( $sender_email ) ) {
|
700 |
$sender_email = $this->get_from_email();
|
701 |
}
|
702 |
|
703 |
+
if ( empty( $reply_to_email ) ) {
|
704 |
$reply_to_email = $this->get_from_email();
|
705 |
}
|
706 |
|
714 |
|
715 |
$headers = array(
|
716 |
"From: \"$sender_name\" <$sender_email>",
|
717 |
+
'Return-Path: <' . $sender_email . '>',
|
718 |
+
'Reply-To: <' . $reply_to_email . '>',
|
719 |
+
'Content-Type: text/html; charset="' . get_bloginfo( 'charset' ) . '"'
|
720 |
);
|
721 |
|
722 |
$message->headers = $headers;
|
723 |
|
724 |
+
// $email = ig_es_get_data( $merge_tags, 'email', '' );
|
725 |
$hash = ig_es_get_data( $merge_tags, 'hash', '' );
|
726 |
$campaign_id = ig_es_get_data( $merge_tags, 'campaign_id', 0 );
|
727 |
$contact_id = ig_es_get_data( $merge_tags, 'contact_id', 0 );
|
732 |
'campaign_id' => $campaign_id,
|
733 |
'contact_id' => $contact_id,
|
734 |
'email' => $email,
|
735 |
+
'guid' => $hash,
|
736 |
);
|
737 |
|
738 |
$message->body = preg_replace( '/data-json=".*?"/is', '', $message->body );
|
747 |
$unsubscribe_message = $this->get_unsubscribe_text();
|
748 |
|
749 |
// Can Track Email Open? Add pixel.
|
750 |
+
$email_tracking_image = $this->get_tracking_pixel();
|
751 |
|
752 |
$message->body = $message->body . $unsubscribe_message . $email_tracking_image;
|
753 |
|
763 |
* TODO: Enable after Fixing preheader issue.
|
764 |
$campaign_id = ! empty( $merge_tags['campaign_id'] ) ? $merge_tags['campaign_id'] : 0;
|
765 |
$message->body = $this->set_pre_header_text( $message->body, $campaign_id );
|
766 |
+
*/
|
767 |
|
768 |
return $message;
|
769 |
}
|
772 |
* Set Pre header text
|
773 |
*
|
774 |
* @param $content
|
775 |
+
* @param int $campaign_id
|
776 |
*
|
777 |
* @return string
|
778 |
*
|
823 |
$content = ES_Common::handle_oembed_content( $content );
|
824 |
|
825 |
// Replaces double line-breaks with paragraph elements.
|
826 |
+
// $content = wpautop( $content );
|
827 |
|
828 |
// Have shortcode? Execute it.
|
829 |
$content = do_shortcode( shortcode_unautop( $content ) );
|
876 |
* Replace Merge Tags
|
877 |
*
|
878 |
* @param string $content
|
879 |
+
* @param array $merge_tags
|
880 |
*
|
881 |
* @return mixed|string
|
882 |
*
|
903 |
'campaign_id' => $campaign_id,
|
904 |
'contact_id' => $contact_id,
|
905 |
'email' => $email,
|
906 |
+
'guid' => $hash,
|
907 |
);
|
908 |
|
909 |
$this->link_data = $link_data;
|
910 |
|
911 |
$subscribe_link = $this->get_subscribe_link( $link_data );
|
912 |
$unsubscribe_link = $this->get_unsubscribe_link( $link_data );
|
913 |
+
|
914 |
+
$content = str_replace( '{{NAME}}', $name, $content );
|
915 |
+
$content = str_replace( '{{FIRSTNAME}}', $first_name, $content );
|
916 |
+
$content = str_replace( '{{LASTNAME}}', $last_name, $content );
|
917 |
+
$content = str_replace( '{{EMAIL}}', $email, $content );
|
918 |
|
919 |
// TODO: This is a quick workaround to handle <a href="{{LINK}}?utm_source=abc" >
|
920 |
// TODO: Implement some good solution
|
921 |
|
922 |
+
$content = str_replace( '{{LINK}}?', '{{LINK}}&', $content );
|
923 |
+
$content = str_replace( '{{LINK}}', $subscribe_link, $content );
|
924 |
|
925 |
+
$content = str_replace( '{{SUBSCRIBE-LINK}}?', '{{SUBSCRIBE-LINK}}&', $content );
|
926 |
+
$content = str_replace( '{{SUBSCRIBE-LINK}}', $subscribe_link, $content );
|
927 |
|
928 |
+
$content = str_replace( '{{UNSUBSCRIBE-LINK}}?', '{{UNSUBSCRIBE-LINK}}&', $content );
|
929 |
+
$content = str_replace( '{{UNSUBSCRIBE-LINK}}', $unsubscribe_link, $content );
|
930 |
|
931 |
+
$content = str_replace( '{{TOTAL-CONTACTS}}', $total_contacts, $content );
|
932 |
+
$content = str_replace( '{{GROUP}}', $list_name, $content );
|
933 |
+
$content = str_replace( '{{LIST}}', $list_name, $content );
|
934 |
+
$content = str_replace( '{{SITENAME}}', $blog_name, $content );
|
935 |
+
$content = str_replace( '{{SITEURL}}', $site_url, $content );
|
936 |
|
937 |
return $content;
|
938 |
}
|
939 |
|
940 |
/**
|
941 |
+
* Convert Html to text
|
942 |
+
*
|
943 |
* @param $html
|
944 |
* @param bool $links_only
|
945 |
*
|
960 |
|
961 |
} else {
|
962 |
require_once ES_PLUGIN_DIR . 'lite/includes/libraries/class-es-html2text.php';
|
963 |
+
$htmlconverter = new ES_Html2Text(
|
964 |
+
$html,
|
965 |
+
array(
|
966 |
+
'width' => 200,
|
967 |
+
'do_links' => 'table',
|
968 |
+
)
|
969 |
+
);
|
970 |
|
971 |
$text = trim( $htmlconverter->get_text() );
|
972 |
$text = preg_replace( '/\s*$^\s*/mu', "\n\n", $text );
|
1013 |
$message_id = ! empty( $link_data['message_id'] ) ? $link_data['message_id'] : 0;
|
1014 |
$contact_id = ! empty( $link_data['contact_id'] ) ? $link_data['contact_id'] : 0;
|
1015 |
|
|
|
1016 |
foreach ( $links as $link ) {
|
1017 |
|
1018 |
if ( ! isset( $inserted_links[ $link ] ) ) {
|
1036 |
'message_id' => $message_id,
|
1037 |
'campaign_id' => $campaign_id,
|
1038 |
'hash' => $hash,
|
1039 |
+
'i' => $index,
|
1040 |
);
|
1041 |
|
1042 |
ES()->links_db->insert( $link_data );
|
1043 |
}
|
1044 |
|
1045 |
$data = array(
|
1046 |
+
'action' => 'click',
|
1047 |
+
'link_hash' => $hash,
|
1048 |
+
'contact_id' => $contact_id,
|
1049 |
);
|
1050 |
|
1051 |
$new_link = $this->prepare_link( $data );
|
1052 |
|
1053 |
$link = ' href="' . $link . '"';
|
1054 |
$new_link = ' href="' . $new_link . '"';
|
1055 |
+
$pos = strpos( $content, $link );
|
1056 |
+
if ( false != $pos ) {
|
1057 |
$content = preg_replace( '/' . preg_quote( $link, '/' ) . '/', $new_link, $content, 1 );
|
1058 |
}
|
1059 |
}
|
1224 |
$text = get_option( 'ig_es_unsubscribe_link_content', '' );
|
1225 |
|
1226 |
$text = stripslashes( $text );
|
1227 |
+
$text = str_replace( '{{LINK}}', '{{UNSUBSCRIBE-LINK}}', $text );
|
1228 |
+
$text = str_replace( '{{UNSUBSCRIBE-LINK}}', $unsubscribe_link, $text );
|
1229 |
}
|
1230 |
|
1231 |
return $text;
|
1271 |
$current_date = ig_es_get_current_date();
|
1272 |
$current_hour = ig_es_get_current_hour();
|
1273 |
|
1274 |
+
// Get total emails sent in this hour
|
1275 |
$email_sent_data = ES_Common::get_ig_option( 'email_sent_data', array() );
|
1276 |
|
1277 |
$total_emails_sent = 0;
|
lite/includes/classes/class-es-message.php
CHANGED
@@ -12,67 +12,85 @@ if ( ! class_exists( 'ES_Message' ) ) {
|
|
12 |
*/
|
13 |
class ES_Message {
|
14 |
/**
|
|
|
|
|
15 |
* @var string
|
16 |
*
|
17 |
* @since 4.3.2
|
18 |
*/
|
19 |
-
|
20 |
|
21 |
/**
|
|
|
|
|
22 |
* @var string
|
23 |
*
|
24 |
* @since 4.3.2
|
25 |
*/
|
26 |
-
|
27 |
|
28 |
/**
|
|
|
|
|
29 |
* @var array
|
30 |
*
|
31 |
* @since 4.3.2
|
32 |
*/
|
33 |
-
|
34 |
|
35 |
/**
|
|
|
|
|
36 |
* @var string
|
37 |
*
|
38 |
* @since 4.3.2
|
39 |
*/
|
40 |
-
|
41 |
|
42 |
/**
|
|
|
|
|
43 |
* @var string
|
44 |
*
|
45 |
* @since 4.3.2
|
46 |
*/
|
47 |
-
|
48 |
|
49 |
/**
|
|
|
|
|
50 |
* @var string
|
51 |
*
|
52 |
* @since 4.3.2
|
53 |
*/
|
54 |
-
|
55 |
|
56 |
/**
|
|
|
|
|
57 |
* @var string
|
58 |
*
|
59 |
* @since 4.3.2
|
60 |
*/
|
61 |
-
|
62 |
|
63 |
/**
|
|
|
|
|
64 |
* @var
|
65 |
*
|
66 |
* @sinc 4.3.2
|
67 |
*/
|
68 |
-
|
69 |
|
70 |
/**
|
|
|
|
|
71 |
* @var string
|
72 |
*
|
73 |
* @since 4.3.2
|
74 |
*/
|
75 |
-
|
76 |
|
77 |
|
78 |
public function __construct() {
|
12 |
*/
|
13 |
class ES_Message {
|
14 |
/**
|
15 |
+
* To email
|
16 |
+
*
|
17 |
* @var string
|
18 |
*
|
19 |
* @since 4.3.2
|
20 |
*/
|
21 |
+
public $to = '';
|
22 |
|
23 |
/**
|
24 |
+
* To name
|
25 |
+
*
|
26 |
* @var string
|
27 |
*
|
28 |
* @since 4.3.2
|
29 |
*/
|
30 |
+
public $to_name = '';
|
31 |
|
32 |
/**
|
33 |
+
* Message headers
|
34 |
+
*
|
35 |
* @var array
|
36 |
*
|
37 |
* @since 4.3.2
|
38 |
*/
|
39 |
+
public $headers = array();
|
40 |
|
41 |
/**
|
42 |
+
* Message errors
|
43 |
+
*
|
44 |
* @var string
|
45 |
*
|
46 |
* @since 4.3.2
|
47 |
*/
|
48 |
+
public $error = '';
|
49 |
|
50 |
/**
|
51 |
+
* Message subject
|
52 |
+
*
|
53 |
* @var string
|
54 |
*
|
55 |
* @since 4.3.2
|
56 |
*/
|
57 |
+
public $subject = '';
|
58 |
|
59 |
/**
|
60 |
+
* Message body
|
61 |
+
*
|
62 |
* @var string
|
63 |
*
|
64 |
* @since 4.3.2
|
65 |
*/
|
66 |
+
public $body = '';
|
67 |
|
68 |
/**
|
69 |
+
* Message text
|
70 |
+
*
|
71 |
* @var string
|
72 |
*
|
73 |
* @since 4.3.2
|
74 |
*/
|
75 |
+
public $body_text = '';
|
76 |
|
77 |
/**
|
78 |
+
* Message From
|
79 |
+
*
|
80 |
* @var
|
81 |
*
|
82 |
* @sinc 4.3.2
|
83 |
*/
|
84 |
+
public $from;
|
85 |
|
86 |
/**
|
87 |
+
* Message from name
|
88 |
+
*
|
89 |
* @var string
|
90 |
*
|
91 |
* @since 4.3.2
|
92 |
*/
|
93 |
+
public $from_name = '';
|
94 |
|
95 |
|
96 |
public function __construct() {
|
lite/includes/classes/class-es-newsletters.php
CHANGED
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
17 |
class ES_Newsletters {
|
18 |
|
19 |
// class instance
|
20 |
-
static $instance;
|
21 |
|
22 |
// class constructor
|
23 |
public function __construct() {
|
@@ -38,7 +38,7 @@ class ES_Newsletters {
|
|
38 |
add_filter( 'ig_es_broadcast_data', array( $this, 'add_tracking_fields_data' ) );
|
39 |
|
40 |
if ( ! ES()->is_pro() ) {
|
41 |
-
//Add scheduler data
|
42 |
add_filter( 'ig_es_broadcast_data', array( &$this, 'es_add_broadcast_scheduler_data' ), 10, 2 );
|
43 |
}
|
44 |
|
@@ -89,7 +89,6 @@ class ES_Newsletters {
|
|
89 |
wp_safe_redirect( $campaign_url );
|
90 |
exit();
|
91 |
}
|
92 |
-
|
93 |
}
|
94 |
}
|
95 |
|
@@ -140,10 +139,11 @@ class ES_Newsletters {
|
|
140 |
|
141 |
if ( ! empty( $broadcast_id ) ) {
|
142 |
|
143 |
-
$broadcast_query
|
144 |
-
$broadcasts
|
145 |
-
|
146 |
-
$
|
|
|
147 |
'id' => $broadcast['id'],
|
148 |
'name' => $broadcast['name'],
|
149 |
'subject' => $broadcast['subject'],
|
@@ -155,6 +155,7 @@ class ES_Newsletters {
|
|
155 |
'template_id' => $broadcast['base_template_id'],
|
156 |
'status' => $broadcast['status'],
|
157 |
'meta' => maybe_unserialize( $broadcast['meta'] ),
|
|
|
158 |
);
|
159 |
}
|
160 |
|
@@ -193,7 +194,7 @@ class ES_Newsletters {
|
|
193 |
$broadcast_allowed_edit_statuses = array(
|
194 |
IG_ES_CAMPAIGN_STATUS_ACTIVE,
|
195 |
IG_ES_CAMPAIGN_STATUS_IN_ACTIVE,
|
196 |
-
IG_ES_CAMPAIGN_STATUS_SCHEDULED
|
197 |
);
|
198 |
|
199 |
if ( ! in_array( $broadcast_status, $broadcast_allowed_edit_statuses ) ) {
|
@@ -215,12 +216,13 @@ class ES_Newsletters {
|
|
215 |
}
|
216 |
}
|
217 |
|
218 |
-
$select_list_attr
|
219 |
-
$select_list_name
|
220 |
-
$select_list_class
|
|
|
221 |
?>
|
222 |
|
223 |
-
|
224 |
<?php
|
225 |
if ( ! empty( $message_data ) ) {
|
226 |
$message = $message_data['message'];
|
@@ -228,215 +230,222 @@ class ES_Newsletters {
|
|
228 |
ES_Common::show_message( $message, $type );
|
229 |
}
|
230 |
?>
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
|
|
|
|
|
|
276 |
<span>
|
277 |
<div class="relative inline-block text-left">
|
278 |
<span>
|
279 |
<button type="button"
|
280 |
-
|
281 |
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" viewBox="0 0 20 20" class="w-3 h-3 my-1 mr-1"><path d="M15 19l-7-7 7-7"></path></svg><?php echo esc_html__( 'Previous', 'email-subscribers' ); ?>
|
282 |
</button>
|
283 |
</span>
|
284 |
</div>
|
285 |
</span>
|
286 |
-
|
287 |
|
288 |
-
|
289 |
<button type="button" class="inline-flex items-center w-full py-2 text-sm font-medium leading-5 text-gray-700 transition duration-150 ease-in-out bg-white border border-gray-300 rounded-md ig_es_draft_broadcast md:px-2 lg:px-3 xl:px-4 hover:bg-gray-50 focus:outline-none focus:shadow-outline focus:border-blue-300">
|
290 |
<?php echo esc_html__( 'Save Draft', 'email-subscribers' ); ?>
|
291 |
</button>
|
292 |
</span>
|
293 |
|
294 |
-
|
295 |
<div class="relative inline-block text-left">
|
296 |
<span>
|
297 |
<?php
|
298 |
// If broadcast is sent or being sent then don't allow scheduling to conflicts.
|
299 |
if ( ! $is_broadcast_processing ) {
|
300 |
-
|
301 |
<button type="submit" id="ig_es_broadcast_submitted" name="ig_es_broadcast_submitted" class="inline-flex justify-center py-2 text-sm font-medium leading-5 text-white transition duration-150 ease-in-out bg-indigo-600 border border-transparent rounded-md md:px-2 lg:px-3 xl:px-4 hover:bg-indigo-500 hover:text-white"
|
302 |
-
|
303 |
-
<?php
|
|
|
304 |
echo esc_html__( 'Schedule', 'email-subscribers' );
|
305 |
} else {
|
306 |
echo esc_html__( 'Send', 'email-subscribers' );
|
307 |
}
|
308 |
-
|
309 |
-
|
310 |
</button>
|
311 |
|
312 |
</span>
|
313 |
</div>
|
314 |
</span>
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
<label for="message" class="text-sm font-medium leading-5 text-gray-700"><?php echo esc_html__( 'Message', 'email-subscribers' ); ?></label>
|
346 |
<?php
|
347 |
$body = ! empty( $broadcast_data['body'] ) ? $broadcast_data['body'] : '';
|
348 |
$editor_args = array(
|
349 |
'textarea_name' => 'broadcast_data[body]',
|
350 |
'textarea_rows' => 40,
|
351 |
'media_buttons' => true,
|
352 |
-
'tinymce'
|
353 |
-
'quicktags'
|
354 |
-
'editor_class'
|
355 |
);
|
356 |
wp_editor( $body, 'edit-es-boradcast-body', $editor_args );
|
357 |
?>
|
358 |
-
|
359 |
<?php do_action( 'ig_es_after_broadcast_left_pan_settings', $broadcast_data ); ?>
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
<?php
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
|
|
|
|
|
|
|
|
402 |
|
403 |
<?php do_action( 'ig_es_after_broadcast_content_left_pan_settings', $broadcast_data ); ?>
|
404 |
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
<?php
|
422 |
$inline_preview_data = $this->get_broadcast_inline_preview_data( $broadcast_data );
|
423 |
?>
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
<?php
|
441 |
if ( ! empty( $broadcast_data['body'] ) ) {
|
442 |
$template_data['content'] = ! empty( $broadcast_data['body'] ) ? $broadcast_data['body'] : '';
|
@@ -445,52 +454,52 @@ class ES_Newsletters {
|
|
445 |
ob_start();
|
446 |
$this->es_broadcast_preview_callback( $template_data );
|
447 |
$tempate_html = ob_get_clean();
|
448 |
-
echo $tempate_html;
|
449 |
}
|
450 |
?>
|
451 |
-
|
452 |
-
|
453 |
|
454 |
-
|
455 |
|
456 |
-
|
457 |
-
|
458 |
|
459 |
-
|
460 |
|
461 |
<?php do_action( 'ig_es_after_broadcast_right_pan_settings', $broadcast_data ); ?>
|
462 |
|
463 |
-
|
464 |
<?php
|
465 |
$enable_open_tracking = ! empty( $broadcast_data['meta']['enable_open_tracking'] ) ? $broadcast_data['meta']['enable_open_tracking'] : get_option( 'ig_es_track_email_opens', 'yes' );
|
466 |
?>
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
<span class="relative">
|
473 |
<input id="enable_open_tracking" type="checkbox" class="absolute w-0 h-0 opacity-0 es-check-toggle"
|
474 |
-
|
475 |
<span class="block w-8 h-5 bg-gray-300 rounded-full shadow-inner es-mail-toggle-line"></span>
|
476 |
<span class="absolute inset-y-0 left-0 block w-3 h-3 mt-1 ml-1 transition-all duration-300 ease-in-out bg-white rounded-full shadow es-mail-toggle-dot focus-within:shadow-outline"></span>
|
477 |
</span>
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
<?php do_action( 'ig_es_after_broadcast_tracking_options_settings', $broadcast_data ); ?>
|
482 |
-
|
483 |
|
484 |
<?php do_action( 'ig_es_broadcast_scheduling_options_settings', $broadcast_data ); ?>
|
485 |
-
|
486 |
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
|
495 |
<?php
|
496 |
}
|
@@ -531,7 +540,7 @@ class ES_Newsletters {
|
|
531 |
'finish_at' => '',
|
532 |
'created_at' => ig_get_current_date_time(),
|
533 |
'updated_at' => ig_get_current_date_time(),
|
534 |
-
'meta' => maybe_serialize( array( 'type' => 'newsletter' ) )
|
535 |
);
|
536 |
|
537 |
if ( empty( $notification ) ) {
|
@@ -608,7 +617,7 @@ class ES_Newsletters {
|
|
608 |
$last_name = $contact_details[1];
|
609 |
}
|
610 |
}
|
611 |
-
|
612 |
|
613 |
$es_template_body = $template_data['content'];
|
614 |
|
@@ -617,6 +626,8 @@ class ES_Newsletters {
|
|
617 |
$es_template_body = str_replace( '{{EMAIL}}', $useremail, $es_template_body );
|
618 |
$es_template_body = str_replace( '{{FIRSTNAME}}', $first_name, $es_template_body );
|
619 |
$es_template_body = str_replace( '{{LASTNAME}}', $last_name, $es_template_body );
|
|
|
|
|
620 |
|
621 |
if ( has_post_thumbnail( $template_id ) ) {
|
622 |
$image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $template_id ), 'full' );
|
@@ -625,23 +636,26 @@ class ES_Newsletters {
|
|
625 |
$image = '';
|
626 |
}
|
627 |
|
628 |
-
$html
|
629 |
$html .= '<style type="text/css">
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
|
|
|
|
|
|
634 |
</style>
|
635 |
<div class="wrap">
|
636 |
<div class="tool-box">
|
637 |
-
<div class="es-main"
|
638 |
<div class="es-preview broadcast-preview w-full">' . $es_template_body . '</div>
|
639 |
-
<div
|
640 |
</div>
|
641 |
-
<div
|
642 |
</div>
|
643 |
</div>';
|
644 |
-
echo apply_filters( 'the_content', $html );
|
645 |
}
|
646 |
|
647 |
}
|
@@ -754,7 +768,7 @@ class ES_Newsletters {
|
|
754 |
|
755 |
if ( ! empty( $list_id ) ) {
|
756 |
// Check if multiple lists selection is enabled.
|
757 |
-
if( is_array( $list_id ) && ! empty( $list_id ) ) {
|
758 |
// Since we need to get only one sample email for showing the preview, we can get it from the first list itself.
|
759 |
$list_id = $list_id[0];
|
760 |
}
|
@@ -801,7 +815,6 @@ class ES_Newsletters {
|
|
801 |
* @return array $broadcast_data
|
802 |
*
|
803 |
* @since 4.4.7
|
804 |
-
*
|
805 |
*/
|
806 |
public function add_tracking_fields_data( $broadcast_data = array() ) {
|
807 |
|
@@ -839,7 +852,7 @@ class ES_Newsletters {
|
|
839 |
if ( ! empty( $schedule_str ) ) {
|
840 |
$gmt_offset_option = get_option( 'gmt_offset' );
|
841 |
$gmt_offset = ( ! empty( $gmt_offset_option ) ) ? $gmt_offset_option : 0;
|
842 |
-
$schedule_date =
|
843 |
|
844 |
$data['start_at'] = $schedule_date;
|
845 |
$meta = ! empty( $data['meta'] ) ? maybe_unserialize( $data['meta'] ) : array();
|
@@ -854,15 +867,14 @@ class ES_Newsletters {
|
|
854 |
/**
|
855 |
* Method to check if open tracking is enabled broadcast wise.
|
856 |
*
|
857 |
-
* @param bool
|
858 |
-
* @param int
|
859 |
-
* @param int
|
860 |
* @param array $link_data Link data.
|
861 |
*
|
862 |
* @return bool $is_track_email_opens Is open tracking enabled.
|
863 |
*
|
864 |
* @since 4.4.7
|
865 |
-
*
|
866 |
*/
|
867 |
public function is_open_tracking_enabled( $is_track_email_opens, $contact_id, $campaign_id, $link_data ) {
|
868 |
if ( ! empty( $link_data ) ) {
|
@@ -881,4 +893,4 @@ class ES_Newsletters {
|
|
881 |
|
882 |
return $is_track_email_opens;
|
883 |
}
|
884 |
-
}
|
17 |
class ES_Newsletters {
|
18 |
|
19 |
// class instance
|
20 |
+
public static $instance;
|
21 |
|
22 |
// class constructor
|
23 |
public function __construct() {
|
38 |
add_filter( 'ig_es_broadcast_data', array( $this, 'add_tracking_fields_data' ) );
|
39 |
|
40 |
if ( ! ES()->is_pro() ) {
|
41 |
+
// Add scheduler data
|
42 |
add_filter( 'ig_es_broadcast_data', array( &$this, 'es_add_broadcast_scheduler_data' ), 10, 2 );
|
43 |
}
|
44 |
|
89 |
wp_safe_redirect( $campaign_url );
|
90 |
exit();
|
91 |
}
|
|
|
92 |
}
|
93 |
}
|
94 |
|
139 |
|
140 |
if ( ! empty( $broadcast_id ) ) {
|
141 |
|
142 |
+
$broadcast_query = $wpdb->prepare( ' id = %d LIMIT 0, 1', $broadcast_id );
|
143 |
+
$broadcasts = ES()->campaigns_db->get_by_conditions( $broadcast_query);
|
144 |
+
|
145 |
+
$broadcast = array_shift( $broadcasts );
|
146 |
+
$broadcast_data = array(
|
147 |
'id' => $broadcast['id'],
|
148 |
'name' => $broadcast['name'],
|
149 |
'subject' => $broadcast['subject'],
|
155 |
'template_id' => $broadcast['base_template_id'],
|
156 |
'status' => $broadcast['status'],
|
157 |
'meta' => maybe_unserialize( $broadcast['meta'] ),
|
158 |
+
|
159 |
);
|
160 |
}
|
161 |
|
194 |
$broadcast_allowed_edit_statuses = array(
|
195 |
IG_ES_CAMPAIGN_STATUS_ACTIVE,
|
196 |
IG_ES_CAMPAIGN_STATUS_IN_ACTIVE,
|
197 |
+
IG_ES_CAMPAIGN_STATUS_SCHEDULED,
|
198 |
);
|
199 |
|
200 |
if ( ! in_array( $broadcast_status, $broadcast_allowed_edit_statuses ) ) {
|
216 |
}
|
217 |
}
|
218 |
|
219 |
+
$select_list_attr = ES()->is_pro() ? 'multiple="multiple"' : '';
|
220 |
+
$select_list_name = ES()->is_pro() ? 'broadcast_data[list_ids][]' : 'broadcast_data[list_ids]';
|
221 |
+
$select_list_class = ES()->is_pro() ? 'ig-es-form-multiselect' : 'form-select';
|
222 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
223 |
?>
|
224 |
|
225 |
+
<div class="font-sans wrap">
|
226 |
<?php
|
227 |
if ( ! empty( $message_data ) ) {
|
228 |
$message = $message_data['message'];
|
230 |
ES_Common::show_message( $message, $type );
|
231 |
}
|
232 |
?>
|
233 |
+
<form action="#" method="POST" id="broadcast_form">
|
234 |
+
<input type="hidden" id="broadcast_id" name="broadcast_data[id]" value="<?php echo esc_attr( $broadcast_id ); ?>"/>
|
235 |
+
<input type="hidden" id="broadcast_status" name="broadcast_data[status]" value="<?php echo esc_attr( $broadcast_status ); ?>"/>
|
236 |
+
<fieldset class="block es_fieldset">
|
237 |
+
<div class="mx-auto wp-heading-inline max-w-7xl">
|
238 |
+
<header class="mx-auto max-w-7xl">
|
239 |
+
<div class="pb-2 md:flex md:items-center md:justify-between">
|
240 |
+
<div class="flex md:3/5 lg:w-7/12 xl:w-3/5">
|
241 |
+
<div class="flex min-w-0 md:w-3/5 lg:w-1/2">
|
242 |
+
<span class="pt-1.5 text-base font-normal leading-7 sm:leading-9 sm:truncate text-indigo-600"><a href="admin.php?page=es_campaigns"><?php echo esc_html__( 'Campaigns', 'email-subscribers' ); ?></a></span>
|
243 |
+
<svg class="w-6 h-6 mx-1 mt-4" fill="currentColor" viewBox="0 0 24 24">
|
244 |
+
<path
|
245 |
+
fill-rule="evenodd"
|
246 |
+
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
247 |
+
clip-rule="evenodd"
|
248 |
+
></path>
|
249 |
+
</svg>
|
250 |
+
|
251 |
+
<h2 class="pt-1 text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate"> <?php echo esc_html__( 'Broadcast', 'email-subscribers' ); ?>
|
252 |
+
</h2>
|
253 |
+
</div>
|
254 |
+
<div class="flex pt-3 md:-mr-8 lg:-mr-16 xl:mr-0 md:ml-8 lg:ml-16 xl:ml-20">
|
255 |
+
<ul id="progressbar" class="overflow-hidden">
|
256 |
+
<li id="content_menu" class="relative float-left px-1 pb-2 text-center list-none cursor-pointer active ">
|
257 |
+
<span class="mt-1 text-base font-medium tracking-wide text-gray-400 active"><?php echo esc_html__( 'Content', 'email-subscribers' ); ?></span>
|
258 |
+
</li>
|
259 |
+
<li id="summary_menu" class="relative float-left px-1 pb-2 ml-5 text-center list-none cursor-pointer hover:border-2 ">
|
260 |
+
<span class="mt-1 text-base font-medium tracking-wide text-gray-400"><?php echo esc_html__( 'Summary', 'email-subscribers' ); ?></span>
|
261 |
+
</li>
|
262 |
+
</ul>
|
263 |
+
</div>
|
264 |
+
</div>
|
265 |
+
<div class="flex mt-4 md:mt-0 md:ml-2 xl:ml-4">
|
266 |
+
|
267 |
+
<div id="broadcast_button" class="inline-block text-left ">
|
268 |
+
<button type="button"
|
269 |
+
class="inline-flex justify-center w-full py-2 text-sm font-medium leading-5 text-indigo-600 transition duration-150 ease-in-out border border-indigo-500 rounded-md cursor-pointer select-none next_btn hover:text-indigo-500 hover:shadow-md focus:outline-none focus:shadow-outline-indigo focus:shadow-lg hover:border-indigo-600 md:px-2 lg:px-3 xl:px-4">
|
270 |
+
<?php
|
271 |
+
echo esc_html__( 'Next',
|
272 |
+
'email-subscribers' );
|
273 |
+
?>
|
274 |
+
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 20 20" class="w-3 h-3 my-1 ml-2 -mr-1 text-indigo-600">
|
275 |
+
<path d="M9 5l7 7-7 7"></path>
|
276 |
+
</svg>
|
277 |
+
</button>
|
278 |
+
</div>
|
279 |
+
|
280 |
+
<div id="broadcast_button1" class="flex hidden mt-4 md:mt-0 md:ml-2 xl:ml-4">
|
281 |
<span>
|
282 |
<div class="relative inline-block text-left">
|
283 |
<span>
|
284 |
<button type="button"
|
285 |
+
class="inline-flex justify-center w-full py-2 text-sm font-medium leading-5 text-indigo-600 transition duration-150 ease-in-out border border-indigo-500 rounded-md cursor-pointer select-none pre_btn md:px-1 lg:px-3 xl:px-4 hover:text-indigo-500 hover:border-indigo-600 hover:shadow-md focus:outline-none focus:shadow-outline-indigo focus:shadow-lg ">
|
286 |
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" viewBox="0 0 20 20" class="w-3 h-3 my-1 mr-1"><path d="M15 19l-7-7 7-7"></path></svg><?php echo esc_html__( 'Previous', 'email-subscribers' ); ?>
|
287 |
</button>
|
288 |
</span>
|
289 |
</div>
|
290 |
</span>
|
291 |
+
</div>
|
292 |
|
293 |
+
<span class="md:ml-2 xl:ml-3">
|
294 |
<button type="button" class="inline-flex items-center w-full py-2 text-sm font-medium leading-5 text-gray-700 transition duration-150 ease-in-out bg-white border border-gray-300 rounded-md ig_es_draft_broadcast md:px-2 lg:px-3 xl:px-4 hover:bg-gray-50 focus:outline-none focus:shadow-outline focus:border-blue-300">
|
295 |
<?php echo esc_html__( 'Save Draft', 'email-subscribers' ); ?>
|
296 |
</button>
|
297 |
</span>
|
298 |
|
299 |
+
<span id="broadcast_button2" class="hidden md:ml-2 xl:ml-3">
|
300 |
<div class="relative inline-block text-left">
|
301 |
<span>
|
302 |
<?php
|
303 |
// If broadcast is sent or being sent then don't allow scheduling to conflicts.
|
304 |
if ( ! $is_broadcast_processing ) {
|
305 |
+
?>
|
306 |
<button type="submit" id="ig_es_broadcast_submitted" name="ig_es_broadcast_submitted" class="inline-flex justify-center py-2 text-sm font-medium leading-5 text-white transition duration-150 ease-in-out bg-indigo-600 border border-transparent rounded-md md:px-2 lg:px-3 xl:px-4 hover:bg-indigo-500 hover:text-white"
|
307 |
+
value="submitted">
|
308 |
+
<?php
|
309 |
+
if ( ES()->is_pro() ) {
|
310 |
echo esc_html__( 'Schedule', 'email-subscribers' );
|
311 |
} else {
|
312 |
echo esc_html__( 'Send', 'email-subscribers' );
|
313 |
}
|
314 |
+
}
|
315 |
+
?>
|
316 |
</button>
|
317 |
|
318 |
</span>
|
319 |
</div>
|
320 |
</span>
|
321 |
+
</div>
|
322 |
+
</div>
|
323 |
+
</header>
|
324 |
+
</div>
|
325 |
+
<div class="mx-auto max-w-7xl">
|
326 |
+
<hr class="wp-header-end">
|
327 |
+
</div>
|
328 |
+
<div class="mx-auto my-4 es_broadcast_first max-w-7xl">
|
329 |
+
<div>
|
330 |
+
<div class=" bg-white rounded-lg shadow-md md:flex">
|
331 |
+
<div class="broadcast_main_content py-4 pl-2">
|
332 |
+
<div class="block px-4 py-2">
|
333 |
+
<label for="ig_es_broadcast_subject" class="text-sm font-medium leading-5 text-gray-700"><?php echo esc_html__( 'Subject', 'email-subscribers' ); ?></label>
|
334 |
+
<input id="ig_es_broadcast_subject" class="block w-full mt-1 text-sm leading-5 border-gray-400 rounded-md shadow-sm form-input" name="broadcast_data[subject]" value="<?php echo esc_attr( $broadcast_subject ); ?>"/>
|
335 |
+
</div>
|
336 |
+
<div class="block px-4 py-2">
|
337 |
+
<label for="from_name" class="text-sm font-medium leading-5 text-gray-700 "><?php echo esc_html__( 'From Name', 'email-subscribers' ); ?></label>
|
338 |
+
<input id="from_name" class="block w-full mt-1 text-sm leading-5 border-gray-400 rounded-md shadow-sm form-input" name="broadcast_data[from_name]" value="<?php echo esc_attr( $broadcast_from_name ); ?>"/>
|
339 |
+
</div>
|
340 |
+
<div class="block px-4 py-2">
|
341 |
+
<label for="from_email" class="text-sm font-medium leading-5 text-gray-700"><?php echo esc_html__( 'From Email', 'email-subscribers' ); ?></label>
|
342 |
+
<input id="from_email" class="block w-full mt-1 text-sm leading-5 border-gray-400 rounded-md shadow-sm form-input" name="broadcast_data[from_email]" value="<?php echo esc_attr( $broadcast_email ); ?>"/>
|
343 |
+
</div>
|
344 |
+
<div class="block px-4 py-2">
|
345 |
+
<label for="reply_to" class="text-sm font-medium leading-5 text-gray-700"><?php echo esc_html__( 'Reply To', 'email-subscribers' ); ?></label>
|
346 |
+
<input id="reply_to" class="block w-full mt-1 text-sm leading-5 border-gray-400 rounded-md shadow-sm form-input" name="broadcast_data[reply_to_email]" value="<?php echo esc_attr( $broadcast_reply_to ); ?>"/>
|
347 |
+
</div>
|
348 |
+
|
349 |
+
<div class="w-full px-4 pt-1 pb-2 mt-1">
|
350 |
+
<label for="message" class="text-sm font-medium leading-5 text-gray-700"><?php echo esc_html__( 'Message', 'email-subscribers' ); ?></label>
|
|
|
351 |
<?php
|
352 |
$body = ! empty( $broadcast_data['body'] ) ? $broadcast_data['body'] : '';
|
353 |
$editor_args = array(
|
354 |
'textarea_name' => 'broadcast_data[body]',
|
355 |
'textarea_rows' => 40,
|
356 |
'media_buttons' => true,
|
357 |
+
'tinymce' => true,
|
358 |
+
'quicktags' => true,
|
359 |
+
'editor_class' => 'wp-editor-boradcast',
|
360 |
);
|
361 |
wp_editor( $body, 'edit-es-boradcast-body', $editor_args );
|
362 |
?>
|
363 |
+
</div>
|
364 |
<?php do_action( 'ig_es_after_broadcast_left_pan_settings', $broadcast_data ); ?>
|
365 |
+
</div>
|
366 |
+
<div class="broadcast_side_content ml-2 bg-gray-100 rounded-r-lg">
|
367 |
+
<div class="block pt-6 mx-4 pb-3">
|
368 |
+
<label for="template" class="text-sm font-medium leading-5 text-gray-700"><?php echo esc_html__( 'Design Template', 'email-subscribers' ); ?></label>
|
369 |
+
<select class="block w-full h-8 mt-1 text-sm rounded-md cursor-pointer h-9 form-select" name="broadcast_data[template_id]" id="base_template_id">
|
370 |
+
<?php
|
371 |
+
echo wp_kses( $templates, $allowedtags );
|
372 |
+
?>
|
373 |
+
</select>
|
374 |
+
</div>
|
375 |
+
<div class="block py-2 mx-4 ">
|
376 |
+
<label for="recipients" class="text-sm font-medium leading-5 text-gray-700"><?php echo esc_html__( 'Recipients', 'email-subscribers' ); ?></label>
|
377 |
+
<select <?php echo esc_attr( $select_list_attr ); ?> class="block w-full h-8 mt-1 text-sm rounded-md cursor-pointer h-9 <?php echo esc_attr( $select_list_class ); ?>" name="<?php echo esc_attr( $select_list_name ); ?>" id="ig_es_broadcast_list_ids">
|
378 |
+
<?php
|
379 |
+
echo wp_kses( $lists, $allowedtags );
|
380 |
+
?>
|
381 |
+
</select>
|
382 |
+
<div class="block mt-1">
|
383 |
+
<span id="ig_es_total_contacts"></span>
|
384 |
+
</div>
|
385 |
+
</div>
|
386 |
+
|
387 |
+
<div class="block pt-1 mx-4">
|
388 |
+
<span class="block pt-2 text-sm font-medium leading-5 text-gray-700 border-t border-gray-200"><?php echo esc_html__( 'Preview', 'email-subscribers' ); ?></span>
|
389 |
+
<div class="py-2">
|
390 |
+
<input type="radio" name="preview_option" class="form-radio" id="preview_in_popup" value="preview_in_popup" checked>
|
391 |
+
<label for="preview_in_popup" class="text-sm font-normal text-gray-600"><?php echo esc_html__( 'Browser', 'email-subscribers' ); ?>
|
392 |
+
</label>
|
393 |
+
<br>
|
394 |
+
</div>
|
395 |
+
|
396 |
+
<img class="es-loader inline-flex align-middle" src="<?php echo esc_url( ES_PLUGIN_URL ); ?>lite/public/images/spinner.gif" style="display:none;"/>
|
397 |
+
|
398 |
+
<div class="hidden" id="preview_template">
|
399 |
+
<div class="fixed top-0 left-0 z-50 flex items-center justify-center w-full h-full" style="background-color: rgba(0,0,0,.5);">
|
400 |
+
<div class="absolute h-auto p-4 ml-16 mr-4 text-left bg-white rounded shadow-xl z-80 md:max-w-5xl md:p-6 lg:p-8 ">
|
401 |
+
<h3 class="text-2xl text-center"><?php echo esc_html__( 'Template Preview', 'email-subscribers' ); ?></h3>
|
402 |
+
<p class="m-4 text-center"><?php echo esc_html__( 'There could be a slight variation on how your customer will view the email content.', 'email-subscribers' ); ?></p>
|
403 |
+
<div class="m-4 list-decimal broadcast_preview_container">
|
404 |
+
</div>
|
405 |
+
<div class="flex justify-center mt-8">
|
406 |
+
<button id="close_template" class="px-4 py-2 text-sm font-medium tracking-wide text-gray-700 border rounded select-none no-outline focus:outline-none focus:shadow-outline-red hover:border-red-400 active:shadow-lg "><?php echo esc_html__( 'Close', 'email-subscribers' ); ?></button>
|
407 |
+
</div>
|
408 |
+
</div>
|
409 |
+
</div>
|
410 |
+
</div>
|
411 |
|
412 |
<?php do_action( 'ig_es_after_broadcast_content_left_pan_settings', $broadcast_data ); ?>
|
413 |
|
414 |
+
<button id="es_test_email_btn" type="button"
|
415 |
+
class="rounded-md border text-indigo-600 border-indigo-500 text-sm leading-5 font-medium transition ease-in-out duration-150 select-none inline-flex justify-center hover:text-indigo-500 hover:border-indigo-600 hover:shadow-md focus:outline-none focus:shadow-outline-indigo focus:shadow-lg mt-1 px-4 py-2">
|
416 |
+
<span><?php echo esc_html__( 'Preview', 'email-subscribers' ); ?></span>
|
417 |
+
</button>
|
418 |
+
<img class="es-loader inline-flex align-middle pl-2 h-5 w-7" src="<?php echo esc_url( ES_PLUGIN_URL ); ?>lite/admin/images/spinner-2x.gif" style="display:none;"/>
|
419 |
+
<br/><span class="es-send-success es-icon" style="display:none;"><?php esc_html_e( 'Email Sent Successfully ', 'email-subscribers' ); ?></span>
|
420 |
+
<br/><span class="es-send-error es-icon" style="display:none;"><?php esc_html_e( 'Something went wrong. Please try again later', 'email-subscribers' ); ?></span>
|
421 |
+
</div>
|
422 |
+
</div>
|
423 |
+
</div>
|
424 |
+
</div>
|
425 |
+
</fieldset>
|
426 |
+
|
427 |
+
<fieldset class="es_fieldset">
|
428 |
+
|
429 |
+
<div class="my-4 hidden mx-auto es_broadcast_second max-w-7xl">
|
430 |
<?php
|
431 |
$inline_preview_data = $this->get_broadcast_inline_preview_data( $broadcast_data );
|
432 |
?>
|
433 |
+
<div class="max-w-7xl">
|
434 |
+
<div class=" bg-white rounded-lg shadow md:flex">
|
435 |
+
<div class="py-4 my-4 broadcast_main_content pt-3 pl-2">
|
436 |
+
<div class="block pb-2 mx-4">
|
437 |
+
<span class="text-sm font-medium text-gray-500"><?php echo esc_html__( 'Email Content Preview', 'email-subscribers' ); ?></span>
|
438 |
+
</div>
|
439 |
+
|
440 |
+
<div class="block pb-2 mx-4 mt-4 inline_broadcast_preview_container">
|
441 |
+
<div class="block">
|
442 |
+
<span class="text-2xl font-normal text-gray-600 broadcast_preview_subject"><?php echo ! empty( $broadcast_data['subject'] ) ? esc_html( $broadcast_data['subject'] ) : ''; ?></span>
|
443 |
+
</div>
|
444 |
+
<div class="block mt-3">
|
445 |
+
<span class="text-sm font-bold text-gray-800 broadcast_preview_contact_name"><?php echo ! empty( $inline_preview_data['contact_name'] ) ? esc_html( $inline_preview_data['contact_name'] ) : ''; ?></span>
|
446 |
+
<span class="pl-1 text-sm font-medium text-gray-700 broadcast_preview_contact_email"><?php echo ! empty( $inline_preview_data['contact_email'] ) ? esc_html('<' . $inline_preview_data['contact_email'] . '>' ) : ''; ?></span>
|
447 |
+
</div>
|
448 |
+
<div class="block mt-3 broadcast_preview_content">
|
449 |
<?php
|
450 |
if ( ! empty( $broadcast_data['body'] ) ) {
|
451 |
$template_data['content'] = ! empty( $broadcast_data['body'] ) ? $broadcast_data['body'] : '';
|
454 |
ob_start();
|
455 |
$this->es_broadcast_preview_callback( $template_data );
|
456 |
$tempate_html = ob_get_clean();
|
457 |
+
echo wp_kses( $tempate_html, $allowedtags);
|
458 |
}
|
459 |
?>
|
460 |
+
</div>
|
461 |
+
</div>
|
462 |
|
463 |
+
</div>
|
464 |
|
465 |
+
<div class="broadcast_side_content ml-2 bg-gray-100 rounded-r-lg">
|
466 |
+
<div id="ig_es_total_recipients" class="block mx-4 border-b border-gray-200">
|
467 |
|
468 |
+
</div>
|
469 |
|
470 |
<?php do_action( 'ig_es_after_broadcast_right_pan_settings', $broadcast_data ); ?>
|
471 |
|
472 |
+
<div class="block w-full px-4 py-2">
|
473 |
<?php
|
474 |
$enable_open_tracking = ! empty( $broadcast_data['meta']['enable_open_tracking'] ) ? $broadcast_data['meta']['enable_open_tracking'] : get_option( 'ig_es_track_email_opens', 'yes' );
|
475 |
?>
|
476 |
+
<div class="flex w-full pt-2 border-t border-gray-200">
|
477 |
+
<div class="w-11/12 text-sm font-normal text-gray-600"><?php echo esc_html__( 'Open Tracking', 'email-subscribers' ); ?>
|
478 |
+
</div>
|
479 |
+
<div>
|
480 |
+
<label for="enable_open_tracking" class="inline-flex items-center cursor-pointer ">
|
481 |
<span class="relative">
|
482 |
<input id="enable_open_tracking" type="checkbox" class="absolute w-0 h-0 opacity-0 es-check-toggle"
|
483 |
+
name="broadcast_data[meta][enable_open_tracking]" value="yes" <?php checked( $enable_open_tracking, 'yes' ); ?>/>
|
484 |
<span class="block w-8 h-5 bg-gray-300 rounded-full shadow-inner es-mail-toggle-line"></span>
|
485 |
<span class="absolute inset-y-0 left-0 block w-3 h-3 mt-1 ml-1 transition-all duration-300 ease-in-out bg-white rounded-full shadow es-mail-toggle-dot focus-within:shadow-outline"></span>
|
486 |
</span>
|
487 |
+
</label>
|
488 |
+
</div>
|
489 |
+
</div>
|
490 |
<?php do_action( 'ig_es_after_broadcast_tracking_options_settings', $broadcast_data ); ?>
|
491 |
+
</div>
|
492 |
|
493 |
<?php do_action( 'ig_es_broadcast_scheduling_options_settings', $broadcast_data ); ?>
|
494 |
+
</div>
|
495 |
|
496 |
+
</div>
|
497 |
+
</div>
|
498 |
+
</div>
|
499 |
|
500 |
+
</fieldset>
|
501 |
+
</form>
|
502 |
+
</div>
|
503 |
|
504 |
<?php
|
505 |
}
|
540 |
'finish_at' => '',
|
541 |
'created_at' => ig_get_current_date_time(),
|
542 |
'updated_at' => ig_get_current_date_time(),
|
543 |
+
'meta' => maybe_serialize( array( 'type' => 'newsletter' ) ),
|
544 |
);
|
545 |
|
546 |
if ( empty( $notification ) ) {
|
617 |
$last_name = $contact_details[1];
|
618 |
}
|
619 |
}
|
620 |
+
// $first_name =
|
621 |
|
622 |
$es_template_body = $template_data['content'];
|
623 |
|
626 |
$es_template_body = str_replace( '{{EMAIL}}', $useremail, $es_template_body );
|
627 |
$es_template_body = str_replace( '{{FIRSTNAME}}', $first_name, $es_template_body );
|
628 |
$es_template_body = str_replace( '{{LASTNAME}}', $last_name, $es_template_body );
|
629 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
630 |
+
add_filter( 'safe_style_css', 'ig_es_allowed_css_style' );
|
631 |
|
632 |
if ( has_post_thumbnail( $template_id ) ) {
|
633 |
$image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $template_id ), 'full' );
|
636 |
$image = '';
|
637 |
}
|
638 |
|
639 |
+
$html = '';
|
640 |
$html .= '<style type="text/css">
|
641 |
+
.es-main-preview-block{
|
642 |
+
display:flex;
|
643 |
+
}
|
644 |
+
.es-clear-preview{
|
645 |
+
clear: both;
|
646 |
+
}
|
647 |
+
|
648 |
</style>
|
649 |
<div class="wrap">
|
650 |
<div class="tool-box">
|
651 |
+
<div class="es-main-preview-block">
|
652 |
<div class="es-preview broadcast-preview w-full">' . $es_template_body . '</div>
|
653 |
+
<div class="es-clear-preview"></div>
|
654 |
</div>
|
655 |
+
<div class="es-clear-preview"></div>
|
656 |
</div>
|
657 |
</div>';
|
658 |
+
echo wp_kses( apply_filters( 'the_content', $html ), $allowedtags);
|
659 |
}
|
660 |
|
661 |
}
|
768 |
|
769 |
if ( ! empty( $list_id ) ) {
|
770 |
// Check if multiple lists selection is enabled.
|
771 |
+
if ( is_array( $list_id ) && ! empty( $list_id ) ) {
|
772 |
// Since we need to get only one sample email for showing the preview, we can get it from the first list itself.
|
773 |
$list_id = $list_id[0];
|
774 |
}
|
815 |
* @return array $broadcast_data
|
816 |
*
|
817 |
* @since 4.4.7
|
|
|
818 |
*/
|
819 |
public function add_tracking_fields_data( $broadcast_data = array() ) {
|
820 |
|
852 |
if ( ! empty( $schedule_str ) ) {
|
853 |
$gmt_offset_option = get_option( 'gmt_offset' );
|
854 |
$gmt_offset = ( ! empty( $gmt_offset_option ) ) ? $gmt_offset_option : 0;
|
855 |
+
$schedule_date = gmdate( 'Y-m-d H:i:s', $schedule_str - ( $gmt_offset * HOUR_IN_SECONDS ) );
|
856 |
|
857 |
$data['start_at'] = $schedule_date;
|
858 |
$meta = ! empty( $data['meta'] ) ? maybe_unserialize( $data['meta'] ) : array();
|
867 |
/**
|
868 |
* Method to check if open tracking is enabled broadcast wise.
|
869 |
*
|
870 |
+
* @param bool $is_track_email_opens Is open tracking enabled.
|
871 |
+
* @param int $contact_id Contact ID.
|
872 |
+
* @param int $campaign_id Campaign ID.
|
873 |
* @param array $link_data Link data.
|
874 |
*
|
875 |
* @return bool $is_track_email_opens Is open tracking enabled.
|
876 |
*
|
877 |
* @since 4.4.7
|
|
|
878 |
*/
|
879 |
public function is_open_tracking_enabled( $is_track_email_opens, $contact_id, $campaign_id, $link_data ) {
|
880 |
if ( ! empty( $link_data ) ) {
|
893 |
|
894 |
return $is_track_email_opens;
|
895 |
}
|
896 |
+
}
|
lite/includes/classes/class-es-old-widget.php
CHANGED
@@ -7,19 +7,22 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
class ES_Old_Widget extends WP_Widget {
|
9 |
|
10 |
-
function __construct() {
|
11 |
-
$widget_ops = array(
|
|
|
|
|
|
|
12 |
parent::__construct( 'email-subscribers', __( 'Email Subscribers', 'email-subscribers' ), $widget_ops );
|
13 |
}
|
14 |
|
15 |
-
function widget( $args, $instance ) {
|
16 |
|
17 |
$title = apply_filters( 'widget_title', $instance['es_title'] );
|
18 |
|
19 |
-
echo $args['before_widget'];
|
20 |
|
21 |
if ( ! empty( $title ) ) {
|
22 |
-
echo $args['before_title']
|
23 |
}
|
24 |
|
25 |
$display_name = isset( $instance['es_name'] ) ? esc_attr( $instance['es_name'] ) : '';
|
@@ -42,10 +45,10 @@ class ES_Old_Widget extends WP_Widget {
|
|
42 |
|
43 |
ES_Shortcode::render_form( $data );
|
44 |
|
45 |
-
echo $args['after_widget'];
|
46 |
}
|
47 |
|
48 |
-
function update( $new_instance, $old_instance ) {
|
49 |
$instance = $old_instance;
|
50 |
$instance['es_title'] = ( ! empty( $new_instance['es_title'] ) ) ? strip_tags( $new_instance['es_title'] ) : '';
|
51 |
$instance['es_desc'] = ( ! empty( $new_instance['es_desc'] ) ) ? strip_tags( $new_instance['es_desc'] ) : '';
|
@@ -55,12 +58,12 @@ class ES_Old_Widget extends WP_Widget {
|
|
55 |
return $instance;
|
56 |
}
|
57 |
|
58 |
-
function form( $instance ) {
|
59 |
$defaults = array(
|
60 |
'es_title' => '',
|
61 |
'es_desc' => '',
|
62 |
'es_name' => '',
|
63 |
-
'es_group' => ''
|
64 |
);
|
65 |
$instance = wp_parse_args( (array) $instance, $defaults );
|
66 |
$es_title = $instance['es_title'];
|
@@ -68,47 +71,51 @@ class ES_Old_Widget extends WP_Widget {
|
|
68 |
$es_name = $instance['es_name'];
|
69 |
$es_group = $instance['es_group'];
|
70 |
?>
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
<?php
|
90 |
$groups = ES()->lists_db->get_list_id_name_map();
|
91 |
if ( count( $groups ) > 0 ) {
|
92 |
$i = 1;
|
93 |
foreach ( $groups as $group ) {
|
94 |
?>
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
|
|
|
|
98 |
<?php echo esc_html( stripslashes( $group ) ); ?>
|
99 |
-
|
100 |
<?php
|
101 |
}
|
102 |
}
|
103 |
?>
|
104 |
-
|
105 |
-
|
106 |
<?php
|
107 |
}
|
108 |
|
109 |
-
function es_selected( $var ) {
|
110 |
-
if (
|
111 |
echo 'selected="selected"';
|
112 |
}
|
113 |
}
|
114 |
-
}
|
7 |
|
8 |
class ES_Old_Widget extends WP_Widget {
|
9 |
|
10 |
+
public function __construct() {
|
11 |
+
$widget_ops = array(
|
12 |
+
'classname' => 'widget_text elp-widget',
|
13 |
+
'description' => __( 'Email Subscribers', 'email-subscribers' ),
|
14 |
+
);
|
15 |
parent::__construct( 'email-subscribers', __( 'Email Subscribers', 'email-subscribers' ), $widget_ops );
|
16 |
}
|
17 |
|
18 |
+
public function widget( $args, $instance ) {
|
19 |
|
20 |
$title = apply_filters( 'widget_title', $instance['es_title'] );
|
21 |
|
22 |
+
echo wp_kses_post( $args['before_widget'] );
|
23 |
|
24 |
if ( ! empty( $title ) ) {
|
25 |
+
echo wp_kses_post( sprintf( '%s %s %s', $args['before_title'] , $title , $args['after_title']) );
|
26 |
}
|
27 |
|
28 |
$display_name = isset( $instance['es_name'] ) ? esc_attr( $instance['es_name'] ) : '';
|
45 |
|
46 |
ES_Shortcode::render_form( $data );
|
47 |
|
48 |
+
echo wp_kses_post( $args['after_widget'] );
|
49 |
}
|
50 |
|
51 |
+
public function update( $new_instance, $old_instance ) {
|
52 |
$instance = $old_instance;
|
53 |
$instance['es_title'] = ( ! empty( $new_instance['es_title'] ) ) ? strip_tags( $new_instance['es_title'] ) : '';
|
54 |
$instance['es_desc'] = ( ! empty( $new_instance['es_desc'] ) ) ? strip_tags( $new_instance['es_desc'] ) : '';
|
58 |
return $instance;
|
59 |
}
|
60 |
|
61 |
+
public function form( $instance ) {
|
62 |
$defaults = array(
|
63 |
'es_title' => '',
|
64 |
'es_desc' => '',
|
65 |
'es_name' => '',
|
66 |
+
'es_group' => '',
|
67 |
);
|
68 |
$instance = wp_parse_args( (array) $instance, $defaults );
|
69 |
$es_title = $instance['es_title'];
|
71 |
$es_name = $instance['es_name'];
|
72 |
$es_group = $instance['es_group'];
|
73 |
?>
|
74 |
+
<p>
|
75 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'es_title' ) ); ?>"><?php echo esc_html__( 'Widget Title', 'email-subscribers' ); ?></label>
|
76 |
+
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'es_title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'es_title' ) ); ?>" type="text" value="<?php echo esc_html( $es_title ); ?>"/>
|
77 |
+
</p>
|
78 |
+
<p>
|
79 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'es_desc' ) ); ?>"><?php echo esc_html__( 'Short description about subscription form', 'email-subscribers' ); ?></label>
|
80 |
+
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'es_desc' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'es_desc' ) ); ?>" type="text" value="<?php echo esc_html( $es_desc ); ?>"/>
|
81 |
+
</p>
|
82 |
+
<p>
|
83 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'es_name' ) ); ?>"><?php echo esc_html__( 'Display Name Field', 'email-subscribers' ); ?></label>
|
84 |
+
<select class="widefat" id="<?php echo esc_attr( $$this->get_field_id( 'es_name' ) ); ?>" name="<?php echo esc_attr( $$this->get_field_name( 'es_name' ) ); ?>">
|
85 |
+
<option value="YES" <?php $this->es_selected( 'YES' == $es_name ); ?>><?php echo esc_html__( 'YES', 'email-subscribers' ); ?></option>
|
86 |
+
<option value="NO" <?php $this->es_selected( 'NO' == $es_name ); ?>><?php echo esc_html__( 'NO', 'email-subscribers' ); ?></option>
|
87 |
+
</select>
|
88 |
+
</p>
|
89 |
+
<p>
|
90 |
+
<label for="<?php echo esc_attr( $$this->get_field_id( 'es_group' ) ); ?>"><?php echo esc_html__( 'Subscriber Group', 'email-subscribers' ); ?></label>
|
91 |
+
<select class="widefat" name="<?php echo esc_attr( $$this->get_field_name( 'es_group' ) ); ?>" id="<?php echo esc_attr( $$this->get_field_id( 'es_group' ) ); ?>">
|
92 |
<?php
|
93 |
$groups = ES()->lists_db->get_list_id_name_map();
|
94 |
if ( count( $groups ) > 0 ) {
|
95 |
$i = 1;
|
96 |
foreach ( $groups as $group ) {
|
97 |
?>
|
98 |
+
<option value="<?php echo esc_attr( stripslashes( $group ) ); ?>"
|
99 |
+
<?php
|
100 |
+
if ( stripslashes( $es_group ) == $group ) {
|
101 |
+
echo 'selected="selected"';
|
102 |
+
}
|
103 |
+
?>
|
104 |
+
>
|
105 |
<?php echo esc_html( stripslashes( $group ) ); ?>
|
106 |
+
</option>
|
107 |
<?php
|
108 |
}
|
109 |
}
|
110 |
?>
|
111 |
+
</select>
|
112 |
+
</p>
|
113 |
<?php
|
114 |
}
|
115 |
|
116 |
+
public function es_selected( $var ) {
|
117 |
+
if ( 1 == $var || true == $var ) {
|
118 |
echo 'selected="selected"';
|
119 |
}
|
120 |
}
|
121 |
+
}
|
lite/includes/classes/class-es-post-notifications.php
CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
class ES_Post_Notifications_Table {
|
9 |
|
10 |
-
static $instance;
|
11 |
|
12 |
public function __construct() {
|
13 |
|
@@ -18,15 +18,17 @@ class ES_Post_Notifications_Table {
|
|
18 |
$action = ig_es_get_request_data( 'action' );
|
19 |
|
20 |
?>
|
21 |
-
|
22 |
-
<?php
|
23 |
-
|
24 |
-
|
25 |
$list = ig_es_get_request_data( 'list' );
|
26 |
$this->edit_list( absint( $list ) );
|
|
|
|
|
27 |
}
|
28 |
?>
|
29 |
-
|
30 |
<?php
|
31 |
}
|
32 |
|
@@ -35,11 +37,11 @@ class ES_Post_Notifications_Table {
|
|
35 |
$submitted = ig_es_get_request_data( 'submitted' );
|
36 |
if ( 'submitted' === $submitted ) {
|
37 |
|
38 |
-
$list_id
|
39 |
-
$template_id
|
40 |
-
$cat
|
41 |
$es_note_cat_parent = ig_es_get_request_data( 'es_note_cat_parent' );
|
42 |
-
$cat
|
43 |
|
44 |
if ( empty( $list_id ) ) {
|
45 |
$message = __( 'Please select list.', 'email-subscribers' );
|
@@ -67,9 +69,9 @@ class ES_Post_Notifications_Table {
|
|
67 |
'status' => 1,
|
68 |
'type' => $type,
|
69 |
'name' => $title,
|
70 |
-
'slug' => sanitize_title( $title )
|
71 |
);
|
72 |
-
|
73 |
$data = apply_filters( 'ig_es_post_notification_data', $data );
|
74 |
if ( empty( $data['base_template_id'] ) ) {
|
75 |
$message = __( 'Please select template.', 'email-subscribers' );
|
@@ -79,8 +81,9 @@ class ES_Post_Notifications_Table {
|
|
79 |
return;
|
80 |
}
|
81 |
$this->save_list( $data );
|
82 |
-
$type = ucwords(str_replace('_', ' ', $data['type']));
|
83 |
-
|
|
|
84 |
ES_Common::show_message( $message, 'success' );
|
85 |
}
|
86 |
|
@@ -104,7 +107,7 @@ class ES_Post_Notifications_Table {
|
|
104 |
'categories' => ES_Common::convert_categories_array_to_string( $cat ),
|
105 |
'list_ids' => ig_es_get_request_data( 'list_id' ),
|
106 |
'base_template_id' => ig_es_get_request_data( 'template_id' ),
|
107 |
-
'status' => 'active'
|
108 |
);
|
109 |
$wpdb->update( IG_CAMPAIGNS_TABLE, $data, array( 'id' => $id ) );
|
110 |
|
@@ -124,29 +127,29 @@ class ES_Post_Notifications_Table {
|
|
124 |
*/
|
125 |
public static function get_lists( $per_page = 5, $page_number = 1 ) {
|
126 |
|
127 |
-
global $wpdb;
|
128 |
|
129 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
130 |
$order = ig_es_get_request_data( 'order' );
|
131 |
$search = ig_es_get_request_data( 's' );
|
132 |
|
133 |
$add_where_clause = false;
|
134 |
-
$sql =
|
135 |
$args = array();
|
136 |
$query = array();
|
137 |
|
138 |
if ( ! empty( $search ) ) {
|
139 |
$add_where_clause = true;
|
140 |
-
$query[] =
|
141 |
-
$args[] =
|
142 |
}
|
143 |
|
144 |
if ( $add_where_clause ) {
|
145 |
-
$sql .=
|
146 |
|
147 |
if ( count( $query ) > 0 ) {
|
148 |
-
$sql .= implode(
|
149 |
-
$sql = $
|
150 |
}
|
151 |
}
|
152 |
|
@@ -161,7 +164,7 @@ class ES_Post_Notifications_Table {
|
|
161 |
$sql .= " LIMIT $per_page";
|
162 |
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
|
163 |
|
164 |
-
$result = $
|
165 |
|
166 |
return $result;
|
167 |
|
@@ -171,15 +174,16 @@ class ES_Post_Notifications_Table {
|
|
171 |
|
172 |
global $wpdb;
|
173 |
|
174 |
-
$
|
|
|
175 |
|
176 |
$submitted = ig_es_get_request_data( 'submitted' );
|
177 |
if ( 'submitted' === $submitted ) {
|
178 |
$categories = ig_es_get_request_data( 'es_note_cat', array() );
|
179 |
|
180 |
-
//all categories selected
|
181 |
$parent_category_option = ig_es_get_request_data( 'es_note_cat_parent' );
|
182 |
-
if (
|
183 |
array_unshift( $categories, $parent_category_option );
|
184 |
}
|
185 |
|
@@ -187,7 +191,7 @@ class ES_Post_Notifications_Table {
|
|
187 |
'categories' => ES_Common::convert_categories_array_to_string( $categories ),
|
188 |
'list_ids' => ig_es_get_request_data( 'list_id' ),
|
189 |
'base_template_id' => ig_es_get_request_data( 'template_id' ),
|
190 |
-
'status' => ig_es_get_request_data( 'status' )
|
191 |
);
|
192 |
|
193 |
$title = '';
|
@@ -196,27 +200,30 @@ class ES_Post_Notifications_Table {
|
|
196 |
}
|
197 |
$data['name'] = $title;
|
198 |
|
199 |
-
$data
|
200 |
-
$data['type'] = !empty($data['type']) ? $data['type'] : 'post_notification';
|
201 |
-
|
202 |
if ( empty( $data['base_template_id'] ) ) {
|
203 |
$message = __( 'Please select template.', 'email-subscribers' );
|
204 |
ES_Common::show_message( $message, 'error' );
|
205 |
$this->prepare_post_notification_form( $id, $data );
|
|
|
206 |
return;
|
207 |
}
|
208 |
-
|
209 |
if ( empty( $categories ) ) {
|
210 |
$message = __( 'Please select Categories.', 'email-subscribers' );
|
211 |
ES_Common::show_message( $message, 'error' );
|
212 |
$this->prepare_post_notification_form( $id, $data );
|
|
|
213 |
return;
|
214 |
}
|
215 |
$this->save_list( $data, $id );
|
216 |
|
217 |
$data['categories'] = ES_Common::convert_categories_string_to_array( $data['categories'], true );
|
218 |
-
$type
|
219 |
-
|
|
|
220 |
ES_Common::show_message( $message, 'success' );
|
221 |
} else {
|
222 |
|
@@ -229,7 +236,7 @@ class ES_Post_Notifications_Table {
|
|
229 |
'categories' => $categories,
|
230 |
'list_ids' => $notification['list_ids'],
|
231 |
'base_template_id' => $notification['base_template_id'],
|
232 |
-
'status' => $notification['status']
|
233 |
);
|
234 |
}
|
235 |
|
@@ -242,163 +249,177 @@ class ES_Post_Notifications_Table {
|
|
242 |
$is_new = empty( $id ) ? 1 : 0;
|
243 |
|
244 |
$action = 'new';
|
245 |
-
$heading = __(' New Post Notification','email-subscribers');
|
246 |
if ( ! $is_new ) {
|
247 |
$action = 'edit';
|
248 |
$heading = __( ' Edit Post Notification', 'email-subscribers' );
|
249 |
}
|
250 |
-
$cat
|
251 |
-
$list_id
|
252 |
-
|
253 |
$template_id = isset( $data['base_template_id'] ) ? $data['base_template_id'] : '';
|
254 |
-
$status = isset( $data['status'] ) ? $data['status'] : 0
|
255 |
$nonce = wp_create_nonce( 'es_post_notification' );
|
256 |
|
257 |
$select_list_attr = ES()->is_pro() ? 'multiple="multiple"' : '';
|
258 |
$select_list_name = ES()->is_pro() ? 'list_id[]' : 'list_id';
|
259 |
$select_list_class = ES()->is_pro() ? 'ig-es-form-multiselect' : 'form-select';
|
|
|
260 |
?>
|
261 |
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
|
|
|
|
|
|
277 |
<?php } ?>
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
|
341 |
<span class="es-mail-toggle-line inline-block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
342 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline"></span>
|
343 |
</span></label>
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
|
|
|
|
402 |
|
403 |
|
404 |
/**
|
@@ -408,18 +429,19 @@ class ES_Post_Notifications_Table {
|
|
408 |
*/
|
409 |
public function get_bulk_actions() {
|
410 |
$actions = array(
|
411 |
-
'bulk_delete' => 'Delete'
|
412 |
);
|
413 |
|
414 |
return $actions;
|
415 |
}
|
416 |
|
417 |
-
public function search_box( $text, $input_id ) {
|
418 |
-
|
419 |
-
|
420 |
-
|
|
|
421 |
<?php submit_button( 'Search Notifications', 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
422 |
-
|
423 |
<?php
|
424 |
}
|
425 |
|
7 |
|
8 |
class ES_Post_Notifications_Table {
|
9 |
|
10 |
+
public static $instance;
|
11 |
|
12 |
public function __construct() {
|
13 |
|
18 |
$action = ig_es_get_request_data( 'action' );
|
19 |
|
20 |
?>
|
21 |
+
<div class="wrap">
|
22 |
+
<?php
|
23 |
+
|
24 |
+
if ( 'edit' === $action ) {
|
25 |
$list = ig_es_get_request_data( 'list' );
|
26 |
$this->edit_list( absint( $list ) );
|
27 |
+
} else {
|
28 |
+
$this->es_newnotification_callback();
|
29 |
}
|
30 |
?>
|
31 |
+
</div>
|
32 |
<?php
|
33 |
}
|
34 |
|
37 |
$submitted = ig_es_get_request_data( 'submitted' );
|
38 |
if ( 'submitted' === $submitted ) {
|
39 |
|
40 |
+
$list_id = ig_es_get_request_data( 'list_id' );
|
41 |
+
$template_id = ig_es_get_request_data( 'template_id' );
|
42 |
+
$cat = ig_es_get_request_data( 'es_note_cat' );
|
43 |
$es_note_cat_parent = ig_es_get_request_data( 'es_note_cat_parent' );
|
44 |
+
$cat = ( ! empty( $es_note_cat_parent ) && '{a}All{a}' == $es_note_cat_parent ) ? array( $es_note_cat_parent ) : $cat;
|
45 |
|
46 |
if ( empty( $list_id ) ) {
|
47 |
$message = __( 'Please select list.', 'email-subscribers' );
|
69 |
'status' => 1,
|
70 |
'type' => $type,
|
71 |
'name' => $title,
|
72 |
+
'slug' => sanitize_title( $title ),
|
73 |
);
|
74 |
+
|
75 |
$data = apply_filters( 'ig_es_post_notification_data', $data );
|
76 |
if ( empty( $data['base_template_id'] ) ) {
|
77 |
$message = __( 'Please select template.', 'email-subscribers' );
|
81 |
return;
|
82 |
}
|
83 |
$this->save_list( $data );
|
84 |
+
$type = ucwords( str_replace( '_', ' ', $data['type'] ) );
|
85 |
+
/* translators: %s: Campaign Type */
|
86 |
+
$message = sprintf( __( '%s has been added successfully!', 'email-subscribers' ), $type );
|
87 |
ES_Common::show_message( $message, 'success' );
|
88 |
}
|
89 |
|
107 |
'categories' => ES_Common::convert_categories_array_to_string( $cat ),
|
108 |
'list_ids' => ig_es_get_request_data( 'list_id' ),
|
109 |
'base_template_id' => ig_es_get_request_data( 'template_id' ),
|
110 |
+
'status' => 'active',
|
111 |
);
|
112 |
$wpdb->update( IG_CAMPAIGNS_TABLE, $data, array( 'id' => $id ) );
|
113 |
|
127 |
*/
|
128 |
public static function get_lists( $per_page = 5, $page_number = 1 ) {
|
129 |
|
130 |
+
global $wpdb, $wpbd;
|
131 |
|
132 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
133 |
$order = ig_es_get_request_data( 'order' );
|
134 |
$search = ig_es_get_request_data( 's' );
|
135 |
|
136 |
$add_where_clause = false;
|
137 |
+
$sql = 'SELECT * FROM ' . IG_CAMPAIGNS_TABLE;
|
138 |
$args = array();
|
139 |
$query = array();
|
140 |
|
141 |
if ( ! empty( $search ) ) {
|
142 |
$add_where_clause = true;
|
143 |
+
$query[] = ' name LIKE %s ';
|
144 |
+
$args[] = '%' . $wpdb->esc_like( $search ) . '%';
|
145 |
}
|
146 |
|
147 |
if ( $add_where_clause ) {
|
148 |
+
$sql .= ' WHERE ';
|
149 |
|
150 |
if ( count( $query ) > 0 ) {
|
151 |
+
$sql .= implode( ' AND ', $query );
|
152 |
+
$sql = $wpbd->prepare( $sql, $args );
|
153 |
}
|
154 |
}
|
155 |
|
164 |
$sql .= " LIMIT $per_page";
|
165 |
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
|
166 |
|
167 |
+
$result = $wpbd->get_results( $sql, 'ARRAY_A' );
|
168 |
|
169 |
return $result;
|
170 |
|
174 |
|
175 |
global $wpdb;
|
176 |
|
177 |
+
$notification_query = $wpdb->prepare( ' id = %d LIMIT 0, 1', $id );
|
178 |
+
$notifications = ES()->campaigns_db->get_by_conditions( $notification_query );
|
179 |
|
180 |
$submitted = ig_es_get_request_data( 'submitted' );
|
181 |
if ( 'submitted' === $submitted ) {
|
182 |
$categories = ig_es_get_request_data( 'es_note_cat', array() );
|
183 |
|
184 |
+
// all categories selected
|
185 |
$parent_category_option = ig_es_get_request_data( 'es_note_cat_parent' );
|
186 |
+
if ( '{a}All{a}' === $parent_category_option ) {
|
187 |
array_unshift( $categories, $parent_category_option );
|
188 |
}
|
189 |
|
191 |
'categories' => ES_Common::convert_categories_array_to_string( $categories ),
|
192 |
'list_ids' => ig_es_get_request_data( 'list_id' ),
|
193 |
'base_template_id' => ig_es_get_request_data( 'template_id' ),
|
194 |
+
'status' => ig_es_get_request_data( 'status' ),
|
195 |
);
|
196 |
|
197 |
$title = '';
|
200 |
}
|
201 |
$data['name'] = $title;
|
202 |
|
203 |
+
$data = apply_filters( 'ig_es_post_notification_data', $data );
|
204 |
+
$data['type'] = ! empty( $data['type'] ) ? $data['type'] : 'post_notification';
|
205 |
+
//check tempalte id
|
206 |
if ( empty( $data['base_template_id'] ) ) {
|
207 |
$message = __( 'Please select template.', 'email-subscribers' );
|
208 |
ES_Common::show_message( $message, 'error' );
|
209 |
$this->prepare_post_notification_form( $id, $data );
|
210 |
+
|
211 |
return;
|
212 |
}
|
213 |
+
// check categories
|
214 |
if ( empty( $categories ) ) {
|
215 |
$message = __( 'Please select Categories.', 'email-subscribers' );
|
216 |
ES_Common::show_message( $message, 'error' );
|
217 |
$this->prepare_post_notification_form( $id, $data );
|
218 |
+
|
219 |
return;
|
220 |
}
|
221 |
$this->save_list( $data, $id );
|
222 |
|
223 |
$data['categories'] = ES_Common::convert_categories_string_to_array( $data['categories'], true );
|
224 |
+
$type = ucwords( str_replace( '_', ' ', $data['type'] ) );
|
225 |
+
/* translators: %s: Campaign type */
|
226 |
+
$message = sprintf( __( '%s has been updated successfully!', 'email-subscribers' ), $type );
|
227 |
ES_Common::show_message( $message, 'success' );
|
228 |
} else {
|
229 |
|
236 |
'categories' => $categories,
|
237 |
'list_ids' => $notification['list_ids'],
|
238 |
'base_template_id' => $notification['base_template_id'],
|
239 |
+
'status' => $notification['status'],
|
240 |
);
|
241 |
}
|
242 |
|
249 |
$is_new = empty( $id ) ? 1 : 0;
|
250 |
|
251 |
$action = 'new';
|
252 |
+
$heading = __( ' New Post Notification', 'email-subscribers' );
|
253 |
if ( ! $is_new ) {
|
254 |
$action = 'edit';
|
255 |
$heading = __( ' Edit Post Notification', 'email-subscribers' );
|
256 |
}
|
257 |
+
$cat = isset( $data['categories'] ) ? $data['categories'] : '';
|
258 |
+
$list_id = isset( $data['list_ids'] ) ? $data['list_ids'] : '';
|
259 |
+
|
260 |
$template_id = isset( $data['base_template_id'] ) ? $data['base_template_id'] : '';
|
261 |
+
$status = isset( $data['status'] ) ? $data['status'] : 0;
|
262 |
$nonce = wp_create_nonce( 'es_post_notification' );
|
263 |
|
264 |
$select_list_attr = ES()->is_pro() ? 'multiple="multiple"' : '';
|
265 |
$select_list_name = ES()->is_pro() ? 'list_id[]' : 'list_id';
|
266 |
$select_list_class = ES()->is_pro() ? 'ig-es-form-multiselect' : 'form-select';
|
267 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
268 |
?>
|
269 |
|
270 |
+
<div class="wrap max-w-full mt-1 font-sans">
|
271 |
+
<header class="wp-heading-inline">
|
272 |
+
<div class="sm:grid sm:grid-cols lg:grid lg:grid-cols-2 max-w-full">
|
273 |
+
<div class="mt-2">
|
274 |
+
<h2 class="text-2xl font-medium mt-2 text-gray-900 sm:leading-9 sm:truncate">
|
275 |
+
<span class="text-base font-normal leading-7 text-indigo-600 sm:leading-9 sm:truncate"> <a href="admin.php?page=es_campaigns"><?php esc_html_e( 'Campaigns ', 'email-subscribers' ); ?></a></span>
|
276 |
+
<svg fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" class="w-4 h-4 inline-block align-middle">
|
277 |
+
<path d="M9 5l7 7-7 7"></path>
|
278 |
+
</svg>
|
279 |
+
|
280 |
+
<?php echo esc_html( $heading ); ?>
|
281 |
+
</h2>
|
282 |
+
</div>
|
283 |
+
<div class="py-2 md:mt-0">
|
284 |
+
<div class="flex flex-row sm:justify-start md:justify-end mt-2">
|
285 |
+
<div>
|
286 |
+
<?php if ( 'edit' === $action ) { ?>
|
287 |
+
<a href="admin.php?page=es_notifications&action=new" class="ig-es-title-button px-4 py-2 mx-2"><?php esc_html_e( 'Add New', 'email-subscribers' ); ?></a>
|
288 |
<?php } ?>
|
289 |
+
<a href="edit.php?post_type=es_template" class="ig-es-imp-button px-4 py-2"><?php esc_html_e( 'Manage Templates', 'email-subscribers' ); ?></a>
|
290 |
+
</div>
|
291 |
+
</div>
|
292 |
+
</div>
|
293 |
+
</div>
|
294 |
+
</header>
|
295 |
+
<div class="">
|
296 |
+
<hr class="wp-header-end">
|
297 |
+
</div>
|
298 |
+
|
299 |
+
<div class="bg-white shadow-md rounded-lg">
|
300 |
+
<form class="ml-5 mr-4 text-left pt-4 mt-2 item-center" method="post" action="admin.php?page=es_notifications&action=<?php echo esc_attr( $action ); ?>&list=<?php echo esc_attr( $id ); ?>&_wpnonce=<?php echo esc_attr( $nonce ); ?>">
|
301 |
+
|
302 |
+
<table class="max-w-full form-table">
|
303 |
+
<tbody>
|
304 |
+
|
305 |
+
<?php do_action( 'es_before_post_notification_settings', $id ); ?>
|
306 |
+
|
307 |
+
<tr class="border-b border-gray-100">
|
308 |
+
<th scope="row" class="w-3/12 pt-3 pb-8 text-left">
|
309 |
+
<label for="tag-link"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-2">
|
310 |
+
<?php esc_html_e( 'Select List', 'email-subscribers' ); ?></span>
|
311 |
+
<p class="italic text-xs font-normal text-gray-400 mt-2 ml-6 leading-snug"><?php esc_html_e( 'Contacts from the selected list will be notified about new post notification.', 'email-subscribers' ); ?></p></label>
|
312 |
+
</th>
|
313 |
+
<td class="w-9/12 pb-3 ">
|
314 |
+
<div class="flex">
|
315 |
+
<div class="w-2/4 inline-flex ml-12 relative">
|
316 |
+
<select <?php echo esc_attr( $select_list_attr ); ?> class="absolute shadow-sm border border-gray-400 w-2/3 <?php echo esc_attr( $select_list_class ); ?>" name="<?php echo esc_attr( $select_list_name ); ?>" id="ig_es_post_notification_list_ids">
|
317 |
+
<?php
|
318 |
+
$lists_dropdown = ES_Common::prepare_list_dropdown_options( $list_id );
|
319 |
+
echo wp_kses( $lists_dropdown, $allowedtags );
|
320 |
+
?>
|
321 |
+
</select>
|
322 |
+
</div>
|
323 |
+
|
324 |
+
<?php do_action( 'ig_es_add_multilist_options' ); ?>
|
325 |
+
</div>
|
326 |
+
</td>
|
327 |
+
</tr>
|
328 |
+
<tr class="border-b border-gray-100">
|
329 |
+
<th scope="row" class="w-3/12 pt-3 pb-8 text-left">
|
330 |
+
<label for="tag-link"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-2">
|
331 |
+
<?php esc_html_e( 'Select template', 'email-subscribers' ); ?></span>
|
332 |
+
<p class="italic text-xs font-normal text-gray-400 mt-2 ml-6 leading-snug"><?php esc_html_e( 'Content of the selected template will be sent out as post notification.', 'email-subscribers' ); ?></p>
|
333 |
+
</label>
|
334 |
+
</th>
|
335 |
+
<td class="w-9/12 pb-3">
|
336 |
+
<select class="relative form-select shadow-sm border border-gray-400 w-1/3 ml-12" name="template_id" id="base_template_id">
|
337 |
+
<?php
|
338 |
+
$templates = ES_Common::prepare_templates_dropdown_options( 'post_notification', $template_id );
|
339 |
+
echo wp_kses( $templates, $allowedtags );
|
340 |
+
?>
|
341 |
+
</select>
|
342 |
+
<div class="es-preview" style="float: right;width: 25%;">
|
343 |
+
<div class="es-templ-img"></div>
|
344 |
+
</div>
|
345 |
+
</td>
|
346 |
+
</tr>
|
347 |
+
<?php do_action( 'es_after_post_notification_template', $id ); ?>
|
348 |
+
<?php if ( ! $is_new ) { ?>
|
349 |
+
<tr class="border-b border-gray-100">
|
350 |
+
<th scope="row" class="w-3/12 pt-3 pb-8 text-left">
|
351 |
+
<label for="tag-link"><span class="block ml-6 pr-4 pt-2 text-sm font-medium text-gray-600 pb-2">
|
352 |
+
<?php esc_html_e( 'Select Status', 'email-subscribers' ); ?>
|
353 |
+
</label>
|
354 |
+
</th>
|
355 |
+
<td class="w-9/12 py-3">
|
356 |
+
<label for="status" class="ml-12 inline-flex items-center cursor-pointer"><span class="relative">
|
357 |
+
<input id="status" type="checkbox" class="absolute es-check-toggle opacity-0 w-0 h-0"
|
358 |
+
name="status" value="1" <?php checked( $status, '1' ); ?> />
|
359 |
|
360 |
<span class="es-mail-toggle-line inline-block w-10 h-6 bg-gray-300 rounded-full shadow-inner"></span>
|
361 |
<span class="es-mail-toggle-dot absolute transition-all duration-300 ease-in-out block w-4 h-4 mt-1 ml-1 bg-white rounded-full shadow inset-y-0 left-0 focus-within:shadow-outline"></span>
|
362 |
</span></label>
|
363 |
+
</td>
|
364 |
+
</tr>
|
365 |
+
<?php } ?>
|
366 |
+
<tr class="border-b border-gray-100">
|
367 |
+
<th scope="row" class="pt-3 pb-8 w-3/12 text-left">
|
368 |
+
<label for="tag-link"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-2"><?php esc_html_e( 'Select Post Category', 'email-subscribers' ); ?></span>
|
369 |
+
<p class="italic text-xs font-normal text-gray-400 mt-2 ml-6 leading-snug"><?php esc_html_e( 'Notification will be sent out when any post from selected categories will be published.', 'email-subscribers' ); ?></p></label>
|
370 |
+
</th>
|
371 |
+
<td class="pt-3 w-9/12" style="vertical-align: top;">
|
372 |
+
<table border="0" cellspacing="0" class="ml-4 pt-3">
|
373 |
+
<tbody>
|
374 |
+
<?php
|
375 |
+
$categories_lists = ES_Common::prepare_categories_html( $cat );
|
376 |
+
echo wp_kses( $categories_lists, $allowedtags );
|
377 |
+
?>
|
378 |
+
</tbody>
|
379 |
+
</table>
|
380 |
+
</td>
|
381 |
+
</tr>
|
382 |
+
<tr class="border-b border-gray-100">
|
383 |
+
<th scope="row" class="pt-3 pb-8 w-3/12 text-left">
|
384 |
+
<label for="tag-link"><span class="block ml-6 pr-4 text-sm font-medium text-gray-600 pb-2">
|
385 |
+
<?php esc_html_e( 'Select custom post type(s)', 'email-subscribers' ); ?></span>
|
386 |
+
<p class="italic text-xs font-normal text-gray-400 mt-2 ml-6 leading-snug"><?php esc_html_e( '(Optional) Select custom post type for which you want to send notification.', 'email-subscribers' ); ?></p></label>
|
387 |
+
|
388 |
+
</th>
|
389 |
+
<td class="w-9/12 pt-3 pb-8">
|
390 |
+
<table border="0" cellspacing="0">
|
391 |
+
<tbody>
|
392 |
+
<?php
|
393 |
+
$custom_post_type = '';
|
394 |
+
$custom_post_type_list = ES_Common::prepare_custom_post_type_checkbox( $cat );
|
395 |
+
echo wp_kses( $custom_post_type_list, $allowedtags );
|
396 |
+
?>
|
397 |
+
</tbody>
|
398 |
+
</table>
|
399 |
+
</td>
|
400 |
+
</tr>
|
401 |
+
<?php do_action( 'es_after_post_notification_settings', $id ); ?>
|
402 |
+
<tr>
|
403 |
+
<td><input type="hidden" name="submitted" value="submitted"></td>
|
404 |
+
</tr>
|
405 |
+
</tbody>
|
406 |
+
</table>
|
407 |
+
<div>
|
408 |
+
<?php
|
409 |
+
$submit_button_text = $is_new ? __( 'Save Campaign', 'email-subscribers' ) : __( 'Save Changes', 'email-subscribers' );
|
410 |
+
?>
|
411 |
+
<p class="submit"><input type="submit" name="submit" id="ig_es_campaign_post_notification_submit_button" class="cursor-pointer align-middle ig-es-primary-button px-4 py-2 ml-6 mr-2" value="<?php echo esc_attr( $submit_button_text ); ?>"/>
|
412 |
+
<a href="admin.php?page=es_campaigns" class="cursor-pointer align-middle rounded-md border border-indigo-600 hover:shadow-md focus:outline-none focus:shadow-outline-indigo text-sm leading-5 font-medium transition ease-in-out duration-150 px-4 my-2 py-2 mx-2 "><?php esc_html_e( 'Cancel', 'email-subscribers' ); ?></a></p>
|
413 |
+
</div>
|
414 |
+
|
415 |
+
</form>
|
416 |
+
|
417 |
+
</div>
|
418 |
+
</div>
|
419 |
+
|
420 |
+
<?php
|
421 |
+
|
422 |
+
}
|
423 |
|
424 |
|
425 |
/**
|
429 |
*/
|
430 |
public function get_bulk_actions() {
|
431 |
$actions = array(
|
432 |
+
'bulk_delete' => 'Delete',
|
433 |
);
|
434 |
|
435 |
return $actions;
|
436 |
}
|
437 |
|
438 |
+
public function search_box( $text, $input_id ) {
|
439 |
+
?>
|
440 |
+
<p class="search-box">
|
441 |
+
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_html( $text ); ?>:</label>
|
442 |
+
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>"/>
|
443 |
<?php submit_button( 'Search Notifications', 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
|
444 |
+
</p>
|
445 |
<?php
|
446 |
}
|
447 |
|
lite/includes/classes/class-es-queue.php
CHANGED
@@ -23,7 +23,6 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
23 |
*
|
24 |
* @since 4.2.1
|
25 |
* @var $db
|
26 |
-
*
|
27 |
*/
|
28 |
protected $db;
|
29 |
|
@@ -39,7 +38,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
39 |
add_action( 'plugins_loaded', array( &$this, 'init' ), 1 );
|
40 |
|
41 |
add_action( 'ig_es_before_message_send', array( &$this, 'set_sending_status' ), 10, 3 );
|
42 |
-
//add_action( 'ig_es_email_sending_error', array( &$this, 'set_status_in_queue' ), 10, 4 );
|
43 |
add_action( 'ig_es_message_sent', array( &$this, 'set_sent_status' ), 10, 3 );
|
44 |
add_action( 'ig_es_message_sent', array( &$this, 'update_email_sent_count' ), 10, 3 );
|
45 |
}
|
@@ -90,10 +89,8 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
90 |
|
91 |
$now = time();
|
92 |
|
93 |
-
|
94 |
foreach ( $campaigns as $campaign ) {
|
95 |
|
96 |
-
|
97 |
if ( in_array( $campaign['id'], $campaigns_to_process ) && ! $force ) {
|
98 |
continue;
|
99 |
}
|
@@ -117,7 +114,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
117 |
$start_time = ! empty( $meta['next_run'] ) ? $meta['next_run'] : 0;
|
118 |
|
119 |
if ( ! empty( $start_time ) ) {
|
120 |
-
|
121 |
$meta_data = array();
|
122 |
$scheduled = ! empty( $meta['scheduled'] ) ? $meta['scheduled'] : 0;
|
123 |
$delay = $start_time - $now;
|
@@ -130,42 +127,40 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
130 |
|
131 |
// If current time is within an hour range or has already passed the scheduled time(negative value fot $delay) e.g. for 11 A.M. post digest, do it if current time is between 10 A.M - 11 A.M. or it is after 11 A.M.
|
132 |
if ( $do_it ) {
|
133 |
-
|
134 |
// By default do not schedule
|
135 |
-
if( ! $scheduled ) {
|
136 |
|
137 |
-
$campaign['start_at'] =
|
138 |
|
139 |
$post_ids = array();
|
140 |
-
if( class_exists( 'ES_Post_Digest' ) ) {
|
141 |
$post_ids = ES_Post_Digest::get_post_id_for_post_digest( $campaign_id );
|
142 |
}
|
143 |
-
|
144 |
// Proceed only if we have posts for digest.
|
145 |
-
if( ! empty( $post_ids ) ) {
|
146 |
$list_id = $campaign['list_ids'];
|
147 |
$list_id = explode( ',', $list_id );
|
148 |
-
|
149 |
// Do we have active subscribers?
|
150 |
$contacts = ES()->contacts_db->get_active_contacts_by_list_id( $list_id );
|
151 |
$total_contacts = count( $contacts );
|
152 |
-
|
153 |
if ( $total_contacts > 0 ) {
|
154 |
-
|
155 |
// Create a new mailing queue using this campaign
|
156 |
$result = $this->add_campaign_to_queue( $campaign, $total_contacts );
|
157 |
-
|
158 |
if ( is_array( $result ) ) {
|
159 |
-
|
160 |
$queue_id = $result['id'];
|
161 |
$hash = $result['hash'];
|
162 |
-
|
163 |
$this->add_contacts_to_queue( $campaign_id, $hash, $queue_id, $contacts );
|
164 |
}
|
165 |
-
|
166 |
}
|
167 |
}
|
168 |
-
|
169 |
}
|
170 |
|
171 |
$time_frame = ! empty( $rules['time_frame'] ) ? $rules['time_frame'] : '';
|
@@ -178,7 +173,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
178 |
'time_frame' => $time_frame,
|
179 |
'time_of_day' => $rules['time_of_day'],
|
180 |
'weekdays' => $rules['weekdays'],
|
181 |
-
'force' => true
|
182 |
);
|
183 |
|
184 |
// Get the next run time.
|
@@ -190,7 +185,6 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
190 |
} else {
|
191 |
$meta_data['scheduled'] = 0;
|
192 |
}
|
193 |
-
|
194 |
} else {
|
195 |
$meta_data['scheduled'] = 1;
|
196 |
}
|
@@ -212,7 +206,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
212 |
* @since 4.2.1
|
213 |
*/
|
214 |
public function queue_sequences( $campaign_id = 0, $force = false ) {
|
215 |
-
global $
|
216 |
/**
|
217 |
* Steps
|
218 |
* 1. Fetch all active Sequence Message
|
@@ -236,7 +230,6 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
236 |
return;
|
237 |
}
|
238 |
|
239 |
-
|
240 |
$now = time();
|
241 |
|
242 |
foreach ( $campaigns as $campaign ) {
|
@@ -253,7 +246,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
253 |
|
254 |
$rules = ! empty( $meta['rules'] ) ? $meta['rules'] : array();
|
255 |
|
256 |
-
//ES()->logger->info( 'Rules: ' . print_r( $rules, true ) );
|
257 |
|
258 |
if ( ! empty( $rules ) ) {
|
259 |
|
@@ -277,25 +270,25 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
277 |
$ig_campaign_sent = IG_MESSAGE_SENT;
|
278 |
|
279 |
$query_args = array(
|
280 |
-
|
281 |
-
|
282 |
'join1' => "LEFT JOIN $ig_actions_table AS actions_sent_message ON lists_contacts.contact_id = actions_sent_message.contact_id AND actions_sent_message.type = $ig_campaign_sent AND actions_sent_message.campaign_id IN ($campaign_id)",
|
283 |
'join2' => "LEFT JOIN $ig_queue_table AS queue ON lists_contacts.contact_id = queue.contact_id AND queue.campaign_id IN ($campaign_id)",
|
284 |
'where' => "WHERE 1=1 AND lists_contacts.list_id IN ($list_ids) AND lists_contacts.status = 'subscribed' AND actions_sent_message.contact_id IS NULL AND queue.contact_id IS NULL",
|
285 |
-
'group_by' =>
|
286 |
-
'having' =>
|
287 |
'order_by' => 'ORDER BY timestamp ASC',
|
288 |
);
|
289 |
|
290 |
$query = implode( ' ', $query_args );
|
291 |
|
292 |
-
//ES()->logger->info( '----------------------------Query Args (ig_es_contact_insert) ----------------------------' );
|
293 |
-
//ES()->logger->info( $query );
|
294 |
-
//ES()->logger->info( '----------------------------Query Args Complete (ig_es_contact_insert) ----------------------------' );
|
295 |
|
296 |
-
$results = $
|
297 |
|
298 |
-
//ES()->logger->info( 'Results: ' . print_r( $results, true ) );
|
299 |
|
300 |
if ( ! empty( $results ) ) {
|
301 |
|
@@ -318,14 +311,11 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
318 |
if ( $timestamp - time() <= 0 ) {
|
319 |
wp_schedule_single_event( $timestamp, 'ig_es_cron_worker', array( $campaign_id ) );
|
320 |
}
|
321 |
-
|
322 |
}
|
323 |
}
|
324 |
-
|
325 |
}
|
326 |
}
|
327 |
|
328 |
-
|
329 |
}
|
330 |
|
331 |
/**
|
@@ -362,14 +352,14 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
362 |
'finish_at' => '',
|
363 |
'created_at' => ig_get_current_date_time(),
|
364 |
'updated_at' => ig_get_current_date_time(),
|
365 |
-
'meta' => maybe_serialize( array( 'type' => $campaign['type'] ) )
|
366 |
);
|
367 |
|
368 |
$queue_id = ES_DB_Mailing_Queue::add_notification( $data );
|
369 |
|
370 |
return array(
|
371 |
'hash' => $guid,
|
372 |
-
'id' => $queue_id
|
373 |
);
|
374 |
|
375 |
}
|
@@ -403,13 +393,13 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
403 |
*
|
404 |
* @param $campaign_id
|
405 |
* @param $subscribers
|
406 |
-
* @param null
|
407 |
-
* @param int
|
408 |
-
* @param bool
|
409 |
-
* @param bool
|
410 |
-
* @param bool
|
411 |
-
* @param bool
|
412 |
-
* @param bool
|
413 |
*
|
414 |
* @return bool|void
|
415 |
*
|
@@ -417,7 +407,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
417 |
*/
|
418 |
public function bulk_add( $campaign_id, $subscribers, $timestamp = null, $priority = 10, $clear = false, $ignore_status = false, $reset = false, $options = false, $tags = false ) {
|
419 |
|
420 |
-
global $wpdb;
|
421 |
|
422 |
if ( $clear ) {
|
423 |
$this->clear( $campaign_id, $subscribers );
|
@@ -478,9 +468,9 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
478 |
$sql .= sprintf( ", tags = '%s'", $tags );
|
479 |
}
|
480 |
|
481 |
-
//ES()->logger->info( 'Adding Bulk SQL: ' . $sql );
|
482 |
|
483 |
-
$success = $success && false !== $
|
484 |
|
485 |
}
|
486 |
|
@@ -491,7 +481,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
491 |
/**
|
492 |
* Clear queue which are not assigned to any campaign
|
493 |
*
|
494 |
-
* @param null
|
495 |
* @param array $subscribers
|
496 |
*
|
497 |
* @return bool
|
@@ -500,7 +490,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
500 |
*/
|
501 |
public function clear( $campaign_id = null, $subscribers = array() ) {
|
502 |
|
503 |
-
global $wpdb;
|
504 |
|
505 |
$campaign_id = (int) $campaign_id;
|
506 |
$subscribers = array_filter( $subscribers, 'is_numeric' );
|
@@ -514,7 +504,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
514 |
$sql .= $wpdb->prepare( ' AND queue.campaign_id = %d', $campaign_id );
|
515 |
}
|
516 |
|
517 |
-
return false !== $
|
518 |
|
519 |
}
|
520 |
|
@@ -537,20 +527,32 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
537 |
$ig_queue_table = IG_QUEUE_TABLE;
|
538 |
$ig_campaigns_table = IG_CAMPAIGNS_TABLE;
|
539 |
|
540 |
-
$sql
|
541 |
$sql .= " FROM $ig_queue_table AS queue";
|
542 |
$sql .= " LEFT JOIN $ig_campaigns_table AS campaigns ON campaigns.id = queue.campaign_id";
|
543 |
-
$sql .= ' WHERE queue.timestamp <= ' . (int) $micro_time .
|
544 |
-
$sql .=
|
545 |
$sql .= ' ORDER BY queue.priority DESC';
|
546 |
|
547 |
-
//ES()->logger->info( 'Process Queue:' );
|
548 |
-
//ES()->logger->info( 'SQL: ' . $sql );
|
549 |
-
|
550 |
-
$notifications = $wpdb->get_results(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
551 |
|
552 |
if ( is_array( $notifications ) && count( $notifications ) > 0 ) {
|
553 |
-
$campaigns_notifications =
|
|
|
554 |
foreach ( $notifications as $notification ) {
|
555 |
$campaigns_notifications[ $notification['campaign_id'] ][] = $notification;
|
556 |
|
@@ -591,7 +593,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
591 |
'guid' => $hash,
|
592 |
'dbid' => $contact_id,
|
593 |
'message_id' => 0,
|
594 |
-
'campaign_id' => $campaign_id
|
595 |
);
|
596 |
|
597 |
$result = ES()->mailer->send( $subject, $content, $email, $merge_tags );
|
@@ -603,12 +605,9 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
603 |
}
|
604 |
}
|
605 |
}
|
606 |
-
|
607 |
}
|
608 |
-
|
609 |
}
|
610 |
|
611 |
-
|
612 |
}
|
613 |
|
614 |
/**
|
@@ -618,7 +617,6 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
618 |
*/
|
619 |
public function process_campaigns() {
|
620 |
|
621 |
-
|
622 |
if ( ES()->cron->should_unlock() ) {
|
623 |
ES()->cron->unlock();
|
624 |
}
|
@@ -648,11 +646,11 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
648 |
if ( ! is_null( $notification_guid ) ) {
|
649 |
|
650 |
$campaign_type = '';
|
651 |
-
if( ! empty( $campaign_id ) ) {
|
652 |
$campaign_type = ES()->campaigns_db->get_campaign_type_by_id( $campaign_id );
|
653 |
}
|
654 |
|
655 |
-
if( 'newsletter' === $campaign_type ) {
|
656 |
ES()->campaigns_db->update_status( $campaign_id, IG_ES_CAMPAIGN_STATUS_QUEUED );
|
657 |
}
|
658 |
|
@@ -663,7 +661,8 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
663 |
$total_emails = count( $emails_data );
|
664 |
// Found Subscribers to send notification?
|
665 |
if ( $total_emails > 0 ) {
|
666 |
-
$ids
|
|
|
667 |
foreach ( $emails_data as $email ) {
|
668 |
$ids[] = $email['id'];
|
669 |
$emails[] = $email['email'];
|
@@ -685,14 +684,14 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
685 |
|
686 |
// No emails left for the $notification_guid??? Send admin notification for the
|
687 |
// Completion of a job
|
688 |
-
if (
|
689 |
ES_DB_Mailing_Queue::update_sent_status( $notification_guid, 'Sent' );
|
690 |
|
691 |
-
if( 'newsletter' === $campaign_type ) {
|
692 |
ES()->campaigns_db->update_status( $campaign_id, IG_ES_CAMPAIGN_STATUS_FINISHED );
|
693 |
-
}
|
694 |
$campaign_meta = ES()->campaigns_db->get_campaign_meta_by_id( $campaign_id );
|
695 |
-
if( ! empty( $campaign_meta['post_ids'] ) ) {
|
696 |
// Empty the post ids since they have already been sent in this campaign notification.
|
697 |
$campaign_meta['post_ids'] = array();
|
698 |
ES()->campaigns_db->update_campaign_meta( $campaign_id, $campaign_meta );
|
@@ -703,7 +702,7 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
703 |
ES()->mailer->send_cron_admin_email( $notification_guid );
|
704 |
}
|
705 |
|
706 |
-
//TODO: Implement better solution
|
707 |
set_transient( 'ig_es_total_emails_sent', $total_emails, MINUTE_IN_SECONDS );
|
708 |
set_transient( 'ig_es_remaining_email_count', $remaining_emails_to_be_sent, MINUTE_IN_SECONDS );
|
709 |
|
@@ -793,9 +792,9 @@ if ( ! class_exists( 'ES_Queue' ) ) {
|
|
793 |
/**
|
794 |
* Set status in queue
|
795 |
*
|
796 |
-
* @param int
|
797 |
-
* @param int
|
798 |
-
* @param int
|
799 |
* @param array $response
|
800 |
*
|
801 |
* @since 4.3.3
|
23 |
*
|
24 |
* @since 4.2.1
|
25 |
* @var $db
|
|
|
26 |
*/
|
27 |
protected $db;
|
28 |
|
38 |
add_action( 'plugins_loaded', array( &$this, 'init' ), 1 );
|
39 |
|
40 |
add_action( 'ig_es_before_message_send', array( &$this, 'set_sending_status' ), 10, 3 );
|
41 |
+
// add_action( 'ig_es_email_sending_error', array( &$this, 'set_status_in_queue' ), 10, 4 );
|
42 |
add_action( 'ig_es_message_sent', array( &$this, 'set_sent_status' ), 10, 3 );
|
43 |
add_action( 'ig_es_message_sent', array( &$this, 'update_email_sent_count' ), 10, 3 );
|
44 |
}
|
89 |
|
90 |
$now = time();
|
91 |
|
|
|
92 |
foreach ( $campaigns as $campaign ) {
|
93 |
|
|
|
94 |
if ( in_array( $campaign['id'], $campaigns_to_process ) && ! $force ) {
|
95 |
continue;
|
96 |
}
|
114 |
$start_time = ! empty( $meta['next_run'] ) ? $meta['next_run'] : 0;
|
115 |
|
116 |
if ( ! empty( $start_time ) ) {
|
117 |
+
|
118 |
$meta_data = array();
|
119 |
$scheduled = ! empty( $meta['scheduled'] ) ? $meta['scheduled'] : 0;
|
120 |
$delay = $start_time - $now;
|
127 |
|
128 |
// If current time is within an hour range or has already passed the scheduled time(negative value fot $delay) e.g. for 11 A.M. post digest, do it if current time is between 10 A.M - 11 A.M. or it is after 11 A.M.
|
129 |
if ( $do_it ) {
|
130 |
+
|
131 |
// By default do not schedule
|
132 |
+
if ( ! $scheduled ) {
|
133 |
|
134 |
+
$campaign['start_at'] = gmdate( 'Y-m-d H:i:s', $start_time );
|
135 |
|
136 |
$post_ids = array();
|
137 |
+
if ( class_exists( 'ES_Post_Digest' ) ) {
|
138 |
$post_ids = ES_Post_Digest::get_post_id_for_post_digest( $campaign_id );
|
139 |
}
|
140 |
+
|
141 |
// Proceed only if we have posts for digest.
|
142 |
+
if ( ! empty( $post_ids ) ) {
|
143 |
$list_id = $campaign['list_ids'];
|
144 |
$list_id = explode( ',', $list_id );
|
145 |
+
|
146 |
// Do we have active subscribers?
|
147 |
$contacts = ES()->contacts_db->get_active_contacts_by_list_id( $list_id );
|
148 |
$total_contacts = count( $contacts );
|
149 |
+
|
150 |
if ( $total_contacts > 0 ) {
|
151 |
+
|
152 |
// Create a new mailing queue using this campaign
|
153 |
$result = $this->add_campaign_to_queue( $campaign, $total_contacts );
|
154 |
+
|
155 |
if ( is_array( $result ) ) {
|
156 |
+
|
157 |
$queue_id = $result['id'];
|
158 |
$hash = $result['hash'];
|
159 |
+
|
160 |
$this->add_contacts_to_queue( $campaign_id, $hash, $queue_id, $contacts );
|
161 |
}
|
|
|
162 |
}
|
163 |
}
|
|
|
164 |
}
|
165 |
|
166 |
$time_frame = ! empty( $rules['time_frame'] ) ? $rules['time_frame'] : '';
|
173 |
'time_frame' => $time_frame,
|
174 |
'time_of_day' => $rules['time_of_day'],
|
175 |
'weekdays' => $rules['weekdays'],
|
176 |
+
'force' => true,
|
177 |
);
|
178 |
|
179 |
// Get the next run time.
|
185 |
} else {
|
186 |
$meta_data['scheduled'] = 0;
|
187 |
}
|
|
|
188 |
} else {
|
189 |
$meta_data['scheduled'] = 1;
|
190 |
}
|
206 |
* @since 4.2.1
|
207 |
*/
|
208 |
public function queue_sequences( $campaign_id = 0, $force = false ) {
|
209 |
+
global $wpbd;
|
210 |
/**
|
211 |
* Steps
|
212 |
* 1. Fetch all active Sequence Message
|
230 |
return;
|
231 |
}
|
232 |
|
|
|
233 |
$now = time();
|
234 |
|
235 |
foreach ( $campaigns as $campaign ) {
|
246 |
|
247 |
$rules = ! empty( $meta['rules'] ) ? $meta['rules'] : array();
|
248 |
|
249 |
+
// ES()->logger->info( 'Rules: ' . print_r( $rules, true ) );
|
250 |
|
251 |
if ( ! empty( $rules ) ) {
|
252 |
|
270 |
$ig_campaign_sent = IG_MESSAGE_SENT;
|
271 |
|
272 |
$query_args = array(
|
273 |
+
'select' => "SELECT lists_contacts.contact_id, UNIX_TIMESTAMP ( lists_contacts.subscribed_at + INTERVAL $offset ) AS timestamp",
|
274 |
+
'from' => "FROM $ig_lists_contacts_table AS lists_contacts",
|
275 |
'join1' => "LEFT JOIN $ig_actions_table AS actions_sent_message ON lists_contacts.contact_id = actions_sent_message.contact_id AND actions_sent_message.type = $ig_campaign_sent AND actions_sent_message.campaign_id IN ($campaign_id)",
|
276 |
'join2' => "LEFT JOIN $ig_queue_table AS queue ON lists_contacts.contact_id = queue.contact_id AND queue.campaign_id IN ($campaign_id)",
|
277 |
'where' => "WHERE 1=1 AND lists_contacts.list_id IN ($list_ids) AND lists_contacts.status = 'subscribed' AND actions_sent_message.contact_id IS NULL AND queue.contact_id IS NULL",
|
278 |
+
'group_by' => 'GROUP BY lists_contacts.contact_id',
|
279 |
+
'having' => 'HAVING timestamp <= ' . ( $now + $queue_upfront ) . ' AND timestamp >= ' . ( $now - $grace_period ),
|
280 |
'order_by' => 'ORDER BY timestamp ASC',
|
281 |
);
|
282 |
|
283 |
$query = implode( ' ', $query_args );
|
284 |
|
285 |
+
// ES()->logger->info( '----------------------------Query Args (ig_es_contact_insert) ----------------------------' );
|
286 |
+
// ES()->logger->info( $query );
|
287 |
+
// ES()->logger->info( '----------------------------Query Args Complete (ig_es_contact_insert) ----------------------------' );
|
288 |
|
289 |
+
$results = $wpbd->get_results( $query, ARRAY_A );
|
290 |
|
291 |
+
// ES()->logger->info( 'Results: ' . print_r( $results, true ) );
|
292 |
|
293 |
if ( ! empty( $results ) ) {
|
294 |
|
311 |
if ( $timestamp - time() <= 0 ) {
|
312 |
wp_schedule_single_event( $timestamp, 'ig_es_cron_worker', array( $campaign_id ) );
|
313 |
}
|
|
|
314 |
}
|
315 |
}
|
|
|
316 |
}
|
317 |
}
|
318 |
|
|
|
319 |
}
|
320 |
|
321 |
/**
|
352 |
'finish_at' => '',
|
353 |
'created_at' => ig_get_current_date_time(),
|
354 |
'updated_at' => ig_get_current_date_time(),
|
355 |
+
'meta' => maybe_serialize( array( 'type' => $campaign['type'] ) ),
|
356 |
);
|
357 |
|
358 |
$queue_id = ES_DB_Mailing_Queue::add_notification( $data );
|
359 |
|
360 |
return array(
|
361 |
'hash' => $guid,
|
362 |
+
'id' => $queue_id,
|
363 |
);
|
364 |
|
365 |
}
|
393 |
*
|
394 |
* @param $campaign_id
|
395 |
* @param $subscribers
|
396 |
+
* @param null $timestamp
|
397 |
+
* @param int $priority
|
398 |
+
* @param bool $clear
|
399 |
+
* @param bool $ignore_status
|
400 |
+
* @param bool $reset
|
401 |
+
* @param bool $options
|
402 |
+
* @param bool $tags
|
403 |
*
|
404 |
* @return bool|void
|
405 |
*
|
407 |
*/
|
408 |
public function bulk_add( $campaign_id, $subscribers, $timestamp = null, $priority = 10, $clear = false, $ignore_status = false, $reset = false, $options = false, $tags = false ) {
|
409 |
|
410 |
+
global $wpdb, $wpbd;
|
411 |
|
412 |
if ( $clear ) {
|
413 |
$this->clear( $campaign_id, $subscribers );
|
468 |
$sql .= sprintf( ", tags = '%s'", $tags );
|
469 |
}
|
470 |
|
471 |
+
// ES()->logger->info( 'Adding Bulk SQL: ' . $sql );
|
472 |
|
473 |
+
$success = $success && false !== $wpbd->query( $sql );
|
474 |
|
475 |
}
|
476 |
|
481 |
/**
|
482 |
* Clear queue which are not assigned to any campaign
|
483 |
*
|
484 |
+
* @param null $campaign_id
|
485 |
* @param array $subscribers
|
486 |
*
|
487 |
* @return bool
|
490 |
*/
|
491 |
public function clear( $campaign_id = null, $subscribers = array() ) {
|
492 |
|
493 |
+
global $wpdb, $wpbd;
|
494 |
|
495 |
$campaign_id = (int) $campaign_id;
|
496 |
$subscribers = array_filter( $subscribers, 'is_numeric' );
|
504 |
$sql .= $wpdb->prepare( ' AND queue.campaign_id = %d', $campaign_id );
|
505 |
}
|
506 |
|
507 |
+
return false !== $wpbd->query( $sql );
|
508 |
|
509 |
}
|
510 |
|
527 |
$ig_queue_table = IG_QUEUE_TABLE;
|
528 |
$ig_campaigns_table = IG_CAMPAIGNS_TABLE;
|
529 |
|
530 |
+
$sql = 'SELECT queue.campaign_id, queue.contact_id, queue.count AS _count, queue.requeued AS _requeued, queue.options AS _options, queue.tags AS _tags, queue.priority AS _priority';
|
531 |
$sql .= " FROM $ig_queue_table AS queue";
|
532 |
$sql .= " LEFT JOIN $ig_campaigns_table AS campaigns ON campaigns.id = queue.campaign_id";
|
533 |
+
$sql .= ' WHERE queue.timestamp <= ' . (int) $micro_time . ' AND queue.sent_at = 0';
|
534 |
+
$sql .= ' AND (campaigns.status = 1)';
|
535 |
$sql .= ' ORDER BY queue.priority DESC';
|
536 |
|
537 |
+
// ES()->logger->info( 'Process Queue:' );
|
538 |
+
// ES()->logger->info( 'SQL: ' . $sql );
|
539 |
+
|
540 |
+
$notifications = $wpdb->get_results(
|
541 |
+
$wpdb->prepare(
|
542 |
+
"SELECT queue.campaign_id, queue.contact_id, queue.count AS _count, queue.requeued AS _requeued, queue.options AS _options, queue.tags AS _tags, queue.priority AS _priority
|
543 |
+
FROM {$wpdb->prefix}ig_queue AS queue
|
544 |
+
LEFT JOIN {$wpdb->prefix}ig_campaigns AS campaigns ON campaigns.id = queue.campaign_id
|
545 |
+
WHERE queue.timestamp <= %d AND queue.sent_at = 0
|
546 |
+
AND (campaigns.status = 1)
|
547 |
+
ORDER BY queue.priority DESC",
|
548 |
+
(int) $micro_time
|
549 |
+
),
|
550 |
+
ARRAY_A
|
551 |
+
);
|
552 |
|
553 |
if ( is_array( $notifications ) && count( $notifications ) > 0 ) {
|
554 |
+
$campaigns_notifications = array();
|
555 |
+
$contact_ids = array();
|
556 |
foreach ( $notifications as $notification ) {
|
557 |
$campaigns_notifications[ $notification['campaign_id'] ][] = $notification;
|
558 |
|
593 |
'guid' => $hash,
|
594 |
'dbid' => $contact_id,
|
595 |
'message_id' => 0,
|
596 |
+
'campaign_id' => $campaign_id,
|
597 |
);
|
598 |
|
599 |
$result = ES()->mailer->send( $subject, $content, $email, $merge_tags );
|
605 |
}
|
606 |
}
|
607 |
}
|
|
|
608 |
}
|
|
|
609 |
}
|
610 |
|
|
|
611 |
}
|
612 |
|
613 |
/**
|
617 |
*/
|
618 |
public function process_campaigns() {
|
619 |
|
|
|
620 |
if ( ES()->cron->should_unlock() ) {
|
621 |
ES()->cron->unlock();
|
622 |
}
|
646 |
if ( ! is_null( $notification_guid ) ) {
|
647 |
|
648 |
$campaign_type = '';
|
649 |
+
if ( ! empty( $campaign_id ) ) {
|
650 |
$campaign_type = ES()->campaigns_db->get_campaign_type_by_id( $campaign_id );
|
651 |
}
|
652 |
|
653 |
+
if ( 'newsletter' === $campaign_type ) {
|
654 |
ES()->campaigns_db->update_status( $campaign_id, IG_ES_CAMPAIGN_STATUS_QUEUED );
|
655 |
}
|
656 |
|
661 |
$total_emails = count( $emails_data );
|
662 |
// Found Subscribers to send notification?
|
663 |
if ( $total_emails > 0 ) {
|
664 |
+
$ids = array();
|
665 |
+
$emails = array();
|
666 |
foreach ( $emails_data as $email ) {
|
667 |
$ids[] = $email['id'];
|
668 |
$emails[] = $email['email'];
|
684 |
|
685 |
// No emails left for the $notification_guid??? Send admin notification for the
|
686 |
// Completion of a job
|
687 |
+
if ( 0 == $total_remaining_emails ) {
|
688 |
ES_DB_Mailing_Queue::update_sent_status( $notification_guid, 'Sent' );
|
689 |
|
690 |
+
if ( 'newsletter' === $campaign_type ) {
|
691 |
ES()->campaigns_db->update_status( $campaign_id, IG_ES_CAMPAIGN_STATUS_FINISHED );
|
692 |
+
} elseif ( 'post_digest' === $campaign_type ) {
|
693 |
$campaign_meta = ES()->campaigns_db->get_campaign_meta_by_id( $campaign_id );
|
694 |
+
if ( ! empty( $campaign_meta['post_ids'] ) ) {
|
695 |
// Empty the post ids since they have already been sent in this campaign notification.
|
696 |
$campaign_meta['post_ids'] = array();
|
697 |
ES()->campaigns_db->update_campaign_meta( $campaign_id, $campaign_meta );
|
702 |
ES()->mailer->send_cron_admin_email( $notification_guid );
|
703 |
}
|
704 |
|
705 |
+
// TODO: Implement better solution
|
706 |
set_transient( 'ig_es_total_emails_sent', $total_emails, MINUTE_IN_SECONDS );
|
707 |
set_transient( 'ig_es_remaining_email_count', $remaining_emails_to_be_sent, MINUTE_IN_SECONDS );
|
708 |
|
792 |
/**
|
793 |
* Set status in queue
|
794 |
*
|
795 |
+
* @param int $contact_id
|
796 |
+
* @param int $campaign_id
|
797 |
+
* @param int $message_id
|
798 |
* @param array $response
|
799 |
*
|
800 |
* @since 4.3.3
|
lite/includes/classes/class-es-reports-data.php
CHANGED
@@ -104,8 +104,6 @@ if ( ! class_exists( 'ES_Reports_Data' ) ) {
|
|
104 |
* @param int $days
|
105 |
*
|
106 |
* @return int
|
107 |
-
*
|
108 |
-
*
|
109 |
*/
|
110 |
public static function get_total_contact_lost( $days = 60, $distinct = true ) {
|
111 |
return ES()->actions_db->get_total_contact_lost( $days, $distinct );
|
@@ -128,7 +126,7 @@ if ( ! class_exists( 'ES_Reports_Data' ) ) {
|
|
128 |
|
129 |
$data = array();
|
130 |
for ( $i = $days; $i >= 0; $i -- ) {
|
131 |
-
$date =
|
132 |
|
133 |
$count = isset( $contacts[ $date ] ) ? $contacts[ $date ] : 0;
|
134 |
|
@@ -179,17 +177,19 @@ if ( ! class_exists( 'ES_Reports_Data' ) ) {
|
|
179 |
$total_links_clicks = self::get_total_contacts_clicks_links( 60, false );
|
180 |
$total_message_sent = self::get_total_emails_sent( 60, false );
|
181 |
$total_contact_lost = self::get_total_contact_lost( 60, false );
|
182 |
-
|
183 |
$contacts_growth = self::get_contacts_growth();
|
184 |
|
185 |
-
$total_open_rate
|
|
|
|
|
186 |
if ( $total_message_sent > 0 ) {
|
187 |
$total_open_rate = ( $total_email_opens ) / $total_message_sent;
|
188 |
$total_click_rate = ( $total_links_clicks ) / $total_message_sent;
|
189 |
$total_lost_rate = ( $total_contact_lost ) / $total_message_sent;
|
190 |
}
|
191 |
|
192 |
-
$avg_open_rate
|
|
|
193 |
if ( $total_message_sent > 0 ) {
|
194 |
$avg_open_rate = ( $total_email_opens * 100 ) / $total_message_sent;
|
195 |
$avg_click_rate = ( $total_links_clicks * 100 ) / $total_message_sent;
|
@@ -219,7 +219,7 @@ if ( ! class_exists( 'ES_Reports_Data' ) ) {
|
|
219 |
'total_open_rate' => number_format( $total_open_rate, 2 ),
|
220 |
'total_click_rate' => $total_click_rate,
|
221 |
'total_lost_rate' => $total_lost_rate,
|
222 |
-
'contacts_growth' => $contacts_growth
|
223 |
);
|
224 |
|
225 |
$data = array_merge( $data, $reports_data );
|
104 |
* @param int $days
|
105 |
*
|
106 |
* @return int
|
|
|
|
|
107 |
*/
|
108 |
public static function get_total_contact_lost( $days = 60, $distinct = true ) {
|
109 |
return ES()->actions_db->get_total_contact_lost( $days, $distinct );
|
126 |
|
127 |
$data = array();
|
128 |
for ( $i = $days; $i >= 0; $i -- ) {
|
129 |
+
$date = gmdate( 'Y-m-d', strtotime( '-' . $i . ' days' ) );
|
130 |
|
131 |
$count = isset( $contacts[ $date ] ) ? $contacts[ $date ] : 0;
|
132 |
|
177 |
$total_links_clicks = self::get_total_contacts_clicks_links( 60, false );
|
178 |
$total_message_sent = self::get_total_emails_sent( 60, false );
|
179 |
$total_contact_lost = self::get_total_contact_lost( 60, false );
|
|
|
180 |
$contacts_growth = self::get_contacts_growth();
|
181 |
|
182 |
+
$total_open_rate = 0;
|
183 |
+
$total_click_rate = 0;
|
184 |
+
$total_lost_rate = 0;
|
185 |
if ( $total_message_sent > 0 ) {
|
186 |
$total_open_rate = ( $total_email_opens ) / $total_message_sent;
|
187 |
$total_click_rate = ( $total_links_clicks ) / $total_message_sent;
|
188 |
$total_lost_rate = ( $total_contact_lost ) / $total_message_sent;
|
189 |
}
|
190 |
|
191 |
+
$avg_open_rate = 0;
|
192 |
+
$avg_click_rate = 0;
|
193 |
if ( $total_message_sent > 0 ) {
|
194 |
$avg_open_rate = ( $total_email_opens * 100 ) / $total_message_sent;
|
195 |
$avg_click_rate = ( $total_links_clicks * 100 ) / $total_message_sent;
|
219 |
'total_open_rate' => number_format( $total_open_rate, 2 ),
|
220 |
'total_click_rate' => $total_click_rate,
|
221 |
'total_lost_rate' => $total_lost_rate,
|
222 |
+
'contacts_growth' => $contacts_growth,
|
223 |
);
|
224 |
|
225 |
$data = array_merge( $data, $reports_data );
|
lite/includes/classes/class-es-reports-table.php
CHANGED
@@ -7,82 +7,86 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
|
9 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
10 |
-
require_once
|
11 |
}
|
12 |
|
13 |
class ES_Reports_Table extends WP_List_Table {
|
14 |
|
15 |
-
static $instance;
|
16 |
|
17 |
public function __construct() {
|
18 |
|
19 |
-
parent::__construct(
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
25 |
|
26 |
}
|
27 |
|
28 |
public function es_reports_callback() {
|
29 |
|
30 |
$campaign_id = ig_es_get_request_data( 'campaign_id' );
|
31 |
-
$campaign_type =
|
32 |
//Since, currently we are not passing campaign_id with broadcast $campaign_type will remain empty for broadcast
|
33 |
if ( ! empty ( $campaign_id ) ) {
|
34 |
$campaign_type = ES()->campaigns_db->get_campaign_type_by_id( $campaign_id );
|
35 |
}
|
36 |
|
37 |
-
$campaign_types
|
38 |
//Only if it is sequence then control will transfer to Sequence Reports class.
|
39 |
-
if( ! empty ( $campaign_type ) && in_array( $campaign_type, $campaign_types ) ){
|
40 |
-
|
41 |
$reports = ES_Pro_Sequence_Reports::get_instance();
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
} else {
|
48 |
$action = ig_es_get_request_data( 'action' );
|
49 |
if ( 'view' === $action ) {
|
50 |
$list = ig_es_get_request_data( 'list' );
|
51 |
$this->view_list( $list );
|
52 |
} else {
|
53 |
?>
|
54 |
-
|
55 |
-
|
56 |
<?php
|
57 |
$emails_to_be_sent = ES_DB_Sending_Queue::get_total_emails_to_be_sent();
|
58 |
if ( $emails_to_be_sent > 0 ) {
|
59 |
$cron_url = ES()->cron->url( true );
|
60 |
-
|
|
|
61 |
} else {
|
62 |
-
$content
|
63 |
$content .= sprintf( __( "<br /><span class='es-helper'>No emails found in queue</span>", 'email-subscribers' ) );
|
64 |
}
|
65 |
?>
|
66 |
|
67 |
-
|
68 |
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
<?php
|
76 |
$this->prepare_items();
|
77 |
-
$this->display();
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
86 |
}
|
87 |
}
|
88 |
|
@@ -92,7 +96,7 @@ class ES_Reports_Table extends WP_List_Table {
|
|
92 |
$args = array(
|
93 |
'label' => __( 'Reports', 'email-subscribers' ),
|
94 |
'default' => 10,
|
95 |
-
'option' => 'reports_per_page'
|
96 |
);
|
97 |
|
98 |
add_screen_option( $option, $args );
|
@@ -102,14 +106,14 @@ class ES_Reports_Table extends WP_List_Table {
|
|
102 |
public function prepare_header_footer_row() {
|
103 |
|
104 |
?>
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
|
114 |
<?php
|
115 |
}
|
@@ -119,6 +123,7 @@ class ES_Reports_Table extends WP_List_Table {
|
|
119 |
$email_viewed_count = ES_DB_Sending_Queue::get_viewed_count_by_hash( $id );
|
120 |
$total_email_sent = ES_DB_Sending_Queue::get_total_email_count_by_hash( $id );
|
121 |
|
|
|
122 |
$insight = ig_es_get_request_data( 'insight', '' );
|
123 |
$_wpnonce = ig_es_get_request_data( '_wpnonce', '' );
|
124 |
|
@@ -126,44 +131,43 @@ class ES_Reports_Table extends WP_List_Table {
|
|
126 |
do_action( 'ig_es_view_report_data', $id, $emails );
|
127 |
}
|
128 |
?>
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
|
134 |
<?php if ( ! ES()->is_pro() && ! $insight ) { ?>
|
135 |
-
|
136 |
<?php } ?>
|
137 |
-
|
138 |
-
|
139 |
|
140 |
-
|
141 |
-
<span class="pt-3 pb-4 leading-5 tracking-wide text-gray-600"><?php echo 'Viewed ' . $email_viewed_count . '/' . $total_email_sent; ?>
|
142 |
</span>
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
<?php echo $this->prepare_header_footer_row(); ?>
|
152 |
-
|
153 |
-
|
154 |
-
<?php echo $this->prepare_body( $emails ); ?>
|
155 |
-
|
156 |
-
|
157 |
-
<?php echo $this->prepare_header_footer_row(); ?>
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
<?php
|
165 |
-
|
166 |
-
|
167 |
}
|
168 |
|
169 |
|
@@ -172,26 +176,31 @@ class ES_Reports_Table extends WP_List_Table {
|
|
172 |
$i = 1;
|
173 |
foreach ( $emails as $key => $email ) {
|
174 |
$class = '';
|
175 |
-
if ( $i % 2
|
176 |
$class = 'alternate';
|
177 |
}
|
178 |
|
179 |
$email_id = ! empty( $email['email'] ) ? $email['email'] : ( ! empty( $email['es_deliver_emailmail'] ) ? $email['es_deliver_emailmail'] : '' );
|
180 |
$status = ! empty( $email['status'] ) ? $email['status'] : ( ! empty( $email['es_deliver_sentstatus'] ) ? $email['es_deliver_sentstatus'] : '' );
|
181 |
$sent_at = ! empty( $email['sent_at'] ) ? $email['sent_at'] : ( ! empty( $email['es_deliver_sentdate'] ) ? $email['es_deliver_sentdate'] : '' );
|
182 |
-
$opened = ! empty( $email['opened'] ) ? $email['opened'] : ( ! empty( $email['es_deliver_status'] ) && $email['es_deliver_status']
|
183 |
$opened_at = ! empty( $email['opened_at'] ) ? $email['opened_at'] : ( ! empty( $email['es_deliver_viewdate'] ) ? $email['es_deliver_viewdate'] : '' );
|
184 |
|
185 |
?>
|
186 |
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
<?php
|
197 |
$i ++;
|
@@ -202,13 +211,13 @@ class ES_Reports_Table extends WP_List_Table {
|
|
202 |
|
203 |
/** Text displayed when no list data is available */
|
204 |
public function no_items() {
|
205 |
-
|
206 |
}
|
207 |
|
208 |
/**
|
209 |
* Render a column when no column specific method exist.
|
210 |
*
|
211 |
-
* @param array
|
212 |
* @param string $column_name
|
213 |
*
|
214 |
* @return mixed
|
@@ -234,21 +243,21 @@ class ES_Reports_Table extends WP_List_Table {
|
|
234 |
return $type;
|
235 |
case 'subject':
|
236 |
// case 'type':
|
237 |
-
//
|
238 |
case 'count':
|
239 |
return $item[ $column_name ];
|
240 |
default:
|
241 |
-
return print_r( $item, true ); //Show the whole array for troubleshooting purposes
|
242 |
}
|
243 |
}
|
244 |
|
245 |
-
function column_status( $item ) {
|
246 |
-
if ( $item['status']
|
247 |
return __( 'Completed', 'email-subscribers' );
|
248 |
} else {
|
249 |
|
250 |
$actions = array(
|
251 |
-
'send_now' => $this->prepare_send_now_url( $item )
|
252 |
);
|
253 |
|
254 |
return $item['status'] . $this->row_actions( $actions, true );
|
@@ -262,9 +271,10 @@ class ES_Reports_Table extends WP_List_Table {
|
|
262 |
*
|
263 |
* @return string
|
264 |
*/
|
265 |
-
function column_cb( $item ) {
|
266 |
return sprintf(
|
267 |
-
'<input type="checkbox" name="bulk_delete[]" value="%s" />',
|
|
|
268 |
);
|
269 |
}
|
270 |
|
@@ -276,7 +286,7 @@ class ES_Reports_Table extends WP_List_Table {
|
|
276 |
*
|
277 |
* @return string
|
278 |
*/
|
279 |
-
function column_subject( $item ) {
|
280 |
|
281 |
$es_nonce = wp_create_nonce( 'es_notification' );
|
282 |
$page = ig_es_get_request_data( 'page' );
|
@@ -286,7 +296,7 @@ class ES_Reports_Table extends WP_List_Table {
|
|
286 |
$actions = array(
|
287 |
'view' => sprintf( '<a href="?page=%s&action=%s&list=%s&_wpnonce=%s" class="text-indigo-600">%s</a>', esc_attr( $page ), 'view', $item['hash'], $es_nonce, __( 'View', 'email-subscribers' ) ),
|
288 |
'delete' => sprintf( '<a href="?page=%s&action=%s&list=%s&_wpnonce=%s">%s</a>', esc_attr( $page ), 'delete', absint( $item['id'] ), $es_nonce, __( 'Delete', 'email-subscribers' ) ),
|
289 |
-
'preview_email' => sprintf( '<a target="_blank" href="?page=%s&action=%s&list=%s&_wpnonce=%s" class="text-indigo-600">%s</a>', esc_attr( $page ), 'preview', absint( $item['id'] ), $es_nonce, __( 'Preview', 'email-subscribers' ) )
|
290 |
|
291 |
);
|
292 |
|
@@ -299,7 +309,7 @@ class ES_Reports_Table extends WP_List_Table {
|
|
299 |
*
|
300 |
* @return array
|
301 |
*/
|
302 |
-
function get_columns() {
|
303 |
$columns = array(
|
304 |
'cb' => '<input type="checkbox" />',
|
305 |
'subject' => __( 'Subject', 'email-subscribers' ),
|
@@ -313,13 +323,14 @@ class ES_Reports_Table extends WP_List_Table {
|
|
313 |
return $columns;
|
314 |
}
|
315 |
|
316 |
-
function column_count( $item ) {
|
317 |
|
318 |
$campaign_hash = $item['hash'];
|
319 |
|
320 |
-
$total_emails_sent
|
|
|
321 |
// if ( ! empty( $campaign_hash ) ) {
|
322 |
-
//
|
323 |
// }
|
324 |
|
325 |
// $content = $total_emails_sent . "/" . $total_emails_to_be_sent;
|
@@ -328,7 +339,7 @@ class ES_Reports_Table extends WP_List_Table {
|
|
328 |
|
329 |
}
|
330 |
|
331 |
-
function prepare_send_now_url( $item ) {
|
332 |
$campaign_hash = $item['hash'];
|
333 |
|
334 |
$cron_url = '';
|
@@ -336,9 +347,9 @@ class ES_Reports_Table extends WP_List_Table {
|
|
336 |
$cron_url = ES()->cron->url( true, false, $campaign_hash );
|
337 |
}
|
338 |
|
339 |
-
|
340 |
$content = '';
|
341 |
if ( ! empty( $cron_url ) ) {
|
|
|
342 |
$content = __( sprintf( "<a href='%s' target='_blank'>Send</a>", $cron_url ), 'email-subscribers' );
|
343 |
}
|
344 |
|
@@ -356,7 +367,7 @@ class ES_Reports_Table extends WP_List_Table {
|
|
356 |
'status' => array( 'status', true ),
|
357 |
'start_at' => array( 'start_at', true ),
|
358 |
'finish_at' => array( 'finish_at', true ),
|
359 |
-
'count' => array( 'count', true )
|
360 |
);
|
361 |
|
362 |
return $sortable_columns;
|
@@ -369,7 +380,7 @@ class ES_Reports_Table extends WP_List_Table {
|
|
369 |
*/
|
370 |
public function get_bulk_actions() {
|
371 |
$actions = array(
|
372 |
-
'bulk_delete' => __( 'Delete', 'email-subscribers' )
|
373 |
);
|
374 |
|
375 |
return $actions;
|
@@ -390,16 +401,18 @@ class ES_Reports_Table extends WP_List_Table {
|
|
390 |
$current_page = $this->get_pagenum();
|
391 |
$total_items = $this->get_notifications( 0, 0, true );
|
392 |
|
393 |
-
$this->set_pagination_args(
|
394 |
-
|
395 |
-
|
396 |
-
|
|
|
|
|
397 |
|
398 |
$this->items = $this->get_notifications( $per_page, $current_page, false );
|
399 |
}
|
400 |
|
401 |
public function get_notifications( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
402 |
-
global $
|
403 |
|
404 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
405 |
$order = ig_es_get_request_data( 'order' );
|
@@ -417,14 +430,14 @@ class ES_Reports_Table extends WP_List_Table {
|
|
417 |
$where_args = array();
|
418 |
|
419 |
if ( ! empty( $campaign_id ) && is_numeric( $campaign_id ) ) {
|
420 |
-
$where_columns[] =
|
421 |
$where_args[] = $campaign_id;
|
422 |
}
|
423 |
|
424 |
$where_query = '';
|
425 |
if ( ! empty( $where_columns ) ) {
|
426 |
-
$where_query = implode(
|
427 |
-
$where_query = $
|
428 |
}
|
429 |
|
430 |
if ( ! empty( $where_query ) ) {
|
@@ -452,21 +465,21 @@ class ES_Reports_Table extends WP_List_Table {
|
|
452 |
$order_by_clause = " ORDER BY {$order_by} {$order}, {$default_order_by} DESC";
|
453 |
}
|
454 |
|
455 |
-
$sql
|
456 |
-
$sql
|
457 |
-
$sql
|
458 |
-
$result = $
|
459 |
|
460 |
} else {
|
461 |
-
$result = $
|
462 |
}
|
463 |
|
464 |
return $result;
|
465 |
}
|
466 |
|
467 |
public function process_bulk_action() {
|
468 |
-
|
469 |
-
//Detect when a bulk action is being triggered...
|
470 |
if ( 'view' === $this->current_action() ) {
|
471 |
|
472 |
// In our file that handles the request, verify the nonce.
|
@@ -478,7 +491,6 @@ class ES_Reports_Table extends WP_List_Table {
|
|
478 |
} else {
|
479 |
$this->view_list( ig_es_get_request_data( 'list' ) );
|
480 |
}
|
481 |
-
|
482 |
} elseif ( 'delete' === $this->current_action() ) {
|
483 |
|
484 |
// In our file that handles the request, verify the nonce.
|
@@ -494,7 +506,6 @@ class ES_Reports_Table extends WP_List_Table {
|
|
494 |
$message = __( 'Report has been deleted successfully!', 'email-subscribers' );
|
495 |
ES_Common::show_message( $message, 'success' );
|
496 |
}
|
497 |
-
|
498 |
} elseif ( 'preview' === $this->current_action() ) {
|
499 |
// In our file that handles the request, verify the nonce.
|
500 |
$nonce = ig_es_get_request_data( '_wpnonce' );
|
@@ -504,7 +515,7 @@ class ES_Reports_Table extends WP_List_Table {
|
|
504 |
ES_Common::show_message( $message, 'error' );
|
505 |
} else {
|
506 |
$report_id = ig_es_get_request_data( 'list' );
|
507 |
-
echo $this->preview_email( $report_id );
|
508 |
die();
|
509 |
}
|
510 |
}
|
@@ -521,40 +532,41 @@ class ES_Reports_Table extends WP_List_Table {
|
|
521 |
$message = __( 'Reports have been deleted successfully!', 'email-subscribers' );
|
522 |
ES_Common::show_message( $message, 'success' );
|
523 |
}
|
524 |
-
|
525 |
}
|
526 |
}
|
527 |
|
528 |
public function preview_email( $report_id ) {
|
529 |
ob_start();
|
|
|
|
|
530 |
?>
|
531 |
-
|
532 |
-
|
533 |
-
<?php
|
534 |
-
|
535 |
-
|
536 |
-
<?php echo
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
<?php
|
541 |
$preview = array();
|
542 |
$preview = ES_DB_Mailing_Queue::get_email_by_id( $report_id );
|
543 |
|
544 |
$es_email_type = get_option( 'ig_es_email_type' ); // Not the ideal way. Email type can differ while previewing sent email.
|
545 |
|
546 |
-
if (
|
547 |
$preview['body'] = ES_Common::es_process_template_body( $preview['body'] );
|
548 |
} else {
|
549 |
-
$preview['body'] = str_replace(
|
550 |
-
$preview['body'] = str_replace(
|
551 |
}
|
552 |
|
553 |
-
echo stripslashes( $preview['body'] );
|
554 |
?>
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
<?php
|
559 |
$html = ob_get_clean();
|
560 |
|
@@ -569,4 +581,4 @@ class ES_Reports_Table extends WP_List_Table {
|
|
569 |
|
570 |
return self::$instance;
|
571 |
}
|
572 |
-
}
|
7 |
|
8 |
|
9 |
if ( ! class_exists( 'WP_List_Table' ) ) {
|
10 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
11 |
}
|
12 |
|
13 |
class ES_Reports_Table extends WP_List_Table {
|
14 |
|
15 |
+
public static $instance;
|
16 |
|
17 |
public function __construct() {
|
18 |
|
19 |
+
parent::__construct(
|
20 |
+
array(
|
21 |
+
'singular' => __( 'Report', 'email-subscribers' ), // singular name of the listed records
|
22 |
+
'plural' => __( 'Reports', 'email-subscribers' ), // plural name of the listed records
|
23 |
+
'ajax' => false, // does this table support ajax?,
|
24 |
+
'screen' => 'es_reports',
|
25 |
+
)
|
26 |
+
);
|
27 |
|
28 |
}
|
29 |
|
30 |
public function es_reports_callback() {
|
31 |
|
32 |
$campaign_id = ig_es_get_request_data( 'campaign_id' );
|
33 |
+
$campaign_type = '';
|
34 |
//Since, currently we are not passing campaign_id with broadcast $campaign_type will remain empty for broadcast
|
35 |
if ( ! empty ( $campaign_id ) ) {
|
36 |
$campaign_type = ES()->campaigns_db->get_campaign_type_by_id( $campaign_id );
|
37 |
}
|
38 |
|
39 |
+
$campaign_types = array('sequence', 'sequence_message');
|
40 |
//Only if it is sequence then control will transfer to Sequence Reports class.
|
41 |
+
if ( ! empty ( $campaign_type ) && in_array( $campaign_type, $campaign_types ) ) {
|
42 |
+
if ( ES()->is_pro() ) {
|
43 |
$reports = ES_Pro_Sequence_Reports::get_instance();
|
44 |
+
$reports->es_sequence_reports_callback();
|
45 |
+
} else {
|
46 |
+
do_action( 'ig_es_view_report_data' );
|
47 |
+
}
|
48 |
+
} else {
|
|
|
49 |
$action = ig_es_get_request_data( 'action' );
|
50 |
if ( 'view' === $action ) {
|
51 |
$list = ig_es_get_request_data( 'list' );
|
52 |
$this->view_list( $list );
|
53 |
} else {
|
54 |
?>
|
55 |
+
<div class="wrap">
|
56 |
+
<h1 class="wp-heading-inline"><span class="text-2xl font-medium leading-7 text-gray-900 sm:leading-9 sm:truncate"><?php esc_html_e( 'Reports', 'email-subscribers' ); ?></span></h1>
|
57 |
<?php
|
58 |
$emails_to_be_sent = ES_DB_Sending_Queue::get_total_emails_to_be_sent();
|
59 |
if ( $emails_to_be_sent > 0 ) {
|
60 |
$cron_url = ES()->cron->url( true );
|
61 |
+
/* translators: %s: Cron url */
|
62 |
+
$content = sprintf( __( "<a href='%s' class='px-4 py-2 ig-es-imp-button'>Send Queued Emails Now</a>", 'email-subscribers' ), $cron_url );
|
63 |
} else {
|
64 |
+
$content = sprintf( __( "<span class='ig-es-send-queue-emails button-disabled'>Send Queued Emails Now</span>", 'email-subscribers' ) );
|
65 |
$content .= sprintf( __( "<br /><span class='es-helper'>No emails found in queue</span>", 'email-subscribers' ) );
|
66 |
}
|
67 |
?>
|
68 |
|
69 |
+
<span class="ig-es-process-queue"><?php echo wp_kses_post( $content ); ?></span>
|
70 |
|
71 |
|
72 |
+
<div id="poststuff" class="es-items-lists">
|
73 |
+
<div id="post-body" class="metabox-holder column-1">
|
74 |
+
<div id="post-body-content">
|
75 |
+
<div class="meta-box-sortables ui-sortable">
|
76 |
+
<form method="post">
|
77 |
<?php
|
78 |
$this->prepare_items();
|
79 |
+
$this->display();
|
80 |
+
?>
|
81 |
+
</form>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
<br class="clear">
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
<?php
|
89 |
+
}
|
90 |
}
|
91 |
}
|
92 |
|
96 |
$args = array(
|
97 |
'label' => __( 'Reports', 'email-subscribers' ),
|
98 |
'default' => 10,
|
99 |
+
'option' => 'reports_per_page',
|
100 |
);
|
101 |
|
102 |
add_screen_option( $option, $args );
|
106 |
public function prepare_header_footer_row() {
|
107 |
|
108 |
?>
|
109 |
+
<tr>
|
110 |
+
<th width="8%" class=" py-3 pl-4 border-b border-gray-200 bg-gray-200 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e( 'Sr No', 'email-subscribers' ); ?></th>
|
111 |
+
<th width="24%" class=" py-3 pl-4 border-b border-gray-200 bg-gray-200 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e( 'Email', 'email-subscribers' ); ?></th>
|
112 |
+
<th width="12%" class=" py-3 pl-6 border-b border-gray-200 bg-gray-200 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e( 'Status', 'email-subscribers' ); ?></th>
|
113 |
+
<th width="22%" class="py-3 pl-2 border-b border-gray-200 bg-gray-200 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e( 'Sent Date', 'email-subscribers' ); ?></th>
|
114 |
+
<th width="17%" class="py-3 pl-6 border-b border-gray-200 bg-gray-200 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e( 'Viewed Status', 'email-subscribers' ); ?></th>
|
115 |
+
<th width="22%" class=" py-3 pl-6 border-b border-gray-200 bg-gray-200 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"><?php esc_html_e( 'Viewed Date', 'email-subscribers' ); ?></th>
|
116 |
+
</tr>
|
117 |
|
118 |
<?php
|
119 |
}
|
123 |
$email_viewed_count = ES_DB_Sending_Queue::get_viewed_count_by_hash( $id );
|
124 |
$total_email_sent = ES_DB_Sending_Queue::get_total_email_count_by_hash( $id );
|
125 |
|
126 |
+
|
127 |
$insight = ig_es_get_request_data( 'insight', '' );
|
128 |
$_wpnonce = ig_es_get_request_data( '_wpnonce', '' );
|
129 |
|
131 |
do_action( 'ig_es_view_report_data', $id, $emails );
|
132 |
}
|
133 |
?>
|
134 |
+
<div class="wrap">
|
135 |
+
<div class="mt-6 mb-2 max-w-7xl">
|
136 |
+
<div class="pt-3">
|
137 |
+
<span class="text-left text-lg font-medium leading-7 tracking-wide text-gray-600"><?php esc_html_e( 'View Activity ', 'email-subscribers' ); ?></span>
|
138 |
|
139 |
<?php if ( ! ES()->is_pro() && ! $insight ) { ?>
|
140 |
+
<a href="?page=es_reports&action=view&list=<?php echo esc_attr( $id ); ?>&_wpnonce=<?php echo esc_attr( $_wpnonce ); ?>&insight=true" class="float-right ig-es-title-button px-2 py-2 mx-2 ig-es-imp-button cursor-pointer"><?php esc_html_e( 'Campaign Analytics', 'email-subscribers' ); ?></a>
|
141 |
<?php } ?>
|
142 |
+
</div>
|
143 |
+
</div>
|
144 |
|
145 |
+
<div class="mt-2 mb-2 block">
|
146 |
+
<span class="pt-3 pb-4 leading-5 tracking-wide text-gray-600"><?php echo esc_html('Viewed ' . $email_viewed_count . '/' . $total_email_sent ); ?>
|
147 |
</span>
|
148 |
+
</div>
|
149 |
+
|
150 |
+
<div class="mb-2 max-w-7xl flex">
|
151 |
+
<div class="flex w-full bg-white shadow rounded-md break-all">
|
152 |
+
|
153 |
+
<form name="frm_es_display" method="post">
|
154 |
+
<table class="w-full table-fixed">
|
155 |
+
<thead>
|
156 |
+
<?php echo wp_kses_post( $this->prepare_header_footer_row() ); ?>
|
157 |
+
</thead>
|
158 |
+
<tbody>
|
159 |
+
<?php echo wp_kses_post( $this->prepare_body( $emails ) ); ?>
|
160 |
+
</tbody>
|
161 |
+
<tfoot>
|
162 |
+
<?php echo wp_kses_post( $this->prepare_header_footer_row() ); ?>
|
163 |
+
</tfoot>
|
164 |
+
</table>
|
165 |
+
</form>
|
166 |
+
</div>
|
167 |
+
</div>
|
168 |
+
</div>
|
169 |
<?php
|
170 |
+
// $wpdb->update( EMAIL_SUBSCRIBERS_STATS_TABLE, array( 'viewdate' => date( 'Y-m-d H:i:s' ) ), array( 'viewdate' => $id ) );
|
|
|
171 |
}
|
172 |
|
173 |
|
176 |
$i = 1;
|
177 |
foreach ( $emails as $key => $email ) {
|
178 |
$class = '';
|
179 |
+
if ( 0 === $i % 2 ) {
|
180 |
$class = 'alternate';
|
181 |
}
|
182 |
|
183 |
$email_id = ! empty( $email['email'] ) ? $email['email'] : ( ! empty( $email['es_deliver_emailmail'] ) ? $email['es_deliver_emailmail'] : '' );
|
184 |
$status = ! empty( $email['status'] ) ? $email['status'] : ( ! empty( $email['es_deliver_sentstatus'] ) ? $email['es_deliver_sentstatus'] : '' );
|
185 |
$sent_at = ! empty( $email['sent_at'] ) ? $email['sent_at'] : ( ! empty( $email['es_deliver_sentdate'] ) ? $email['es_deliver_sentdate'] : '' );
|
186 |
+
$opened = ! empty( $email['opened'] ) ? $email['opened'] : ( ! empty( $email['es_deliver_status'] ) && 'Viewed' === $email['es_deliver_status'] ? 1 : 0 );
|
187 |
$opened_at = ! empty( $email['opened_at'] ) ? $email['opened_at'] : ( ! empty( $email['es_deliver_viewdate'] ) ? $email['es_deliver_viewdate'] : '' );
|
188 |
|
189 |
?>
|
190 |
|
191 |
+
<tr>
|
192 |
+
<td class="pl-6 py-2 border-b border-gray-200 text-sm leading-5 text-gray-500"><?php echo esc_html( $i ); ?></td>
|
193 |
+
<td class="pl-4 py-2 border-b border-gray-200 text-sm leading-5 text-gray-600"><?php echo esc_html( $email_id ); ?></td>
|
194 |
+
<td class="pl-6 pr-2 py-2 border-b border-gray-200 text-sm leading-5 text-gray-500"><span style="color:#03a025;font-weight:bold;"><?php echo esc_html( $status ); ?></span></td>
|
195 |
+
<td class="pl-2 pr-2 py-2 border-b border-gray-200 text-sm leading-5 text-gray-500"><?php echo wp_kses_post( ig_es_format_date_time( $sent_at ) ); ?></td>
|
196 |
+
<td class="pl-6 pr-2 py-2 border-b border-gray-200 text-sm leading-5 text-gray-600"><span>
|
197 |
+
<?php
|
198 |
+
/* translators: 1: Italic tag 2: Class attribute */
|
199 |
+
echo ! empty( $opened ) && 1 == $opened ? esc_html__( 'Viewed', 'email-subscribers' ) : wp_kses_post( '<i title="Not yet viewed" class="dashicons dashicons-es dashicons-minus"/>' );
|
200 |
+
?>
|
201 |
+
</span></td>
|
202 |
+
<td class="pl-6 pr-1 py-2 border-b border-gray-200 text-sm leading-5 text-gray-500"><?php echo wp_kses_post(ig_es_format_date_time( $opened_at ) ); ?></td>
|
203 |
+
</tr>
|
204 |
|
205 |
<?php
|
206 |
$i ++;
|
211 |
|
212 |
/** Text displayed when no list data is available */
|
213 |
public function no_items() {
|
214 |
+
esc_html_e( 'No Reports avaliable.', 'email-subscribers' );
|
215 |
}
|
216 |
|
217 |
/**
|
218 |
* Render a column when no column specific method exist.
|
219 |
*
|
220 |
+
* @param array $item
|
221 |
* @param string $column_name
|
222 |
*
|
223 |
* @return mixed
|
243 |
return $type;
|
244 |
case 'subject':
|
245 |
// case 'type':
|
246 |
+
// return ucwords($item[ $column_name ]);
|
247 |
case 'count':
|
248 |
return $item[ $column_name ];
|
249 |
default:
|
250 |
+
return print_r( $item, true ); // Show the whole array for troubleshooting purposes
|
251 |
}
|
252 |
}
|
253 |
|
254 |
+
public function column_status( $item ) {
|
255 |
+
if ( 'Sent' == $item['status'] ) {
|
256 |
return __( 'Completed', 'email-subscribers' );
|
257 |
} else {
|
258 |
|
259 |
$actions = array(
|
260 |
+
'send_now' => $this->prepare_send_now_url( $item ),
|
261 |
);
|
262 |
|
263 |
return $item['status'] . $this->row_actions( $actions, true );
|
271 |
*
|
272 |
* @return string
|
273 |
*/
|
274 |
+
public function column_cb( $item ) {
|
275 |
return sprintf(
|
276 |
+
'<input type="checkbox" name="bulk_delete[]" value="%s" />',
|
277 |
+
$item['id']
|
278 |
);
|
279 |
}
|
280 |
|
286 |
*
|
287 |
* @return string
|
288 |
*/
|
289 |
+
public function column_subject( $item ) {
|
290 |
|
291 |
$es_nonce = wp_create_nonce( 'es_notification' );
|
292 |
$page = ig_es_get_request_data( 'page' );
|
296 |
$actions = array(
|
297 |
'view' => sprintf( '<a href="?page=%s&action=%s&list=%s&_wpnonce=%s" class="text-indigo-600">%s</a>', esc_attr( $page ), 'view', $item['hash'], $es_nonce, __( 'View', 'email-subscribers' ) ),
|
298 |
'delete' => sprintf( '<a href="?page=%s&action=%s&list=%s&_wpnonce=%s">%s</a>', esc_attr( $page ), 'delete', absint( $item['id'] ), $es_nonce, __( 'Delete', 'email-subscribers' ) ),
|
299 |
+
'preview_email' => sprintf( '<a target="_blank" href="?page=%s&action=%s&list=%s&_wpnonce=%s" class="text-indigo-600">%s</a>', esc_attr( $page ), 'preview', absint( $item['id'] ), $es_nonce, __( 'Preview', 'email-subscribers' ) ),
|
300 |
|
301 |
);
|
302 |
|
309 |
*
|
310 |
* @return array
|
311 |
*/
|
312 |
+
public function get_columns() {
|
313 |
$columns = array(
|
314 |
'cb' => '<input type="checkbox" />',
|
315 |
'subject' => __( 'Subject', 'email-subscribers' ),
|
323 |
return $columns;
|
324 |
}
|
325 |
|
326 |
+
public function column_count( $item ) {
|
327 |
|
328 |
$campaign_hash = $item['hash'];
|
329 |
|
330 |
+
$total_emails_sent = $item['count'];
|
331 |
+
$total_emails_to_be_sent = $item['count'];
|
332 |
// if ( ! empty( $campaign_hash ) ) {
|
333 |
+
// $total_emails_sent = ES_DB_Sending_Queue::get_total_emails_sent_by_hash( $campaign_hash );
|
334 |
// }
|
335 |
|
336 |
// $content = $total_emails_sent . "/" . $total_emails_to_be_sent;
|
339 |
|
340 |
}
|
341 |
|
342 |
+
public function prepare_send_now_url( $item ) {
|
343 |
$campaign_hash = $item['hash'];
|
344 |
|
345 |
$cron_url = '';
|
347 |
$cron_url = ES()->cron->url( true, false, $campaign_hash );
|
348 |
}
|
349 |
|
|
|
350 |
$content = '';
|
351 |
if ( ! empty( $cron_url ) ) {
|
352 |
+
/* translators: %s: Cron url */
|
353 |
$content = __( sprintf( "<a href='%s' target='_blank'>Send</a>", $cron_url ), 'email-subscribers' );
|
354 |
}
|
355 |
|
367 |
'status' => array( 'status', true ),
|
368 |
'start_at' => array( 'start_at', true ),
|
369 |
'finish_at' => array( 'finish_at', true ),
|
370 |
+
'count' => array( 'count', true ),
|
371 |
);
|
372 |
|
373 |
return $sortable_columns;
|
380 |
*/
|
381 |
public function get_bulk_actions() {
|
382 |
$actions = array(
|
383 |
+
'bulk_delete' => __( 'Delete', 'email-subscribers' ),
|
384 |
);
|
385 |
|
386 |
return $actions;
|
401 |
$current_page = $this->get_pagenum();
|
402 |
$total_items = $this->get_notifications( 0, 0, true );
|
403 |
|
404 |
+
$this->set_pagination_args(
|
405 |
+
array(
|
406 |
+
'total_items' => $total_items, // WE have to calculate the total number of items
|
407 |
+
'per_page' => $per_page, // WE have to determine how many items to show on a page
|
408 |
+
)
|
409 |
+
);
|
410 |
|
411 |
$this->items = $this->get_notifications( $per_page, $current_page, false );
|
412 |
}
|
413 |
|
414 |
public function get_notifications( $per_page = 5, $page_number = 1, $do_count_only = false ) {
|
415 |
+
global $wpbd;
|
416 |
|
417 |
$order_by = sanitize_sql_orderby( ig_es_get_request_data( 'orderby' ) );
|
418 |
$order = ig_es_get_request_data( 'order' );
|
430 |
$where_args = array();
|
431 |
|
432 |
if ( ! empty( $campaign_id ) && is_numeric( $campaign_id ) ) {
|
433 |
+
$where_columns[] = 'campaign_id = %d';
|
434 |
$where_args[] = $campaign_id;
|
435 |
}
|
436 |
|
437 |
$where_query = '';
|
438 |
if ( ! empty( $where_columns ) ) {
|
439 |
+
$where_query = implode( ' AND ', $where_columns );
|
440 |
+
$where_query = $wpbd->prepare( $where_query, $where_args );
|
441 |
}
|
442 |
|
443 |
if ( ! empty( $where_query ) ) {
|
465 |
$order_by_clause = " ORDER BY {$order_by} {$order}, {$default_order_by} DESC";
|
466 |
}
|
467 |
|
468 |
+
$sql .= $order_by_clause;
|
469 |
+
$sql .= " LIMIT $per_page";
|
470 |
+
$sql .= ' OFFSET ' . ( $page_number - 1 ) * $per_page;
|
471 |
+
$result = $wpbd->get_results( $sql, 'ARRAY_A' );
|
472 |
|
473 |
} else {
|
474 |
+
$result = $wpbd->get_var( $sql );
|
475 |
}
|
476 |
|
477 |
return $result;
|
478 |
}
|
479 |
|
480 |
public function process_bulk_action() {
|
481 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
482 |
+
// Detect when a bulk action is being triggered...
|
483 |
if ( 'view' === $this->current_action() ) {
|
484 |
|
485 |
// In our file that handles the request, verify the nonce.
|
491 |
} else {
|
492 |
$this->view_list( ig_es_get_request_data( 'list' ) );
|
493 |
}
|
|
|
494 |
} elseif ( 'delete' === $this->current_action() ) {
|
495 |
|
496 |
// In our file that handles the request, verify the nonce.
|
506 |
$message = __( 'Report has been deleted successfully!', 'email-subscribers' );
|
507 |
ES_Common::show_message( $message, 'success' );
|
508 |
}
|
|
|
509 |
} elseif ( 'preview' === $this->current_action() ) {
|
510 |
// In our file that handles the request, verify the nonce.
|
511 |
$nonce = ig_es_get_request_data( '_wpnonce' );
|
515 |
ES_Common::show_message( $message, 'error' );
|
516 |
} else {
|
517 |
$report_id = ig_es_get_request_data( 'list' );
|
518 |
+
echo wp_kses( $this->preview_email( $report_id ), $allowedtags );
|
519 |
die();
|
520 |
}
|
521 |
}
|
532 |
$message = __( 'Reports have been deleted successfully!', 'email-subscribers' );
|
533 |
ES_Common::show_message( $message, 'success' );
|
534 |
}
|
|
|
535 |
}
|
536 |
}
|
537 |
|
538 |
public function preview_email( $report_id ) {
|
539 |
ob_start();
|
540 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
541 |
+
add_filter( 'safe_style_css', 'ig_es_allowed_css_style' );
|
542 |
?>
|
543 |
+
<div class="wrap">
|
544 |
+
<h2 style="margin-bottom:1em;">
|
545 |
+
<?php esc_html_e( 'Preview Email', 'email-subscribers' ); ?>
|
546 |
+
</h2>
|
547 |
+
<p>
|
548 |
+
<?php echo wp_kses_post( 'This is how the email you sent may look. <br>Note: Different email services (like gmail, yahoo etc) display email content differently. So there could be a slight variation on how your customer will view the email content.', 'email-subscribers' ); ?>
|
549 |
+
</p>
|
550 |
+
<div class="tool-box">
|
551 |
+
<div style="padding:15px;background-color:#FFFFFF;">
|
552 |
<?php
|
553 |
$preview = array();
|
554 |
$preview = ES_DB_Mailing_Queue::get_email_by_id( $report_id );
|
555 |
|
556 |
$es_email_type = get_option( 'ig_es_email_type' ); // Not the ideal way. Email type can differ while previewing sent email.
|
557 |
|
558 |
+
if ( 'WP HTML MAIL' == $es_email_type || 'PHP HTML MAIL' == $es_email_type ) {
|
559 |
$preview['body'] = ES_Common::es_process_template_body( $preview['body'] );
|
560 |
} else {
|
561 |
+
$preview['body'] = str_replace( '<br />', "\r\n", $preview['body'] );
|
562 |
+
$preview['body'] = str_replace( '<br>', "\r\n", $preview['body'] );
|
563 |
}
|
564 |
|
565 |
+
echo wp_kses( stripslashes( $preview['body'] ), $allowedtags );
|
566 |
?>
|
567 |
+
</div>
|
568 |
+
</div>
|
569 |
+
</div>
|
570 |
<?php
|
571 |
$html = ob_get_clean();
|
572 |
|
581 |
|
582 |
return self::$instance;
|
583 |
}
|
584 |
+
}
|
lite/includes/classes/class-es-subscription-throttling.php
CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
class ES_Subscription_Throttling {
|
9 |
|
10 |
-
static function throttle() {
|
11 |
|
12 |
global $wpdb;
|
13 |
|
@@ -26,14 +26,24 @@ class ES_Subscription_Throttling {
|
|
26 |
return MINUTE_IN_SECONDS * 10;
|
27 |
}
|
28 |
|
29 |
-
$
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
if ( $subscribers > 0 ) {
|
33 |
$timeout = MINUTE_IN_SECONDS * pow( 2, $subscribers - 1 );
|
34 |
|
35 |
-
$
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
if ( $subscribers > 0 ) {
|
39 |
return $timeout;
|
@@ -41,16 +51,24 @@ class ES_Subscription_Throttling {
|
|
41 |
}
|
42 |
|
43 |
// Add IP Address.
|
44 |
-
$query
|
45 |
-
|
|
|
|
|
|
|
|
|
46 |
|
47 |
// Delete older entries
|
48 |
-
$query
|
49 |
-
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
}
|
52 |
|
53 |
return false;
|
54 |
}
|
55 |
|
56 |
-
}
|
7 |
|
8 |
class ES_Subscription_Throttling {
|
9 |
|
10 |
+
public static function throttle() {
|
11 |
|
12 |
global $wpdb;
|
13 |
|
26 |
return MINUTE_IN_SECONDS * 10;
|
27 |
}
|
28 |
|
29 |
+
$subscribers = $wpdb->get_var(
|
30 |
+
$wpdb->prepare(
|
31 |
+
"SELECT count(*) as count from {$wpdb->prefix}ig_contacts_ips WHERE ip = %s AND ( `created_on` >= NOW() - INTERVAL %s SECOND )",
|
32 |
+
$subscriber_ip,
|
33 |
+
DAY_IN_SECONDS
|
34 |
+
)
|
35 |
+
);
|
36 |
|
37 |
if ( $subscribers > 0 ) {
|
38 |
$timeout = MINUTE_IN_SECONDS * pow( 2, $subscribers - 1 );
|
39 |
|
40 |
+
$subscribers = $wpdb->get_var(
|
41 |
+
$wpdb->prepare(
|
42 |
+
"SELECT count(*) as count from {$wpdb->prefix}ig_contacts_ips WHERE ip = %s AND ( `created_on` >= NOW() - INTERVAL %s SECOND ) LIMIT 1",
|
43 |
+
$subscriber_ip,
|
44 |
+
$timeout
|
45 |
+
)
|
46 |
+
);
|
47 |
|
48 |
if ( $subscribers > 0 ) {
|
49 |
return $timeout;
|
51 |
}
|
52 |
|
53 |
// Add IP Address.
|
54 |
+
$wpdb->query(
|
55 |
+
$wpdb->prepare(
|
56 |
+
"INSERT INTO {$wpdb->prefix}ig_contacts_ips (`ip`) VALUES ( %s )",
|
57 |
+
$subscriber_ip
|
58 |
+
)
|
59 |
+
);
|
60 |
|
61 |
// Delete older entries
|
62 |
+
$wpdb->query(
|
63 |
+
$wpdb->prepare(
|
64 |
+
"DELETE FROM {$wpdb->prefix}ig_contacts_ips WHERE (`created_on` < NOW() - INTERVAL %s SECOND )",
|
65 |
+
DAY_IN_SECONDS
|
66 |
+
)
|
67 |
+
);
|
68 |
}
|
69 |
}
|
70 |
|
71 |
return false;
|
72 |
}
|
73 |
|
74 |
+
}
|
lite/includes/classes/class-es-templates-table.php
CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
class ES_Templates_Table {
|
9 |
|
10 |
-
static $instance;
|
11 |
|
12 |
public function __construct() {
|
13 |
add_action( 'add_meta_boxes', array( $this, 'es_template_meta_box_add' ) );
|
@@ -17,7 +17,7 @@ class ES_Templates_Table {
|
|
17 |
add_action( 'manage_posts_custom_column', array( $this, 'custom_columns' ) );
|
18 |
add_action( 'admin_footer', array( $this, 'add_custom_button' ) );
|
19 |
add_action( 'edit_form_after_title', array( $this, 'add_template_type' ) );
|
20 |
-
//duplicate template
|
21 |
add_filter( 'post_row_actions', array( &$this, 'add_message_action' ), 10, 2 );
|
22 |
add_action( 'admin_init', array( &$this, 'duplicate_message' ), 10, 1 );
|
23 |
}
|
@@ -32,17 +32,17 @@ class ES_Templates_Table {
|
|
32 |
$selected = isset( $values['es_template_type'] ) ? esc_attr( $values['es_template_type'][0] ) : '';
|
33 |
$template_type = array(
|
34 |
'newsletter' => __( 'Broadcast', 'email-subscribers' ),
|
35 |
-
'post_notification' => __( 'Post Notification', 'email-subscribers' )
|
36 |
);
|
37 |
$template_type = apply_filters( 'es_template_type', $template_type );
|
38 |
?>
|
39 |
<p>
|
40 |
-
<label for="es_template_type"><strong><?php
|
41 |
<select name="es_template_type" id="es_template_type">
|
42 |
<?php
|
43 |
if ( ! empty( $template_type ) ) {
|
44 |
foreach ( $template_type as $key => $value ) {
|
45 |
-
echo
|
46 |
}
|
47 |
}
|
48 |
?>
|
@@ -63,23 +63,23 @@ class ES_Templates_Table {
|
|
63 |
}
|
64 |
?>
|
65 |
<p id="post_notification">
|
66 |
-
<a href="https://www.icegram.com/documentation/es-what-are-the-available-keywords-in-the-post-notifications/?utm_source=es&utm_medium=in_app&utm_campaign=view_docs_help_page" target="_blank"><?php
|
67 |
{{LASTNAME}}, {{NAME}}, {{EMAIL}},
|
68 |
{{DATE}}, {{POSTTITLE}}, {{POSTIMAGE}}, {{POSTEXCERPT}}, {{POSTDESC}},
|
69 |
{{POSTAUTHOR}}, {{POSTLINK}}, {{POSTLINK-WITHTITLE}}, {{POSTLINK-ONLY}}, {{POSTFULL}} </p>
|
70 |
<p id="newsletter">
|
71 |
-
<a href="https://www.icegram.com/documentation/es-what-are-the-available-keywords-in-the-newsletters/?utm_source=es&utm_medium=in_app&utm_campaign=view_docs_help_page" target="_blank"><?php
|
72 |
{{EMAIL}} </p>
|
73 |
<div id="post_digest">
|
74 |
<span style="font-size: 0.8em; margin-left: 0.3em; padding: 2px; background: #e66060; color: #fff; border-radius: 2px; ">Pro</span>
|
75 |
-
<a href="https://www.icegram.com/send-post-digest-using-email-subscribers-plugin/?utm_source=es&utm_medium=in_app&utm_campaign=view_post_digest_post" target="_blank"><?php
|
76 |
-
{{FIRSTNAME}}, {{LASTNAME}}, {{NAME}}<div class="post_digest_block"> {{POSTDIGEST}} <br/><?php
|
77 |
</div>
|
78 |
<?php
|
79 |
}
|
80 |
|
81 |
public function es_template_meta_save( $post_id, $post ) {
|
82 |
-
if ( empty( $post_id ) || empty( $post )
|
83 |
return;
|
84 |
}
|
85 |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
@@ -94,14 +94,14 @@ class ES_Templates_Table {
|
|
94 |
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
95 |
return;
|
96 |
}
|
97 |
-
if ( $post->post_type
|
98 |
return;
|
99 |
}
|
100 |
|
|
|
101 |
|
102 |
-
if (
|
103 |
-
$
|
104 |
-
update_post_meta( $post_id, 'es_template_type', esc_attr( $es_template_type ) );
|
105 |
}
|
106 |
}
|
107 |
|
@@ -113,7 +113,7 @@ class ES_Templates_Table {
|
|
113 |
|
114 |
<div class="misc-pub-section">
|
115 |
<div id="" class="es_preview_button" style="display: block;">
|
116 |
-
<a href="<?php echo admin_url(); ?>admin.php?page=es_template_preview&post=<?php echo $post_id; ?>&preview=true&preview_id=<?php echo $post_id ?>" target="_blank" class="button button-primary es_preview"><?php
|
117 |
<div class="clear"></div>
|
118 |
</div>
|
119 |
</div>
|
@@ -124,7 +124,7 @@ class ES_Templates_Table {
|
|
124 |
|
125 |
public function add_custom_button() {
|
126 |
$screen = get_current_screen();
|
127 |
-
if ( $screen->post_type
|
128 |
?>
|
129 |
<script type="text/javascript">
|
130 |
jQuery('<a href="admin.php?page=es_campaigns" class="text-sm rounded-md border border-indigo-600 px-2 py-2 leading-5 font-medium mx-2 hover:border-indigo-500 hover:bg-gray-100">Campaigns</a>').insertBefore(".wp-header-end");
|
@@ -135,7 +135,7 @@ class ES_Templates_Table {
|
|
135 |
|
136 |
public function es_template_preview_callback() {
|
137 |
|
138 |
-
$template_id = ig_es_get_request_data('post');
|
139 |
|
140 |
$template = get_post( $template_id, ARRAY_A );
|
141 |
|
@@ -145,21 +145,21 @@ class ES_Templates_Table {
|
|
145 |
$useremail = $current_user->user_email;
|
146 |
$display_name = $current_user->display_name;
|
147 |
|
148 |
-
$contact_id
|
149 |
-
$first_name
|
150 |
-
$last_name
|
151 |
|
152 |
// Use details from contacts data if present else fetch it from wp profile.
|
153 |
-
if( ! empty( $contact_id ) ) {
|
154 |
$contact_data = ES()->contacts_db->get_by_id( $contact_id );
|
155 |
$first_name = $contact_data['first_name'];
|
156 |
$last_name = $contact_data['last_name'];
|
157 |
-
}
|
158 |
$contact_details = explode( ' ', $display_name );
|
159 |
$first_name = $contact_details[0];
|
160 |
// Check if last name is set.
|
161 |
-
if( ! empty( $contact_details[1] ) ) {
|
162 |
-
$last_name
|
163 |
}
|
164 |
}
|
165 |
|
@@ -167,9 +167,12 @@ class ES_Templates_Table {
|
|
167 |
|
168 |
$es_template_type = get_post_meta( $template_id, 'es_template_type', true );
|
169 |
|
170 |
-
|
171 |
if ( 'post_notification' === $es_template_type ) {
|
172 |
-
$args = array(
|
|
|
|
|
|
|
|
|
173 |
$recent_posts = wp_get_recent_posts( $args );
|
174 |
|
175 |
if ( count( $recent_posts ) > 0 ) {
|
@@ -186,6 +189,8 @@ class ES_Templates_Table {
|
|
186 |
$es_template_body = str_replace( '{{EMAIL}}', $useremail, $es_template_body );
|
187 |
$es_template_body = str_replace( '{{FIRSTNAME}}', $first_name, $es_template_body );
|
188 |
$es_template_body = str_replace( '{{LASTNAME}}', $last_name, $es_template_body );
|
|
|
|
|
189 |
|
190 |
if ( has_post_thumbnail( $template_id ) ) {
|
191 |
$image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $template_id ), 'full' );
|
@@ -193,7 +198,7 @@ class ES_Templates_Table {
|
|
193 |
} else {
|
194 |
$image = '';
|
195 |
}
|
196 |
-
$html
|
197 |
$html .= '<style type="text/css">
|
198 |
.es-sidebar {
|
199 |
width: 23%;
|
@@ -208,12 +213,21 @@ class ES_Templates_Table {
|
|
208 |
background-color:#FFF;
|
209 |
font-size:16px;
|
210 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
</style>
|
212 |
<div class="wrap">
|
213 |
<div class="tool-box">
|
214 |
-
<div class="es-main"
|
215 |
<div class="es-sidebar">
|
216 |
-
<h2
|
217 |
Template Preview <a class="add-new-h2" href="' . admin_url() . 'admin.php?page=es-general-information">Help</a>
|
218 |
</h2>
|
219 |
<p>
|
@@ -223,14 +237,14 @@ class ES_Templates_Table {
|
|
223 |
This is how your email may look.<br><br>Note: Different email services (like gmail, yahoo etc) display email content differently. So there could be a slight variation on how your customer will view the email content. </p>
|
224 |
</div>
|
225 |
<div class="es-preview">' . $es_template_body . '</div>
|
226 |
-
<div
|
227 |
</div>
|
228 |
-
<div
|
229 |
</div>
|
230 |
</div>';
|
231 |
-
echo apply_filters( 'the_content', $html );
|
232 |
} else {
|
233 |
-
echo
|
234 |
}
|
235 |
|
236 |
}
|
@@ -258,23 +272,24 @@ class ES_Templates_Table {
|
|
258 |
$es_template_thumbnail = ( ! empty( $es_template_thumbnail ) ) ? $es_template_thumbnail : $default_template_thumbnail;
|
259 |
switch ( $column ) {
|
260 |
case 'es_template_type':
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
|
|
269 |
default:
|
270 |
-
|
271 |
}
|
272 |
|
273 |
return $column;
|
274 |
}
|
275 |
|
276 |
-
function add_message_action( $actions, $post ) {
|
277 |
-
if ( $post->post_type
|
278 |
return $actions;
|
279 |
}
|
280 |
$actions['duplicate_template'] = '<a class="es-duplicate-template" href="post.php?template_id=' . $post->ID . '&action=duplicate-template" >' . __( 'Duplicate', 'email-subscribers' ) . '</a>';
|
@@ -282,11 +297,11 @@ class ES_Templates_Table {
|
|
282 |
return $actions;
|
283 |
}
|
284 |
|
285 |
-
function duplicate_message() {
|
286 |
$action = ig_es_get_request_data( 'action' );
|
287 |
$template_id = ig_es_get_request_data( 'template_id' );
|
288 |
if ( ! empty( $template_id ) && 'duplicate-template' === $action ) {
|
289 |
-
//duplicate tempalte
|
290 |
$this->duplicate_in_db( $template_id );
|
291 |
// $location = admin_url( 'post.php?post='.$duplicate_template_id.'&action=edit');
|
292 |
$location = admin_url( 'edit.php?post_type=es_template' );
|
@@ -295,7 +310,7 @@ class ES_Templates_Table {
|
|
295 |
}
|
296 |
}
|
297 |
|
298 |
-
function duplicate_in_db( $original_id ) {
|
299 |
// Get access to the database
|
300 |
global $wpdb;
|
301 |
// Get the post as an array
|
@@ -306,7 +321,7 @@ class ES_Templates_Table {
|
|
306 |
// Set the post date
|
307 |
$timestamp = current_time( 'timestamp', 0 );
|
308 |
|
309 |
-
$duplicate['post_date'] =
|
310 |
|
311 |
// Remove some of the keys
|
312 |
unset( $duplicate['ID'] );
|
@@ -314,7 +329,7 @@ class ES_Templates_Table {
|
|
314 |
unset( $duplicate['comment_count'] );
|
315 |
|
316 |
$current_user_id = get_current_user_id();
|
317 |
-
if( ! empty( $current_user_id ) ) {
|
318 |
// Set post author to current logged in author.
|
319 |
$duplicate['post_author'] = $current_user_id;
|
320 |
}
|
7 |
|
8 |
class ES_Templates_Table {
|
9 |
|
10 |
+
public static $instance;
|
11 |
|
12 |
public function __construct() {
|
13 |
add_action( 'add_meta_boxes', array( $this, 'es_template_meta_box_add' ) );
|
17 |
add_action( 'manage_posts_custom_column', array( $this, 'custom_columns' ) );
|
18 |
add_action( 'admin_footer', array( $this, 'add_custom_button' ) );
|
19 |
add_action( 'edit_form_after_title', array( $this, 'add_template_type' ) );
|
20 |
+
// duplicate template
|
21 |
add_filter( 'post_row_actions', array( &$this, 'add_message_action' ), 10, 2 );
|
22 |
add_action( 'admin_init', array( &$this, 'duplicate_message' ), 10, 1 );
|
23 |
}
|
32 |
$selected = isset( $values['es_template_type'] ) ? esc_attr( $values['es_template_type'][0] ) : '';
|
33 |
$template_type = array(
|
34 |
'newsletter' => __( 'Broadcast', 'email-subscribers' ),
|
35 |
+
'post_notification' => __( 'Post Notification', 'email-subscribers' ),
|
36 |
);
|
37 |
$template_type = apply_filters( 'es_template_type', $template_type );
|
38 |
?>
|
39 |
<p>
|
40 |
+
<label for="es_template_type"><strong><?php esc_html_e( 'Select your Email Template Type', 'email-subscirbers' ); ?></strong></label></br>
|
41 |
<select name="es_template_type" id="es_template_type">
|
42 |
<?php
|
43 |
if ( ! empty( $template_type ) ) {
|
44 |
foreach ( $template_type as $key => $value ) {
|
45 |
+
echo '<option value=' . esc_attr( $key ) . ' ' . selected( $selected, $key, false ) . '>' . esc_html( $value ) . '</option>';
|
46 |
}
|
47 |
}
|
48 |
?>
|
63 |
}
|
64 |
?>
|
65 |
<p id="post_notification">
|
66 |
+
<a href="https://www.icegram.com/documentation/es-what-are-the-available-keywords-in-the-post-notifications/?utm_source=es&utm_medium=in_app&utm_campaign=view_docs_help_page" target="_blank"><?php esc_html_e( 'Available Keywords', 'email-subscribers' ); ?></a> <?php esc_html_e( 'for Post Notification: ', 'email-subsribers' ); ?> {{FIRSTNAME}},
|
67 |
{{LASTNAME}}, {{NAME}}, {{EMAIL}},
|
68 |
{{DATE}}, {{POSTTITLE}}, {{POSTIMAGE}}, {{POSTEXCERPT}}, {{POSTDESC}},
|
69 |
{{POSTAUTHOR}}, {{POSTLINK}}, {{POSTLINK-WITHTITLE}}, {{POSTLINK-ONLY}}, {{POSTFULL}} </p>
|
70 |
<p id="newsletter">
|
71 |
+
<a href="https://www.icegram.com/documentation/es-what-are-the-available-keywords-in-the-newsletters/?utm_source=es&utm_medium=in_app&utm_campaign=view_docs_help_page" target="_blank"><?php esc_html_e( 'Available Keywords', 'email-subscribers' ); ?></a> <?php esc_html_e( 'for Broadcast:', 'email-subscribers' ); ?> {{FIRSTNAME}}, {{LASTNAME}}, {{NAME}},
|
72 |
{{EMAIL}} </p>
|
73 |
<div id="post_digest">
|
74 |
<span style="font-size: 0.8em; margin-left: 0.3em; padding: 2px; background: #e66060; color: #fff; border-radius: 2px; ">Pro</span>
|
75 |
+
<a href="https://www.icegram.com/send-post-digest-using-email-subscribers-plugin/?utm_source=es&utm_medium=in_app&utm_campaign=view_post_digest_post" target="_blank"><?php esc_html_e( 'Available Keywords', 'email-subscribers' ); ?></a> <?php esc_html_e( 'for Post Digest:', 'email-subscribers' ); ?>
|
76 |
+
{{FIRSTNAME}}, {{LASTNAME}}, {{NAME}}<div class="post_digest_block"> {{POSTDIGEST}} <br/><?php esc_html_e( 'Any keywords related Post Notification', 'email-subscribers' ); ?> <br/>{{/POSTDIGEST}} </div>
|
77 |
</div>
|
78 |
<?php
|
79 |
}
|
80 |
|
81 |
public function es_template_meta_save( $post_id, $post ) {
|
82 |
+
if ( empty( $post_id ) || empty( $post ) ) {
|
83 |
return;
|
84 |
}
|
85 |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
94 |
if ( ! current_user_can( 'edit_post', $post_id ) ) {
|
95 |
return;
|
96 |
}
|
97 |
+
if ( 'es_template' != $post->post_type ) {
|
98 |
return;
|
99 |
}
|
100 |
|
101 |
+
$es_template_type = ig_es_get_post_data( 'es_template_type' );
|
102 |
|
103 |
+
if ( ! empty( $es_template_type ) ) {
|
104 |
+
update_post_meta( $post_id, 'es_template_type', $es_template_type );
|
|
|
105 |
}
|
106 |
}
|
107 |
|
113 |
|
114 |
<div class="misc-pub-section">
|
115 |
<div id="" class="es_preview_button" style="display: block;">
|
116 |
+
<a href="<?php echo esc_url( admin_url() ); ?>admin.php?page=es_template_preview&post=<?php echo esc_attr( $post_id ); ?>&preview=true&preview_id=<?php echo esc_attr( $post_id ); ?>" target="_blank" class="button button-primary es_preview"><?php esc_html_e( 'Preview Template', 'email-subscribers' ); ?></a>
|
117 |
<div class="clear"></div>
|
118 |
</div>
|
119 |
</div>
|
124 |
|
125 |
public function add_custom_button() {
|
126 |
$screen = get_current_screen();
|
127 |
+
if ( 'es_template' == $screen->post_type ) {
|
128 |
?>
|
129 |
<script type="text/javascript">
|
130 |
jQuery('<a href="admin.php?page=es_campaigns" class="text-sm rounded-md border border-indigo-600 px-2 py-2 leading-5 font-medium mx-2 hover:border-indigo-500 hover:bg-gray-100">Campaigns</a>').insertBefore(".wp-header-end");
|
135 |
|
136 |
public function es_template_preview_callback() {
|
137 |
|
138 |
+
$template_id = ig_es_get_request_data( 'post' );
|
139 |
|
140 |
$template = get_post( $template_id, ARRAY_A );
|
141 |
|
145 |
$useremail = $current_user->user_email;
|
146 |
$display_name = $current_user->display_name;
|
147 |
|
148 |
+
$contact_id = ES()->contacts_db->get_contact_id_by_email( $useremail );
|
149 |
+
$first_name = '';
|
150 |
+
$last_name = '';
|
151 |
|
152 |
// Use details from contacts data if present else fetch it from wp profile.
|
153 |
+
if ( ! empty( $contact_id ) ) {
|
154 |
$contact_data = ES()->contacts_db->get_by_id( $contact_id );
|
155 |
$first_name = $contact_data['first_name'];
|
156 |
$last_name = $contact_data['last_name'];
|
157 |
+
} elseif ( ! empty( $display_name ) ) {
|
158 |
$contact_details = explode( ' ', $display_name );
|
159 |
$first_name = $contact_details[0];
|
160 |
// Check if last name is set.
|
161 |
+
if ( ! empty( $contact_details[1] ) ) {
|
162 |
+
$last_name = $contact_details[1];
|
163 |
}
|
164 |
}
|
165 |
|
167 |
|
168 |
$es_template_type = get_post_meta( $template_id, 'es_template_type', true );
|
169 |
|
|
|
170 |
if ( 'post_notification' === $es_template_type ) {
|
171 |
+
$args = array(
|
172 |
+
'numberposts' => '1',
|
173 |
+
'order' => 'DESC',
|
174 |
+
'post_status' => 'publish',
|
175 |
+
);
|
176 |
$recent_posts = wp_get_recent_posts( $args );
|
177 |
|
178 |
if ( count( $recent_posts ) > 0 ) {
|
189 |
$es_template_body = str_replace( '{{EMAIL}}', $useremail, $es_template_body );
|
190 |
$es_template_body = str_replace( '{{FIRSTNAME}}', $first_name, $es_template_body );
|
191 |
$es_template_body = str_replace( '{{LASTNAME}}', $last_name, $es_template_body );
|
192 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
193 |
+
add_filter( 'safe_style_css', 'ig_es_allowed_css_style' );
|
194 |
|
195 |
if ( has_post_thumbnail( $template_id ) ) {
|
196 |
$image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $template_id ), 'full' );
|
198 |
} else {
|
199 |
$image = '';
|
200 |
}
|
201 |
+
$html = '';
|
202 |
$html .= '<style type="text/css">
|
203 |
.es-sidebar {
|
204 |
width: 23%;
|
213 |
background-color:#FFF;
|
214 |
font-size:16px;
|
215 |
}
|
216 |
+
.es-main-preview-block{
|
217 |
+
display:flex;
|
218 |
+
}
|
219 |
+
.es-clear-preview{
|
220 |
+
clear: both;
|
221 |
+
}
|
222 |
+
.es-preview-margin{
|
223 |
+
margin-bottom: 1em;
|
224 |
+
}
|
225 |
</style>
|
226 |
<div class="wrap">
|
227 |
<div class="tool-box">
|
228 |
+
<div class="es-main-preview-block">
|
229 |
<div class="es-sidebar">
|
230 |
+
<h2 class="es-preview-margin">
|
231 |
Template Preview <a class="add-new-h2" href="' . admin_url() . 'admin.php?page=es-general-information">Help</a>
|
232 |
</h2>
|
233 |
<p>
|
237 |
This is how your email may look.<br><br>Note: Different email services (like gmail, yahoo etc) display email content differently. So there could be a slight variation on how your customer will view the email content. </p>
|
238 |
</div>
|
239 |
<div class="es-preview">' . $es_template_body . '</div>
|
240 |
+
<div class="es-clear-preview"></div>
|
241 |
</div>
|
242 |
+
<div class="es-clear-preview"></div>
|
243 |
</div>
|
244 |
</div>';
|
245 |
+
echo wp_kses( apply_filters( 'the_content', $html ), $allowedtags);
|
246 |
} else {
|
247 |
+
echo esc_html__( 'Please publish it or save it as a draft.', 'email-subscribers' );
|
248 |
}
|
249 |
|
250 |
}
|
272 |
$es_template_thumbnail = ( ! empty( $es_template_thumbnail ) ) ? $es_template_thumbnail : $default_template_thumbnail;
|
273 |
switch ( $column ) {
|
274 |
case 'es_template_type':
|
275 |
+
$type = get_post_meta( $post->ID, 'es_template_type', true );
|
276 |
+
$type = sanitize_text_field(strtolower( $type ));
|
277 |
+
$type = ( 'newsletter' === $type ) ? __( 'Broadcast', 'email-subscribers' ) : $type;
|
278 |
+
$type = ucwords( str_replace( '_', ' ', $type ) );
|
279 |
+
echo esc_html( $type );
|
280 |
+
break;
|
281 |
+
case 'es_template_thumbnail':
|
282 |
+
echo wp_kses_post( $es_template_thumbnail );
|
283 |
+
break;
|
284 |
default:
|
285 |
+
break;
|
286 |
}
|
287 |
|
288 |
return $column;
|
289 |
}
|
290 |
|
291 |
+
public function add_message_action( $actions, $post ) {
|
292 |
+
if ( 'es_template' != $post->post_type ) {
|
293 |
return $actions;
|
294 |
}
|
295 |
$actions['duplicate_template'] = '<a class="es-duplicate-template" href="post.php?template_id=' . $post->ID . '&action=duplicate-template" >' . __( 'Duplicate', 'email-subscribers' ) . '</a>';
|
297 |
return $actions;
|
298 |
}
|
299 |
|
300 |
+
public function duplicate_message() {
|
301 |
$action = ig_es_get_request_data( 'action' );
|
302 |
$template_id = ig_es_get_request_data( 'template_id' );
|
303 |
if ( ! empty( $template_id ) && 'duplicate-template' === $action ) {
|
304 |
+
// duplicate tempalte
|
305 |
$this->duplicate_in_db( $template_id );
|
306 |
// $location = admin_url( 'post.php?post='.$duplicate_template_id.'&action=edit');
|
307 |
$location = admin_url( 'edit.php?post_type=es_template' );
|
310 |
}
|
311 |
}
|
312 |
|
313 |
+
public function duplicate_in_db( $original_id ) {
|
314 |
// Get access to the database
|
315 |
global $wpdb;
|
316 |
// Get the post as an array
|
321 |
// Set the post date
|
322 |
$timestamp = current_time( 'timestamp', 0 );
|
323 |
|
324 |
+
$duplicate['post_date'] = gmdate( 'Y-m-d H:i:s', $timestamp );
|
325 |
|
326 |
// Remove some of the keys
|
327 |
unset( $duplicate['ID'] );
|
329 |
unset( $duplicate['comment_count'] );
|
330 |
|
331 |
$current_user_id = get_current_user_id();
|
332 |
+
if ( ! empty( $current_user_id ) ) {
|
333 |
// Set post author to current logged in author.
|
334 |
$duplicate['post_author'] = $current_user_id;
|
335 |
}
|
lite/includes/classes/class-es-tools.php
CHANGED
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
16 |
*/
|
17 |
class ES_Tools {
|
18 |
// class instance
|
19 |
-
static $instance;
|
20 |
|
21 |
public function __construct() {
|
22 |
// Allow only to send test email to user who have Settings & Campaigns permission
|
@@ -35,25 +35,24 @@ class ES_Tools {
|
|
35 |
public function send_test_email() {
|
36 |
|
37 |
$response = array();
|
38 |
-
|
39 |
$email = sanitize_email( ig_es_get_request_data( 'es_test_email' ) );
|
40 |
|
41 |
$subject = ig_es_get_post_data( 'subject', '' );
|
42 |
-
$content = wp_kses_post(ig_es_get_request_data( 'content', '', false ));
|
43 |
|
44 |
if ( ! empty( $email ) ) {
|
45 |
|
46 |
if ( ! empty( $content ) ) {
|
47 |
-
$content = str_replace(
|
48 |
-
$content = str_replace(
|
49 |
}
|
50 |
|
51 |
$response = ES()->mailer->send_test_email( $email, $subject, $content );
|
52 |
|
53 |
-
if ( $response && $response['status']
|
54 |
$response['message'] = __( 'Email has been sent. Please check your inbox', 'email-subscribers' );
|
55 |
}
|
56 |
-
|
57 |
}
|
58 |
|
59 |
echo json_encode( $response );
|
@@ -69,4 +68,4 @@ class ES_Tools {
|
|
69 |
}
|
70 |
}
|
71 |
|
72 |
-
|
16 |
*/
|
17 |
class ES_Tools {
|
18 |
// class instance
|
19 |
+
public static $instance;
|
20 |
|
21 |
public function __construct() {
|
22 |
// Allow only to send test email to user who have Settings & Campaigns permission
|
35 |
public function send_test_email() {
|
36 |
|
37 |
$response = array();
|
38 |
+
|
39 |
$email = sanitize_email( ig_es_get_request_data( 'es_test_email' ) );
|
40 |
|
41 |
$subject = ig_es_get_post_data( 'subject', '' );
|
42 |
+
$content = wp_kses_post( ig_es_get_request_data( 'content', '', false ) );
|
43 |
|
44 |
if ( ! empty( $email ) ) {
|
45 |
|
46 |
if ( ! empty( $content ) ) {
|
47 |
+
$content = str_replace( '{{EMAIL}}', 'User Email', $content );
|
48 |
+
$content = str_replace( '{{NAME}}', 'Username', $content );
|
49 |
}
|
50 |
|
51 |
$response = ES()->mailer->send_test_email( $email, $subject, $content );
|
52 |
|
53 |
+
if ( $response && 'SUCCESS' === $response['status'] ) {
|
54 |
$response['message'] = __( 'Email has been sent. Please check your inbox', 'email-subscribers' );
|
55 |
}
|
|
|
56 |
}
|
57 |
|
58 |
echo json_encode( $response );
|
68 |
}
|
69 |
}
|
70 |
|
71 |
+
|
lite/includes/classes/class-es-widget.php
CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
class ES_Widget extends WP_Widget {
|
9 |
|
10 |
-
function __construct() {
|
11 |
parent::__construct( 'email_subscriber_widget', __( 'Email Subscribers Widget', 'email-subscribers' ), array( 'description' => __( 'Email Subscribers', 'email-subscribers' ) ) );
|
12 |
}
|
13 |
|
@@ -15,10 +15,10 @@ class ES_Widget extends WP_Widget {
|
|
15 |
|
16 |
$title = apply_filters( 'widget_title', $instance['title'] );
|
17 |
|
18 |
-
echo $args['before_widget'];
|
19 |
|
20 |
if ( ! empty( $title ) ) {
|
21 |
-
echo $args['before_title'] . $title . $args['after_title'];
|
22 |
}
|
23 |
|
24 |
$display_name = isset( $instance['display_name'] ) ? esc_attr( $instance['display_name'] ) : '';
|
@@ -36,7 +36,7 @@ class ES_Widget extends WP_Widget {
|
|
36 |
|
37 |
ES_Shortcode::render_form( $data );
|
38 |
|
39 |
-
echo $args['after_widget'];
|
40 |
}
|
41 |
|
42 |
public function form( $instance ) {
|
@@ -46,32 +46,39 @@ class ES_Widget extends WP_Widget {
|
|
46 |
$display_name = isset( $instance['display_name'] ) ? esc_attr( $instance['display_name'] ) : '';
|
47 |
$subscribers_group = isset( $instance['subscribers_group'] ) ? esc_attr( $instance['subscribers_group'] ) : '';
|
48 |
|
49 |
-
$display_names = array(
|
|
|
|
|
|
|
50 |
|
51 |
?>
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
<?php foreach ( $display_names as $name ) { ?>
|
65 |
-
|
66 |
<?php } ?>
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
<?php
|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
75 |
<?php
|
76 |
}
|
77 |
|
@@ -84,4 +91,4 @@ class ES_Widget extends WP_Widget {
|
|
84 |
|
85 |
return $instance;
|
86 |
}
|
87 |
-
}
|
7 |
|
8 |
class ES_Widget extends WP_Widget {
|
9 |
|
10 |
+
public function __construct() {
|
11 |
parent::__construct( 'email_subscriber_widget', __( 'Email Subscribers Widget', 'email-subscribers' ), array( 'description' => __( 'Email Subscribers', 'email-subscribers' ) ) );
|
12 |
}
|
13 |
|
15 |
|
16 |
$title = apply_filters( 'widget_title', $instance['title'] );
|
17 |
|
18 |
+
echo wp_kses_post( $args['before_widget'] );
|
19 |
|
20 |
if ( ! empty( $title ) ) {
|
21 |
+
echo wp_kses_post( sprintf( '%s %s %s', $args['before_title'] . $title . $args['after_title'] ) );
|
22 |
}
|
23 |
|
24 |
$display_name = isset( $instance['display_name'] ) ? esc_attr( $instance['display_name'] ) : '';
|
36 |
|
37 |
ES_Shortcode::render_form( $data );
|
38 |
|
39 |
+
echo wp_kses_post( $args['after_widget'] );
|
40 |
}
|
41 |
|
42 |
public function form( $instance ) {
|
46 |
$display_name = isset( $instance['display_name'] ) ? esc_attr( $instance['display_name'] ) : '';
|
47 |
$subscribers_group = isset( $instance['subscribers_group'] ) ? esc_attr( $instance['subscribers_group'] ) : '';
|
48 |
|
49 |
+
$display_names = array(
|
50 |
+
'yes' => __( 'Yes', 'email-subscribers' ),
|
51 |
+
'no' => __( 'No', 'email-subscribers' ),
|
52 |
+
);
|
53 |
|
54 |
?>
|
55 |
|
56 |
+
<p>
|
57 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Widget Title:' ); ?></label>
|
58 |
+
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
|
59 |
+
</p>
|
60 |
+
<p>
|
61 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'short_desc' ) ); ?>"><?php esc_html_e( 'Short description' ); ?></label>
|
62 |
+
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'short_desc' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'short_desc' ) ); ?>" type="text" value="<?php echo esc_attr( $short_desc ); ?>">
|
63 |
+
</p>
|
64 |
+
<p>
|
65 |
+
<label for="widget-email-subscribers-2-es_name"><?php esc_html_e( 'Display Name Field' ); ?></label>
|
66 |
+
<select id="<?php echo esc_attr( $this->get_field_id( 'display_name' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'display_name' ) ); ?>" class="widefat" style="width:100%;">
|
67 |
<?php foreach ( $display_names as $name ) { ?>
|
68 |
+
<option <?php selected( $display_name, $name ); ?> value="<?php echo esc_attr( $name ); ?>"><?php echo esc_html( $name ); ?></option>
|
69 |
<?php } ?>
|
70 |
+
</select>
|
71 |
+
</p>
|
72 |
+
<p>
|
73 |
+
<label for="widget-email-subscribers-2-es_group"><?php esc_html_e( 'Subscriber List' ); ?></label>
|
74 |
+
<select id="<?php echo esc_attr( $this->get_field_id( 'subscribers_group' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'subscribers_group' ) ); ?>" class="widefat" style="width:100%;">
|
75 |
+
<?php
|
76 |
+
$lists_dropdown = ES_Common::prepare_list_dropdown_options( $subscribers_group );
|
77 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
78 |
+
echo wp_kses( $lists_dropdown , $allowedtags );
|
79 |
+
?>
|
80 |
+
</select>
|
81 |
+
</p>
|
82 |
<?php
|
83 |
}
|
84 |
|
91 |
|
92 |
return $instance;
|
93 |
}
|
94 |
+
}
|
lite/includes/db/class-es-db-actions.php
CHANGED
@@ -6,18 +6,26 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
|
7 |
class ES_DB_Actions extends ES_DB {
|
8 |
/**
|
|
|
|
|
9 |
* @since 4.2.1
|
10 |
* @var $table_name
|
11 |
*
|
12 |
*/
|
13 |
public $table_name;
|
|
|
14 |
/**
|
|
|
|
|
15 |
* @since 4.2.1
|
16 |
* @var $version
|
17 |
*
|
18 |
*/
|
19 |
public $version;
|
|
|
20 |
/**
|
|
|
|
|
21 |
* @since 4.2.1
|
22 |
* @var $primary_key
|
23 |
*
|
@@ -102,12 +110,12 @@ class ES_DB_Actions extends ES_DB {
|
|
102 |
*/
|
103 |
public function add( $args, $explicit = true ) {
|
104 |
|
105 |
-
global $wpdb;
|
106 |
|
107 |
$ig_actions_table = IG_ACTIONS_TABLE;
|
108 |
|
109 |
$args_keys = array_keys( $args );
|
110 |
-
$args_keys_str = implode(
|
111 |
|
112 |
$sql = "INSERT INTO $ig_actions_table ($args_keys_str)";
|
113 |
|
@@ -118,9 +126,9 @@ class ES_DB_Actions extends ES_DB {
|
|
118 |
|
119 |
$sql .= " VALUES ($args_values_str) ON DUPLICATE KEY UPDATE";
|
120 |
|
121 |
-
$sql .= ( $explicit ) ? $wpdb->prepare(
|
122 |
|
123 |
-
$result = $
|
124 |
|
125 |
if ( false !== $result ) {
|
126 |
return true;
|
@@ -141,24 +149,50 @@ class ES_DB_Actions extends ES_DB {
|
|
141 |
public function get_total_contacts_clicks_links( $days = 0, $distinct = true ) {
|
142 |
global $wpdb;
|
143 |
|
144 |
-
$
|
|
|
|
|
145 |
|
|
|
146 |
if ( $distinct ) {
|
147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
} else {
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
151 |
|
152 |
-
$
|
153 |
-
|
154 |
-
if ( 0 != $days ) {
|
155 |
-
$days = esc_sql( $days );
|
156 |
-
$where = " AND created_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))";
|
157 |
-
$query .= $where;
|
158 |
-
$args[] = $days;
|
159 |
-
}
|
160 |
-
|
161 |
-
return $wpdb->get_var( $wpdb->prepare( $query, $args ) );
|
162 |
}
|
163 |
|
164 |
/**
|
@@ -173,24 +207,50 @@ class ES_DB_Actions extends ES_DB {
|
|
173 |
public function get_total_contact_lost( $days = 0, $distinct = true ) {
|
174 |
global $wpdb;
|
175 |
|
176 |
-
$
|
|
|
|
|
177 |
|
|
|
178 |
if ( $distinct ) {
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
} else {
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
}
|
192 |
|
193 |
-
return $
|
194 |
}
|
195 |
|
196 |
|
@@ -207,24 +267,50 @@ class ES_DB_Actions extends ES_DB {
|
|
207 |
public function get_total_contacts_opened_message( $days = 0, $distinct = true ) {
|
208 |
global $wpdb;
|
209 |
|
210 |
-
$
|
|
|
|
|
211 |
|
|
|
212 |
if ( $distinct ) {
|
213 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
} else {
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
}
|
226 |
|
227 |
-
return $
|
228 |
}
|
229 |
|
230 |
/**
|
@@ -239,24 +325,50 @@ class ES_DB_Actions extends ES_DB {
|
|
239 |
public function get_total_emails_sent( $days = 0, $distinct = true ) {
|
240 |
global $wpdb;
|
241 |
|
242 |
-
$
|
|
|
|
|
243 |
|
|
|
244 |
if ( $distinct ) {
|
245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
} else {
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
}
|
258 |
|
259 |
-
return $
|
260 |
}
|
261 |
|
262 |
/**
|
@@ -269,17 +381,28 @@ class ES_DB_Actions extends ES_DB {
|
|
269 |
public function get_count_based_on_id_type( $campaign_id, $type, $distinct = true ) {
|
270 |
global $wpdb;
|
271 |
|
272 |
-
$
|
273 |
-
|
|
|
|
|
274 |
|
275 |
-
|
276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
} else {
|
278 |
-
$
|
|
|
|
|
|
|
|
|
|
|
279 |
}
|
280 |
-
$args[] = $campaign_id;
|
281 |
-
$args[] = $type;
|
282 |
|
283 |
-
|
284 |
}
|
285 |
}
|
6 |
|
7 |
class ES_DB_Actions extends ES_DB {
|
8 |
/**
|
9 |
+
* Table Name
|
10 |
+
*
|
11 |
* @since 4.2.1
|
12 |
* @var $table_name
|
13 |
*
|
14 |
*/
|
15 |
public $table_name;
|
16 |
+
|
17 |
/**
|
18 |
+
* Version
|
19 |
+
*
|
20 |
* @since 4.2.1
|
21 |
* @var $version
|
22 |
*
|
23 |
*/
|
24 |
public $version;
|
25 |
+
|
26 |
/**
|
27 |
+
* Primary Key
|
28 |
+
*
|
29 |
* @since 4.2.1
|
30 |
* @var $primary_key
|
31 |
*
|
110 |
*/
|
111 |
public function add( $args, $explicit = true ) {
|
112 |
|
113 |
+
global $wpdb, $wpbd;
|
114 |
|
115 |
$ig_actions_table = IG_ACTIONS_TABLE;
|
116 |
|
117 |
$args_keys = array_keys( $args );
|
118 |
+
$args_keys_str = implode( ', ', $args_keys );
|
119 |
|
120 |
$sql = "INSERT INTO $ig_actions_table ($args_keys_str)";
|
121 |
|
126 |
|
127 |
$sql .= " VALUES ($args_values_str) ON DUPLICATE KEY UPDATE";
|
128 |
|
129 |
+
$sql .= ( $explicit ) ? $wpdb->prepare( ' created_at = created_at, count = count+1, updated_at = %d, ip = %s, country = %s, browser = %s, device = %s, os = %s, email_client = %s', ig_es_get_current_gmt_timestamp(), $args['ip'], $args['country'], $args['browser'], $args['device'], $args['os'], $args['email_client'] ) : ' count = values(count)';
|
130 |
|
131 |
+
$result = $wpbd->query( $sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
|
132 |
|
133 |
if ( false !== $result ) {
|
134 |
return true;
|
149 |
public function get_total_contacts_clicks_links( $days = 0, $distinct = true ) {
|
150 |
global $wpdb;
|
151 |
|
152 |
+
$args = array(
|
153 |
+
IG_LINK_CLICK
|
154 |
+
);
|
155 |
|
156 |
+
$total_contacts_clicked = 0;
|
157 |
if ( $distinct ) {
|
158 |
+
if ( 0 != $days ) {
|
159 |
+
$days = esc_sql( $days );
|
160 |
+
$args[] = $days;
|
161 |
+
$total_contacts_clicked = $wpdb->get_var(
|
162 |
+
$wpdb->prepare(
|
163 |
+
"SELECT COUNT(DISTINCT(`contact_id`)) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d AND created_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))",
|
164 |
+
$args
|
165 |
+
)
|
166 |
+
);
|
167 |
+
} else {
|
168 |
+
$total_contacts_clicked = $wpdb->get_var(
|
169 |
+
$wpdb->prepare(
|
170 |
+
"SELECT COUNT(DISTINCT(`contact_id`)) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d",
|
171 |
+
$args
|
172 |
+
)
|
173 |
+
);
|
174 |
+
}
|
175 |
} else {
|
176 |
+
if ( 0 != $days ) {
|
177 |
+
$days = esc_sql( $days );
|
178 |
+
$args[] = $days;
|
179 |
+
$total_contacts_clicked = $wpdb->get_var(
|
180 |
+
$wpdb->prepare(
|
181 |
+
"SELECT COUNT(`contact_id`) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d AND created_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))",
|
182 |
+
$args
|
183 |
+
)
|
184 |
+
);
|
185 |
+
} else {
|
186 |
+
$total_contacts_clicked = $wpdb->get_var(
|
187 |
+
$wpdb->prepare(
|
188 |
+
"SELECT COUNT(`contact_id`) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d",
|
189 |
+
$args
|
190 |
+
)
|
191 |
+
);
|
192 |
+
}
|
193 |
}
|
194 |
|
195 |
+
return $total_contacts_clicked;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
}
|
197 |
|
198 |
/**
|
207 |
public function get_total_contact_lost( $days = 0, $distinct = true ) {
|
208 |
global $wpdb;
|
209 |
|
210 |
+
$args = array(
|
211 |
+
IG_CONTACT_UNSUBSCRIBE
|
212 |
+
);
|
213 |
|
214 |
+
$total_emails_unsubscribed = 0;
|
215 |
if ( $distinct ) {
|
216 |
+
if ( 0 != $days ) {
|
217 |
+
$days = esc_sql( $days );
|
218 |
+
$args[] = $days;
|
219 |
+
$total_emails_unsubscribed = $wpdb->get_var(
|
220 |
+
$wpdb->prepare(
|
221 |
+
"SELECT COUNT(DISTINCT(`contact_id`)) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d AND created_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))",
|
222 |
+
$args
|
223 |
+
)
|
224 |
+
);
|
225 |
+
} else {
|
226 |
+
$total_emails_unsubscribed = $wpdb->get_var(
|
227 |
+
$wpdb->prepare(
|
228 |
+
"SELECT COUNT(DISTINCT(`contact_id`)) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d",
|
229 |
+
$args
|
230 |
+
)
|
231 |
+
);
|
232 |
+
}
|
233 |
} else {
|
234 |
+
if ( 0 != $days ) {
|
235 |
+
$days = esc_sql( $days );
|
236 |
+
$args[] = $days;
|
237 |
+
$total_emails_unsubscribed = $wpdb->get_var(
|
238 |
+
$wpdb->prepare(
|
239 |
+
"SELECT COUNT(`contact_id`) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d AND created_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))",
|
240 |
+
$args
|
241 |
+
)
|
242 |
+
);
|
243 |
+
} else {
|
244 |
+
$total_emails_unsubscribed = $wpdb->get_var(
|
245 |
+
$wpdb->prepare(
|
246 |
+
"SELECT COUNT(`contact_id`) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d",
|
247 |
+
$args
|
248 |
+
)
|
249 |
+
);
|
250 |
+
}
|
251 |
}
|
252 |
|
253 |
+
return $total_emails_unsubscribed;
|
254 |
}
|
255 |
|
256 |
|
267 |
public function get_total_contacts_opened_message( $days = 0, $distinct = true ) {
|
268 |
global $wpdb;
|
269 |
|
270 |
+
$args = array(
|
271 |
+
IG_MESSAGE_OPEN
|
272 |
+
);
|
273 |
|
274 |
+
$total_emails_opened = 0;
|
275 |
if ( $distinct ) {
|
276 |
+
if ( 0 != $days ) {
|
277 |
+
$days = esc_sql( $days );
|
278 |
+
$args[] = $days;
|
279 |
+
$total_emails_opened = $wpdb->get_var(
|
280 |
+
$wpdb->prepare(
|
281 |
+
"SELECT COUNT(DISTINCT(`contact_id`)) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d AND created_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))",
|
282 |
+
$args
|
283 |
+
)
|
284 |
+
);
|
285 |
+
} else {
|
286 |
+
$total_emails_opened = $wpdb->get_var(
|
287 |
+
$wpdb->prepare(
|
288 |
+
"SELECT COUNT(DISTINCT(`contact_id`)) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d",
|
289 |
+
$args
|
290 |
+
)
|
291 |
+
);
|
292 |
+
}
|
293 |
} else {
|
294 |
+
if ( 0 != $days ) {
|
295 |
+
$days = esc_sql( $days );
|
296 |
+
$args[] = $days;
|
297 |
+
$total_emails_opened = $wpdb->get_var(
|
298 |
+
$wpdb->prepare(
|
299 |
+
"SELECT COUNT(`contact_id`) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d AND created_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))",
|
300 |
+
$args
|
301 |
+
)
|
302 |
+
);
|
303 |
+
} else {
|
304 |
+
$total_emails_opened = $wpdb->get_var(
|
305 |
+
$wpdb->prepare(
|
306 |
+
"SELECT COUNT(`contact_id`) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d",
|
307 |
+
$args
|
308 |
+
)
|
309 |
+
);
|
310 |
+
}
|
311 |
}
|
312 |
|
313 |
+
return $total_emails_opened;
|
314 |
}
|
315 |
|
316 |
/**
|
325 |
public function get_total_emails_sent( $days = 0, $distinct = true ) {
|
326 |
global $wpdb;
|
327 |
|
328 |
+
$args = array(
|
329 |
+
IG_MESSAGE_SENT
|
330 |
+
);
|
331 |
|
332 |
+
$total_emails_sent = 0;
|
333 |
if ( $distinct ) {
|
334 |
+
if ( 0 != $days ) {
|
335 |
+
$days = esc_sql( $days );
|
336 |
+
$args[] = $days;
|
337 |
+
$total_emails_sent = $wpdb->get_var(
|
338 |
+
$wpdb->prepare(
|
339 |
+
"SELECT COUNT(DISTINCT(`contact_id`)) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d AND created_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))",
|
340 |
+
$args
|
341 |
+
)
|
342 |
+
);
|
343 |
+
} else {
|
344 |
+
$total_emails_sent = $wpdb->get_var(
|
345 |
+
$wpdb->prepare(
|
346 |
+
"SELECT COUNT(DISTINCT(`contact_id`)) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d",
|
347 |
+
$args
|
348 |
+
)
|
349 |
+
);
|
350 |
+
}
|
351 |
} else {
|
352 |
+
if ( 0 != $days ) {
|
353 |
+
$days = esc_sql( $days );
|
354 |
+
$args[] = $days;
|
355 |
+
$total_emails_sent = $wpdb->get_var(
|
356 |
+
$wpdb->prepare(
|
357 |
+
"SELECT COUNT(`contact_id`) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d AND created_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL %d DAY))",
|
358 |
+
$args
|
359 |
+
)
|
360 |
+
);
|
361 |
+
} else {
|
362 |
+
$total_emails_sent = $wpdb->get_var(
|
363 |
+
$wpdb->prepare(
|
364 |
+
"SELECT COUNT(`contact_id`) FROM {$wpdb->prefix}ig_actions WHERE `type` = %d",
|
365 |
+
$args
|
366 |
+
)
|
367 |
+
);
|
368 |
+
}
|
369 |
}
|
370 |
|
371 |
+
return $total_emails_sent;
|
372 |
}
|
373 |
|
374 |
/**
|
381 |
public function get_count_based_on_id_type( $campaign_id, $type, $distinct = true ) {
|
382 |
global $wpdb;
|
383 |
|
384 |
+
$args = array();
|
385 |
+
|
386 |
+
$args[] = $campaign_id;
|
387 |
+
$args[] = $type;
|
388 |
|
389 |
+
$count = 0;
|
390 |
+
if ( $distinct ) {
|
391 |
+
$count = $wpdb->get_var(
|
392 |
+
$wpdb->prepare(
|
393 |
+
"SELECT COUNT(DISTINCT(`contact_id`)) as count FROM {$wpdb->prefix}ig_actions WHERE `campaign_id`= %d AND `type` = %d",
|
394 |
+
$args
|
395 |
+
)
|
396 |
+
);
|
397 |
} else {
|
398 |
+
$count = $wpdb->get_var(
|
399 |
+
$wpdb->prepare(
|
400 |
+
"SELECT COUNT(`contact_id`) as count FROM {$wpdb->prefix}ig_actions WHERE `campaign_id`= %d AND `type` = %d",
|
401 |
+
$args
|
402 |
+
)
|
403 |
+
);
|
404 |
}
|
|
|
|
|
405 |
|
406 |
+
return $count;
|
407 |
}
|
408 |
}
|
lite/includes/db/class-es-db-blocked-emails.php
CHANGED
@@ -7,21 +7,29 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
7 |
|
8 |
class ES_DB_Blocked_Emails extends ES_DB {
|
9 |
/**
|
|
|
|
|
10 |
* @since 4.2.2
|
11 |
-
* @var $table_name
|
12 |
*
|
|
|
13 |
*/
|
14 |
public $table_name;
|
15 |
|
16 |
/**
|
|
|
|
|
17 |
* @since 4.2.2
|
|
|
18 |
* @var $version
|
19 |
*
|
20 |
*/
|
21 |
public $version;
|
22 |
|
23 |
/**
|
|
|
|
|
24 |
* @since 4.2.2
|
|
|
25 |
* @var $primary_key
|
26 |
*
|
27 |
*/
|
7 |
|
8 |
class ES_DB_Blocked_Emails extends ES_DB {
|
9 |
/**
|
10 |
+
* Table Name
|
11 |
+
*
|
12 |
* @since 4.2.2
|
|
|
13 |
*
|
14 |
+
* @var $table_name
|
15 |
*/
|
16 |
public $table_name;
|
17 |
|
18 |
/**
|
19 |
+
* Version
|
20 |
+
*
|
21 |
* @since 4.2.2
|
22 |
+
*
|
23 |
* @var $version
|
24 |
*
|
25 |
*/
|
26 |
public $version;
|
27 |
|
28 |
/**
|
29 |
+
* Primary Key
|
30 |
+
*
|
31 |
* @since 4.2.2
|
32 |
+
*
|
33 |
* @var $primary_key
|
34 |
*
|
35 |
*/
|
lite/includes/db/class-es-db-campaigns.php
CHANGED
@@ -11,6 +11,8 @@ class ES_DB_Campaigns extends ES_DB {
|
|
11 |
|
12 |
const STATUS_INACTIVE = 0;
|
13 |
/**
|
|
|
|
|
14 |
* @since 4.2.1
|
15 |
* @var string $table_name
|
16 |
*
|
@@ -18,6 +20,8 @@ class ES_DB_Campaigns extends ES_DB {
|
|
18 |
public $table_name;
|
19 |
|
20 |
/**
|
|
|
|
|
21 |
* @since 4.2.1
|
22 |
* @var string $version
|
23 |
*
|
@@ -25,6 +29,8 @@ class ES_DB_Campaigns extends ES_DB {
|
|
25 |
public $version;
|
26 |
|
27 |
/**
|
|
|
|
|
28 |
* @since 4.2.1
|
29 |
* @var string
|
30 |
*
|
@@ -122,6 +128,8 @@ class ES_DB_Campaigns extends ES_DB {
|
|
122 |
}
|
123 |
|
124 |
/**
|
|
|
|
|
125 |
* @param $data
|
126 |
* @param null $id
|
127 |
*
|
@@ -180,8 +188,9 @@ class ES_DB_Campaigns extends ES_DB {
|
|
180 |
$from_email = ES_Common::get_ig_option( 'from_email' );
|
181 |
$list_is_name_map = ES()->lists_db->get_list_id_name_map( '', true );
|
182 |
|
183 |
-
$
|
184 |
-
|
|
|
185 |
|
186 |
if ( $total > 0 ) {
|
187 |
$batch_size = IG_DEFAULT_BATCH_SIZE;
|
@@ -189,9 +198,10 @@ class ES_DB_Campaigns extends ES_DB {
|
|
189 |
$total_batches = ( $total > IG_DEFAULT_BATCH_SIZE ) ? ceil( $total / $batch_size ) : 1;
|
190 |
|
191 |
for ( $i = 0; $i < $total_batches; $i ++ ) {
|
192 |
-
$batch_start
|
193 |
-
|
194 |
-
|
|
|
195 |
if ( count( $notifications ) > 0 ) {
|
196 |
foreach ( $notifications as $key => $notification ) {
|
197 |
$categories = ! empty( $notification['es_note_cat'] ) ? $notification['es_note_cat'] : '';
|
@@ -220,7 +230,7 @@ class ES_DB_Campaigns extends ES_DB {
|
|
220 |
$campaigns_data[ $key ]['categories'] = $categories;
|
221 |
$campaigns_data[ $key ]['list_ids'] = ( ! empty( $notification['es_note_group'] ) && ! empty( $list_is_name_map[ $notification['es_note_group'] ] ) ) ? $list_is_name_map[ $notification['es_note_group'] ] : 0;
|
222 |
$campaigns_data[ $key ]['base_template_id'] = $template_id;
|
223 |
-
$campaigns_data[ $key ]['status'] = ( ! empty( $notification['es_note_status'] ) && $notification['es_note_status']
|
224 |
$campaigns_data[ $key ]['created_at'] = ig_get_current_date_time();
|
225 |
$campaigns_data[ $key ]['updated_at'] = null;
|
226 |
$campaigns_data[ $key ]['deleted_at'] = null;
|
@@ -229,17 +239,22 @@ class ES_DB_Campaigns extends ES_DB {
|
|
229 |
$templates_data = array();
|
230 |
// Get Template Name & Slug
|
231 |
if ( count( $template_ids ) > 0 ) {
|
232 |
-
|
233 |
-
|
234 |
-
|
|
|
|
|
|
|
|
|
235 |
foreach ( $templates as $template ) {
|
236 |
$templates_data[ $template['ID'] ] = $template;
|
237 |
}
|
238 |
}
|
239 |
|
240 |
//Do Batach Insert
|
241 |
-
$values
|
242 |
-
$
|
|
|
243 |
unset( $columns['id'] );
|
244 |
$fields = array_keys( $columns );
|
245 |
|
@@ -255,7 +270,7 @@ class ES_DB_Campaigns extends ES_DB {
|
|
255 |
$formats[] = $format;
|
256 |
}
|
257 |
|
258 |
-
$place_holders[] =
|
259 |
}
|
260 |
|
261 |
ES_DB::do_insert( IG_CAMPAIGNS_TABLE, $fields, $place_holders, $values );
|
@@ -275,8 +290,7 @@ class ES_DB_Campaigns extends ES_DB {
|
|
275 |
$from_name = ES_Common::get_ig_option( 'from_name' );
|
276 |
$from_email = ES_Common::get_ig_option( 'from_email' );
|
277 |
|
278 |
-
$
|
279 |
-
$total = $wpdb->get_var( $query );
|
280 |
|
281 |
if ( $total > 0 ) {
|
282 |
|
@@ -284,18 +298,20 @@ class ES_DB_Campaigns extends ES_DB {
|
|
284 |
$batch_size = IG_DEFAULT_BATCH_SIZE;
|
285 |
$total_batches = ceil( $total / $batch_size );
|
286 |
|
287 |
-
$values
|
288 |
-
$
|
|
|
289 |
unset( $columns['id'] );
|
290 |
$fields = array_keys( $columns );
|
291 |
for ( $i = 0; $i <= $total_batches; $i ++ ) {
|
292 |
$batch_start = $i * $batch_size;
|
293 |
|
294 |
-
$
|
295 |
-
$newsletters = $wpdb->get_results( $query, ARRAY_A );
|
296 |
|
297 |
if ( count( $newsletters ) > 0 ) {
|
298 |
-
$campaign_data =
|
|
|
|
|
299 |
foreach ( $newsletters as $key => $newsletter ) {
|
300 |
$campaign_data['slug'] = sanitize_title( $newsletter['es_sent_subject'] );
|
301 |
$campaign_data['name'] = $newsletter['es_sent_subject'];
|
@@ -316,7 +332,7 @@ class ES_DB_Campaigns extends ES_DB {
|
|
316 |
$formats[] = $format;
|
317 |
}
|
318 |
|
319 |
-
$place_holders[] =
|
320 |
}
|
321 |
|
322 |
ES_DB::do_insert( IG_CAMPAIGNS_TABLE, $fields, $place_holders, $values );
|
@@ -333,13 +349,11 @@ class ES_DB_Campaigns extends ES_DB {
|
|
333 |
public function update_campaign_id_in_mailing_queue() {
|
334 |
global $wpdb;
|
335 |
|
336 |
-
$
|
337 |
-
$campaigns = $wpdb->get_results( $sql, ARRAY_A );
|
338 |
|
339 |
$data_to_update = array();
|
340 |
if ( count( $campaigns ) > 0 ) {
|
341 |
-
$
|
342 |
-
$mailing_queue_results = $wpdb->get_results( $sql, ARRAY_A );
|
343 |
if ( count( $mailing_queue_results ) > 0 ) {
|
344 |
foreach ( $mailing_queue_results as $result ) {
|
345 |
$subject = trim( $result['subject'] );
|
@@ -358,9 +372,7 @@ class ES_DB_Campaigns extends ES_DB {
|
|
358 |
|
359 |
if ( ! empty( $data_to_update ) ) {
|
360 |
foreach ( $data_to_update as $mailing_queue_id => $campaign_id ) {
|
361 |
-
$
|
362 |
-
$query = $wpdb->prepare( $sql, array( $campaign_id, $mailing_queue_id ) );
|
363 |
-
$wpdb->query( $query );
|
364 |
}
|
365 |
}
|
366 |
}
|
@@ -389,7 +401,7 @@ class ES_DB_Campaigns extends ES_DB {
|
|
389 |
public function get_total_campaigns_by_type( $type = 'newsletter' ) {
|
390 |
global $wpdb;
|
391 |
|
392 |
-
$where = $wpdb->prepare(
|
393 |
|
394 |
$campaigns = $this->get_total_campaigns( $where );
|
395 |
|
@@ -467,10 +479,10 @@ class ES_DB_Campaigns extends ES_DB {
|
|
467 |
return array();
|
468 |
}
|
469 |
|
470 |
-
$where = $wpdb->prepare(
|
471 |
|
472 |
-
if( -1 !== $status ) {
|
473 |
-
$where .= $wpdb->prepare(
|
474 |
}
|
475 |
|
476 |
$campaigns = $this->get_by_conditions( $where );
|
@@ -525,9 +537,7 @@ class ES_DB_Campaigns extends ES_DB {
|
|
525 |
$where = $wpdb->prepare( "status = %d AND type = %s AND (deleted_at IS NULL OR deleted_at = '0000-00-00 00:00:00')", self::STATUS_ACTIVE, $type );
|
526 |
}
|
527 |
|
528 |
-
|
529 |
-
|
530 |
-
return $campaigns;
|
531 |
}
|
532 |
|
533 |
/**
|
@@ -638,23 +648,23 @@ class ES_DB_Campaigns extends ES_DB {
|
|
638 |
|
639 |
$where = $wpdb->prepare( "status = %d AND type = %s AND (deleted_at IS NULL OR deleted_at = '0000-00-00 00:00:00')", 1, 'post_notification' );
|
640 |
|
641 |
-
if (
|
642 |
$categories = get_the_category( $post_id );
|
643 |
$total_categories = count( $categories );
|
644 |
if ( $total_categories > 0 ) {
|
645 |
for ( $i = 0; $i < $total_categories; $i ++ ) {
|
646 |
-
if ( $i
|
647 |
-
$where .=
|
648 |
} else {
|
649 |
-
$where .=
|
650 |
}
|
651 |
|
652 |
$category_str = ES_Common::prepare_category_string( $categories[ $i ]->term_id );
|
653 |
|
654 |
$where .= " categories LIKE '%" . $category_str . "%'";
|
655 |
-
if (
|
656 |
$where .= " OR categories LIKE '%all%'";
|
657 |
-
$where .=
|
658 |
}
|
659 |
}
|
660 |
} else {
|
@@ -663,7 +673,7 @@ class ES_DB_Campaigns extends ES_DB {
|
|
663 |
}
|
664 |
} else {
|
665 |
$post_type = ES_Common::prepare_custom_post_type_string( $post_type );
|
666 |
-
$where
|
667 |
}
|
668 |
|
669 |
$campaigns = $this->get_by_conditions( $where, ARRAY_A );
|
@@ -701,21 +711,11 @@ class ES_DB_Campaigns extends ES_DB {
|
|
701 |
}
|
702 |
|
703 |
if ( ! empty( $id_str ) ) {
|
704 |
-
$sql = 'UPDATE ' . IG_CAMPAIGNS_TABLE . ' SET status = %d';
|
705 |
-
|
706 |
-
$sql .= " WHERE id IN ($id_str)";
|
707 |
|
708 |
-
$
|
709 |
|
710 |
-
$updated = $wpdb->query( $sql ); // phpcs:ignore
|
711 |
-
|
712 |
//Changing status of child campaigns along with its parent campaign id
|
713 |
-
$query
|
714 |
-
|
715 |
-
$query .= " WHERE parent_id IN ($id_str)";
|
716 |
-
|
717 |
-
$wpdb->query( $wpdb->prepare( $query, $status ) );
|
718 |
-
|
719 |
}
|
720 |
|
721 |
return $updated;
|
11 |
|
12 |
const STATUS_INACTIVE = 0;
|
13 |
/**
|
14 |
+
* Tabl Name
|
15 |
+
*
|
16 |
* @since 4.2.1
|
17 |
* @var string $table_name
|
18 |
*
|
20 |
public $table_name;
|
21 |
|
22 |
/**
|
23 |
+
* Version
|
24 |
+
*
|
25 |
* @since 4.2.1
|
26 |
* @var string $version
|
27 |
*
|
29 |
public $version;
|
30 |
|
31 |
/**
|
32 |
+
* Primary Key
|
33 |
+
*
|
34 |
* @since 4.2.1
|
35 |
* @var string
|
36 |
*
|
128 |
}
|
129 |
|
130 |
/**
|
131 |
+
* Save Campaign
|
132 |
+
*
|
133 |
* @param $data
|
134 |
* @param null $id
|
135 |
*
|
188 |
$from_email = ES_Common::get_ig_option( 'from_email' );
|
189 |
$list_is_name_map = ES()->lists_db->get_list_id_name_map( '', true );
|
190 |
|
191 |
+
$es_notification_table = EMAIL_SUBSCRIBERS_NOTIFICATION_TABLE;
|
192 |
+
|
193 |
+
$total = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) as total FROM {$wpdb->prefix}es_notification WHERE %d", 1 ) );
|
194 |
|
195 |
if ( $total > 0 ) {
|
196 |
$batch_size = IG_DEFAULT_BATCH_SIZE;
|
198 |
$total_batches = ( $total > IG_DEFAULT_BATCH_SIZE ) ? ceil( $total / $batch_size ) : 1;
|
199 |
|
200 |
for ( $i = 0; $i < $total_batches; $i ++ ) {
|
201 |
+
$batch_start = $i * $batch_size;
|
202 |
+
//$query = 'SELECT * FROM ' . EMAIL_SUBSCRIBERS_NOTIFICATION_TABLE . " LIMIT {$batch_start}, {$batch_size}";
|
203 |
+
//$notifications = $wpdb->get_results( $query, ARRAY_A ); // WPCS: cache ok, DB call ok, unprepared SQL ok.
|
204 |
+
$notifications = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}es_notification LIMIT %d, %d", $batch_start, $batch_size ), ARRAY_A );
|
205 |
if ( count( $notifications ) > 0 ) {
|
206 |
foreach ( $notifications as $key => $notification ) {
|
207 |
$categories = ! empty( $notification['es_note_cat'] ) ? $notification['es_note_cat'] : '';
|
230 |
$campaigns_data[ $key ]['categories'] = $categories;
|
231 |
$campaigns_data[ $key ]['list_ids'] = ( ! empty( $notification['es_note_group'] ) && ! empty( $list_is_name_map[ $notification['es_note_group'] ] ) ) ? $list_is_name_map[ $notification['es_note_group'] ] : 0;
|
232 |
$campaigns_data[ $key ]['base_template_id'] = $template_id;
|
233 |
+
$campaigns_data[ $key ]['status'] = ( ! empty( $notification['es_note_status'] ) && ( 'Disable' === $notification['es_note_status'] ) ) ? 0 : 1;
|
234 |
$campaigns_data[ $key ]['created_at'] = ig_get_current_date_time();
|
235 |
$campaigns_data[ $key ]['updated_at'] = null;
|
236 |
$campaigns_data[ $key ]['deleted_at'] = null;
|
239 |
$templates_data = array();
|
240 |
// Get Template Name & Slug
|
241 |
if ( count( $template_ids ) > 0 ) {
|
242 |
+
//$template_ids_str = implode( "', '", $template_ids );
|
243 |
+
//$query = "SELECT ID, post_name, post_title FROM {$wpdb->prefix}posts WHERE id IN ({$template_ids_str})";
|
244 |
+
//$templates = $wpdb->get_results( $query, ARRAY_A );
|
245 |
+
$template_ids_str = implode( ',', $template_ids );
|
246 |
+
|
247 |
+
// We can use IN query only but to make WooCommerce standard compatible, we have used FIND_IN_SET.
|
248 |
+
$templates = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_title FROM {$wpdb->prefix}posts WHERE FIND_IN_SET(ID, %s)", $template_ids_str ), ARRAY_A );
|
249 |
foreach ( $templates as $template ) {
|
250 |
$templates_data[ $template['ID'] ] = $template;
|
251 |
}
|
252 |
}
|
253 |
|
254 |
//Do Batach Insert
|
255 |
+
$values = array();
|
256 |
+
$place_holders = array();
|
257 |
+
$columns = $this->get_columns();
|
258 |
unset( $columns['id'] );
|
259 |
$fields = array_keys( $columns );
|
260 |
|
270 |
$formats[] = $format;
|
271 |
}
|
272 |
|
273 |
+
$place_holders[] = '( ' . implode( ', ', $formats ) . ' )';
|
274 |
}
|
275 |
|
276 |
ES_DB::do_insert( IG_CAMPAIGNS_TABLE, $fields, $place_holders, $values );
|
290 |
$from_name = ES_Common::get_ig_option( 'from_name' );
|
291 |
$from_email = ES_Common::get_ig_option( 'from_email' );
|
292 |
|
293 |
+
$total = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) as total FROM {$wpdb->prefix}es_sentdetails WHERE es_sent_source = %s", 'Newsletter' ) );
|
|
|
294 |
|
295 |
if ( $total > 0 ) {
|
296 |
|
298 |
$batch_size = IG_DEFAULT_BATCH_SIZE;
|
299 |
$total_batches = ceil( $total / $batch_size );
|
300 |
|
301 |
+
$values = array();
|
302 |
+
$place_holders = array();
|
303 |
+
$columns = $this->get_columns();
|
304 |
unset( $columns['id'] );
|
305 |
$fields = array_keys( $columns );
|
306 |
for ( $i = 0; $i <= $total_batches; $i ++ ) {
|
307 |
$batch_start = $i * $batch_size;
|
308 |
|
309 |
+
$newsletters = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}es_sentdetails WHERE es_sent_source = %s LIMIT %d, %d", 'Newsletter', $batch_start, $batch_size ), ARRAY_A );
|
|
|
310 |
|
311 |
if ( count( $newsletters ) > 0 ) {
|
312 |
+
$campaign_data = array();
|
313 |
+
$values = array();
|
314 |
+
$place_holders = array();
|
315 |
foreach ( $newsletters as $key => $newsletter ) {
|
316 |
$campaign_data['slug'] = sanitize_title( $newsletter['es_sent_subject'] );
|
317 |
$campaign_data['name'] = $newsletter['es_sent_subject'];
|
332 |
$formats[] = $format;
|
333 |
}
|
334 |
|
335 |
+
$place_holders[] = '( ' . implode( ', ', $formats ) . ' )';
|
336 |
}
|
337 |
|
338 |
ES_DB::do_insert( IG_CAMPAIGNS_TABLE, $fields, $place_holders, $values );
|
349 |
public function update_campaign_id_in_mailing_queue() {
|
350 |
global $wpdb;
|
351 |
|
352 |
+
$campaigns = $wpdb->get_results( $wpdb->prepare( "SELECT id, name FROM {$wpdb->prefix}ig_campaigns WHERE %d", 1 ), ARRAY_A );
|
|
|
353 |
|
354 |
$data_to_update = array();
|
355 |
if ( count( $campaigns ) > 0 ) {
|
356 |
+
$mailing_queue_results = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}ig_mailing_queue WHERE %d", 1 ), ARRAY_A );
|
|
|
357 |
if ( count( $mailing_queue_results ) > 0 ) {
|
358 |
foreach ( $mailing_queue_results as $result ) {
|
359 |
$subject = trim( $result['subject'] );
|
372 |
|
373 |
if ( ! empty( $data_to_update ) ) {
|
374 |
foreach ( $data_to_update as $mailing_queue_id => $campaign_id ) {
|
375 |
+
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}ig_mailing_queue SET campaign_id = %d WHERE id = %d", array( $campaign_id, $mailing_queue_id ) ) );
|
|
|
|
|
376 |
}
|
377 |
}
|
378 |
}
|
401 |
public function get_total_campaigns_by_type( $type = 'newsletter' ) {
|
402 |
global $wpdb;
|
403 |
|
404 |
+
$where = $wpdb->prepare( 'type = %s', array( $type ) );
|
405 |
|
406 |
$campaigns = $this->get_total_campaigns( $where );
|
407 |
|
479 |
return array();
|
480 |
}
|
481 |
|
482 |
+
$where = $wpdb->prepare( 'id = %d', $id );
|
483 |
|
484 |
+
if ( - 1 !== $status ) {
|
485 |
+
$where .= $wpdb->prepare( ' AND status = %d', $status );
|
486 |
}
|
487 |
|
488 |
$campaigns = $this->get_by_conditions( $where );
|
537 |
$where = $wpdb->prepare( "status = %d AND type = %s AND (deleted_at IS NULL OR deleted_at = '0000-00-00 00:00:00')", self::STATUS_ACTIVE, $type );
|
538 |
}
|
539 |
|
540 |
+
return $this->get_by_conditions( $where );
|
|
|
|
|
541 |
}
|
542 |
|
543 |
/**
|
648 |
|
649 |
$where = $wpdb->prepare( "status = %d AND type = %s AND (deleted_at IS NULL OR deleted_at = '0000-00-00 00:00:00')", 1, 'post_notification' );
|
650 |
|
651 |
+
if ( 'post' === $post_type ) {
|
652 |
$categories = get_the_category( $post_id );
|
653 |
$total_categories = count( $categories );
|
654 |
if ( $total_categories > 0 ) {
|
655 |
for ( $i = 0; $i < $total_categories; $i ++ ) {
|
656 |
+
if ( 0 === $i) {
|
657 |
+
$where .= ' and (';
|
658 |
} else {
|
659 |
+
$where .= ' or';
|
660 |
}
|
661 |
|
662 |
$category_str = ES_Common::prepare_category_string( $categories[ $i ]->term_id );
|
663 |
|
664 |
$where .= " categories LIKE '%" . $category_str . "%'";
|
665 |
+
if ( ( $total_categories - 1 ) === $i ) {
|
666 |
$where .= " OR categories LIKE '%all%'";
|
667 |
+
$where .= ')';
|
668 |
}
|
669 |
}
|
670 |
} else {
|
673 |
}
|
674 |
} else {
|
675 |
$post_type = ES_Common::prepare_custom_post_type_string( $post_type );
|
676 |
+
$where .= " and categories LIKE '%" . wp_specialchars_decode( addslashes( $post_type ) ) . "%'";
|
677 |
}
|
678 |
|
679 |
$campaigns = $this->get_by_conditions( $where, ARRAY_A );
|
711 |
}
|
712 |
|
713 |
if ( ! empty( $id_str ) ) {
|
|
|
|
|
|
|
714 |
|
715 |
+
$updated = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->prefix}ig_campaigns SET status = %d WHERE FIND_IN_SET(id, %s)", $status, $id_str) );
|
716 |
|
|
|
|
|
717 |
//Changing status of child campaigns along with its parent campaign id
|
718 |
+
$wpdb->query( $wpdb->prepare("UPDATE {$wpdb->prefix}ig_campaigns SET status = %d WHERE FIND_IN_SET(parent_id, %s)", $status, $id_str) );
|
|
|
|
|
|
|
|
|
|
|
719 |
}
|
720 |
|
721 |
return $updated;
|
lite/includes/db/class-es-db-contacts.php
CHANGED
@@ -5,19 +5,28 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
5 |
}
|
6 |
|
7 |
class ES_DB_Contacts extends ES_DB {
|
|
|
8 |
/**
|
|
|
|
|
9 |
* @since 4.2.4
|
10 |
* @var $table_name
|
11 |
*
|
12 |
*/
|
13 |
public $table_name;
|
|
|
14 |
/**
|
|
|
|
|
15 |
* @since 4.2.4
|
16 |
* @var $version
|
17 |
*
|
18 |
*/
|
19 |
public $version;
|
|
|
20 |
/**
|
|
|
|
|
21 |
* @since 4.2.4
|
22 |
* @var $primary_key
|
23 |
*
|
@@ -129,11 +138,15 @@ class ES_DB_Contacts extends ES_DB {
|
|
129 |
$subscriber_email_name_map = array();
|
130 |
if ( count( $emails ) > 0 ) {
|
131 |
|
132 |
-
$
|
133 |
|
134 |
-
$
|
135 |
-
|
136 |
-
|
|
|
|
|
|
|
|
|
137 |
|
138 |
if ( count( $subscribers ) > 0 ) {
|
139 |
foreach ( $subscribers as $subscriber ) {
|
@@ -248,15 +261,14 @@ class ES_DB_Contacts extends ES_DB {
|
|
248 |
|
249 |
global $wpdb;
|
250 |
|
251 |
-
$
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
$where = $wpdb->prepare( "id IN (SELECT contact_id FROM $ig_lists_contacts_table WHERE " . $ids_query . " AND status IN ('subscribed', 'confirmed'))", $list_id );
|
258 |
} else {
|
259 |
-
$where = $wpdb->prepare( "id IN (SELECT contact_id FROM $
|
260 |
}
|
261 |
|
262 |
return $this->get_by_conditions( $where );
|
@@ -300,17 +312,23 @@ class ES_DB_Contacts extends ES_DB {
|
|
300 |
|
301 |
global $wpdb;
|
302 |
|
303 |
-
$ig_lists_contacts_table = IG_LISTS_CONTACTS_TABLE;
|
304 |
-
|
305 |
-
$query = $wpdb->prepare( "SELECT count(distinct(contact_id)) as total_subscribers FROM $ig_lists_contacts_table WHERE status = %s", 'subscribed' );
|
306 |
-
|
307 |
if ( ! empty( $list_id ) ) {
|
308 |
-
$
|
309 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
}
|
311 |
|
312 |
-
$subscribers = $wpdb->get_var( $query );
|
313 |
-
|
314 |
return $subscribers;
|
315 |
|
316 |
}
|
@@ -367,15 +385,15 @@ class ES_DB_Contacts extends ES_DB {
|
|
367 |
public function edit_contact_global_status( $ids = array(), $unsubscribed = 0 ) {
|
368 |
global $wpdb;
|
369 |
|
370 |
-
$
|
371 |
-
|
372 |
-
$ids = $this->prepare_for_in_query( $ids );
|
373 |
-
|
374 |
-
$sql = "UPDATE $ig_contacts_table SET unsubscribed = %d WHERE id IN ($ids)";
|
375 |
-
$query = $wpdb->prepare( $sql, $unsubscribed );
|
376 |
-
|
377 |
-
return $wpdb->query( $query );
|
378 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
}
|
380 |
|
381 |
/**
|
@@ -402,14 +420,16 @@ class ES_DB_Contacts extends ES_DB {
|
|
402 |
$list_id = array( $list_id );
|
403 |
}
|
404 |
|
405 |
-
$
|
406 |
|
407 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
|
409 |
-
$list_query = "SELECT count(*) as count FROM $ig_lists_contacts_table WHERE list_id IN ($list_ids_str) AND contact_id = %s";
|
410 |
-
$list_sql = $wpdb->prepare( $list_query, $contact_id );
|
411 |
-
|
412 |
-
$list_contact_count = $wpdb->get_var( $list_sql );
|
413 |
if ( ! empty( $list_contact_count ) ) {
|
414 |
$data['list_id'] = true;
|
415 |
}
|
@@ -430,10 +450,10 @@ class ES_DB_Contacts extends ES_DB {
|
|
430 |
public function get_email_details_map() {
|
431 |
global $wpdb;
|
432 |
|
433 |
-
$
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
$details = array();
|
438 |
if ( count( $contacts ) > 0 ) {
|
439 |
foreach ( $contacts as $contact ) {
|
@@ -484,18 +504,18 @@ class ES_DB_Contacts extends ES_DB {
|
|
484 |
public function get_contact_ids_by_emails( $emails = array() ) {
|
485 |
global $wpdb;
|
486 |
|
487 |
-
$ig_contacts_table = IG_CONTACTS_TABLE;
|
488 |
-
|
489 |
-
$query = "SELECT id FROM $ig_contacts_table";
|
490 |
-
|
491 |
if ( count( $emails ) > 0 ) {
|
492 |
-
$emails_str =
|
493 |
-
|
494 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
}
|
496 |
|
497 |
-
$ids = $wpdb->get_col( $query );
|
498 |
-
|
499 |
return $ids;
|
500 |
}
|
501 |
|
@@ -512,18 +532,19 @@ class ES_DB_Contacts extends ES_DB {
|
|
512 |
public function get_email_id_map( $emails = array() ) {
|
513 |
global $wpdb;
|
514 |
|
515 |
-
$ig_contacts_table = IG_CONTACTS_TABLE;
|
516 |
-
|
517 |
-
$query = "SELECT id, email FROM $ig_contacts_table";
|
518 |
-
|
519 |
if ( count( $emails ) > 0 ) {
|
520 |
-
$emails_str =
|
521 |
-
|
522 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
}
|
524 |
|
525 |
-
$results = $wpdb->get_results( $query, ARRAY_A );
|
526 |
-
|
527 |
$map = array();
|
528 |
if ( count( $results ) > 0 ) {
|
529 |
foreach ( $results as $result ) {
|
@@ -558,11 +579,9 @@ class ES_DB_Contacts extends ES_DB {
|
|
558 |
*/
|
559 |
public function migrate_subscribers_from_older_version() {
|
560 |
global $wpdb;
|
561 |
-
|
562 |
-
$es_email_list_table = ES_EMAILLIST_TABLE;
|
563 |
//Get Total count of subscribers
|
564 |
-
$
|
565 |
-
$total = $wpdb->get_var( $query );
|
566 |
|
567 |
// If we have subscribers?
|
568 |
if ( $total > 0 ) {
|
@@ -581,8 +600,14 @@ class ES_DB_Contacts extends ES_DB {
|
|
581 |
$j = 0;
|
582 |
for ( $i = 0; $i < $total_batches; $i ++ ) {
|
583 |
$batch_start = $i * $batch_size;
|
584 |
-
$
|
585 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
586 |
if ( count( $results ) > 0 ) {
|
587 |
$contacts = array();
|
588 |
foreach ( $results as $key => $result ) {
|
@@ -609,7 +634,7 @@ class ES_DB_Contacts extends ES_DB {
|
|
609 |
$contacts[ $key ]['email'] = $email;
|
610 |
$contacts[ $key ]['source'] = 'Migrated';
|
611 |
$contacts[ $key ]['status'] = ( 'spam' === strtolower( $result['es_email_status'] ) ) ? 'spam' : 'verified';
|
612 |
-
$contacts[ $key ]['unsubscribed'] = ( $result['es_email_status']
|
613 |
$contacts[ $key ]['hash'] = $result['es_email_guid'];
|
614 |
$contacts[ $key ]['created_at'] = $result['es_email_created'];
|
615 |
$contacts[ $key ]['updated_at'] = ig_get_current_date_time();
|
@@ -659,26 +684,50 @@ class ES_DB_Contacts extends ES_DB {
|
|
659 |
public function edit_list_contact_status( $contact_ids, $list_ids, $status ) {
|
660 |
global $wpdb;
|
661 |
|
662 |
-
$contact_ids
|
663 |
-
|
664 |
-
$list_ids = $this->prepare_for_in_query( $list_ids );
|
665 |
-
|
666 |
$current_date = ig_get_current_date_time();
|
667 |
|
668 |
-
$
|
669 |
-
|
670 |
if ( 'subscribed' === $status ) {
|
671 |
-
$
|
672 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
} elseif ( 'unsubscribed' === $status ) {
|
674 |
-
$
|
675 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
} elseif ( 'unconfirmed' === $status ) {
|
677 |
-
$
|
678 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
679 |
}
|
680 |
|
681 |
-
return $
|
682 |
}
|
683 |
|
684 |
/**
|
@@ -693,7 +742,7 @@ class ES_DB_Contacts extends ES_DB {
|
|
693 |
*/
|
694 |
public function get_total_contacts_by_date( $status = 'subscribed', $days = 60 ) {
|
695 |
|
696 |
-
if (
|
697 |
$results = $this->get_total_subscribed_contacts_by_date( $days );
|
698 |
}
|
699 |
|
@@ -729,15 +778,15 @@ class ES_DB_Contacts extends ES_DB {
|
|
729 |
* @since 4.4.2
|
730 |
*/
|
731 |
public function get_total_subscribed_contacts_by_date( $days = 60 ) {
|
732 |
-
global $
|
733 |
|
734 |
$columns = array( 'DATE(created_at) as date', 'count(DISTINCT(id)) as total' );
|
735 |
-
$where =
|
736 |
$args[] = 0;
|
737 |
|
738 |
if ( 0 != $days ) {
|
739 |
$days = esc_sql( $days );
|
740 |
-
$where
|
741 |
$args[] = $days;
|
742 |
}
|
743 |
|
@@ -745,7 +794,7 @@ class ES_DB_Contacts extends ES_DB {
|
|
745 |
|
746 |
$where .= $group_by;
|
747 |
|
748 |
-
$where = $
|
749 |
|
750 |
$results = $this->get_columns_by_condition( $columns, $where );
|
751 |
|
@@ -769,19 +818,19 @@ class ES_DB_Contacts extends ES_DB {
|
|
769 |
* @since 4.4.2
|
770 |
*/
|
771 |
public function get_total_subscribed_contacts_before_days( $days = 60 ) {
|
772 |
-
global $
|
773 |
|
774 |
$columns = array( 'count(DISTINCT(id)) as total' );
|
775 |
-
$where =
|
776 |
$args[] = 0;
|
777 |
|
778 |
if ( 0 != $days ) {
|
779 |
$days = esc_sql( $days );
|
780 |
-
$where
|
781 |
$args[] = $days;
|
782 |
}
|
783 |
|
784 |
-
$where = $
|
785 |
|
786 |
$results = $this->get_columns_by_condition( $columns, $where );
|
787 |
|
5 |
}
|
6 |
|
7 |
class ES_DB_Contacts extends ES_DB {
|
8 |
+
|
9 |
/**
|
10 |
+
* Table name
|
11 |
+
*
|
12 |
* @since 4.2.4
|
13 |
* @var $table_name
|
14 |
*
|
15 |
*/
|
16 |
public $table_name;
|
17 |
+
|
18 |
/**
|
19 |
+
* Table DB version
|
20 |
+
*
|
21 |
* @since 4.2.4
|
22 |
* @var $version
|
23 |
*
|
24 |
*/
|
25 |
public $version;
|
26 |
+
|
27 |
/**
|
28 |
+
* Table primary key column name
|
29 |
+
*
|
30 |
* @since 4.2.4
|
31 |
* @var $primary_key
|
32 |
*
|
138 |
$subscriber_email_name_map = array();
|
139 |
if ( count( $emails ) > 0 ) {
|
140 |
|
141 |
+
$emails_str = implode( ',', $emails );
|
142 |
|
143 |
+
$subscribers = $wpdb->get_results(
|
144 |
+
$wpdb->prepare(
|
145 |
+
"SELECT email, first_name, last_name FROM {$wpdb->prefix}ig_contacts WHERE FIND_IN_SET( email, %s )",
|
146 |
+
$emails_str
|
147 |
+
),
|
148 |
+
ARRAY_A
|
149 |
+
);
|
150 |
|
151 |
if ( count( $subscribers ) > 0 ) {
|
152 |
foreach ( $subscribers as $subscriber ) {
|
261 |
|
262 |
global $wpdb;
|
263 |
|
264 |
+
if ( is_array( $list_id ) ) {
|
265 |
+
$list_ids_str = implode( ',', $list_id );
|
266 |
+
$where = $wpdb->prepare(
|
267 |
+
"id IN (SELECT contact_id FROM {$wpdb->prefix}ig_lists_contacts WHERE FIND_IN_SET( list_id, %s ) AND status IN ('subscribed', 'confirmed'))",
|
268 |
+
$list_ids_str
|
269 |
+
);
|
|
|
270 |
} else {
|
271 |
+
$where = $wpdb->prepare( "id IN (SELECT contact_id FROM {$wpdb->prefix}ig_lists_contacts WHERE list_id = %d AND status IN ('subscribed', 'confirmed'))", $list_id );
|
272 |
}
|
273 |
|
274 |
return $this->get_by_conditions( $where );
|
312 |
|
313 |
global $wpdb;
|
314 |
|
|
|
|
|
|
|
|
|
315 |
if ( ! empty( $list_id ) ) {
|
316 |
+
$subscribers = $wpdb->get_var(
|
317 |
+
$wpdb->prepare(
|
318 |
+
"SELECT count(distinct(contact_id)) as total_subscribers FROM {$wpdb->prefix}ig_lists_contacts WHERE status = %s AND list_id = %d",
|
319 |
+
'subscribed',
|
320 |
+
$list_id
|
321 |
+
)
|
322 |
+
);
|
323 |
+
} else {
|
324 |
+
$subscribers = $wpdb->get_var(
|
325 |
+
$wpdb->prepare(
|
326 |
+
"SELECT count(distinct(contact_id)) as total_subscribers FROM {$wpdb->prefix}ig_lists_contacts WHERE status = %s",
|
327 |
+
'subscribed'
|
328 |
+
)
|
329 |
+
);
|
330 |
}
|
331 |
|
|
|
|
|
332 |
return $subscribers;
|
333 |
|
334 |
}
|
385 |
public function edit_contact_global_status( $ids = array(), $unsubscribed = 0 ) {
|
386 |
global $wpdb;
|
387 |
|
388 |
+
$ids = implode( ',', $ids );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
|
390 |
+
return $wpdb->query(
|
391 |
+
$wpdb->prepare(
|
392 |
+
"UPDATE {$wpdb->prefix}ig_contacts SET unsubscribed = %d WHERE FIND_IN_SET( id, %s )",
|
393 |
+
$unsubscribed,
|
394 |
+
$ids
|
395 |
+
)
|
396 |
+
);
|
397 |
}
|
398 |
|
399 |
/**
|
420 |
$list_id = array( $list_id );
|
421 |
}
|
422 |
|
423 |
+
$list_ids_str = implode( ',', $list_id );
|
424 |
|
425 |
+
$list_contact_count = $wpdb->get_var(
|
426 |
+
$wpdb->prepare(
|
427 |
+
"SELECT count(*) as count FROM {$wpdb->prefix}ig_lists_contacts WHERE FIND_IN_SET(list_id,%s) AND contact_id = %d",
|
428 |
+
$list_ids_str,
|
429 |
+
$contact_id
|
430 |
+
)
|
431 |
+
);
|
432 |
|
|
|
|
|
|
|
|
|
433 |
if ( ! empty( $list_contact_count ) ) {
|
434 |
$data['list_id'] = true;
|
435 |
}
|
450 |
public function get_email_details_map() {
|
451 |
global $wpdb;
|
452 |
|
453 |
+
$contacts = $wpdb->get_results(
|
454 |
+
"SELECT id, email, hash FROM {$wpdb->prefix}ig_contacts",
|
455 |
+
ARRAY_A
|
456 |
+
);
|
457 |
$details = array();
|
458 |
if ( count( $contacts ) > 0 ) {
|
459 |
foreach ( $contacts as $contact ) {
|
504 |
public function get_contact_ids_by_emails( $emails = array() ) {
|
505 |
global $wpdb;
|
506 |
|
|
|
|
|
|
|
|
|
507 |
if ( count( $emails ) > 0 ) {
|
508 |
+
$emails_str = implode( ',', $emails );
|
509 |
+
$ids = $wpdb->get_col(
|
510 |
+
$wpdb->prepare(
|
511 |
+
"SELECT id FROM {$wpdb->prefix}ig_contacts WHERE FIND_IN_SET( email, %s ) ",
|
512 |
+
$emails_str
|
513 |
+
)
|
514 |
+
);
|
515 |
+
} else {
|
516 |
+
$ids = $wpdb->get_col( "SELECT id FROM {$wpdb->prefix}ig_contacts" );
|
517 |
}
|
518 |
|
|
|
|
|
519 |
return $ids;
|
520 |
}
|
521 |
|
532 |
public function get_email_id_map( $emails = array() ) {
|
533 |
global $wpdb;
|
534 |
|
|
|
|
|
|
|
|
|
535 |
if ( count( $emails ) > 0 ) {
|
536 |
+
$emails_str = implode( ',', $emails );
|
537 |
+
$results = $wpdb->get_results(
|
538 |
+
$wpdb->prepare(
|
539 |
+
"SELECT id, email FROM {$wpdb->prefix}ig_contacts WHERE FIND_IN_SET( email, %s )",
|
540 |
+
$emails_str
|
541 |
+
),
|
542 |
+
ARRAY_A
|
543 |
+
);
|
544 |
+
} else {
|
545 |
+
$results = $wpdb->get_results( "SELECT id, email FROM {$wpdb->prefix}ig_contacts", ARRAY_A );
|
546 |
}
|
547 |
|
|
|
|
|
548 |
$map = array();
|
549 |
if ( count( $results ) > 0 ) {
|
550 |
foreach ( $results as $result ) {
|
579 |
*/
|
580 |
public function migrate_subscribers_from_older_version() {
|
581 |
global $wpdb;
|
582 |
+
|
|
|
583 |
//Get Total count of subscribers
|
584 |
+
$total = $wpdb->get_var( "SELECT count(*) as total FROM {$wpdb->prefix}es_emaillist" );
|
|
|
585 |
|
586 |
// If we have subscribers?
|
587 |
if ( $total > 0 ) {
|
600 |
$j = 0;
|
601 |
for ( $i = 0; $i < $total_batches; $i ++ ) {
|
602 |
$batch_start = $i * $batch_size;
|
603 |
+
$results = $wpdb->get_results(
|
604 |
+
$wpdb->prepare(
|
605 |
+
"SELECT * FROM {$wpdb->prefix}es_emaillist LIMIT %d, %d ",
|
606 |
+
$batch_start,
|
607 |
+
$batch_size
|
608 |
+
),
|
609 |
+
ARRAY_A
|
610 |
+
);
|
611 |
if ( count( $results ) > 0 ) {
|
612 |
$contacts = array();
|
613 |
foreach ( $results as $key => $result ) {
|
634 |
$contacts[ $key ]['email'] = $email;
|
635 |
$contacts[ $key ]['source'] = 'Migrated';
|
636 |
$contacts[ $key ]['status'] = ( 'spam' === strtolower( $result['es_email_status'] ) ) ? 'spam' : 'verified';
|
637 |
+
$contacts[ $key ]['unsubscribed'] = ( 'Unsubscribed' === $result['es_email_status'] ) ? 1 : 0;
|
638 |
$contacts[ $key ]['hash'] = $result['es_email_guid'];
|
639 |
$contacts[ $key ]['created_at'] = $result['es_email_created'];
|
640 |
$contacts[ $key ]['updated_at'] = ig_get_current_date_time();
|
684 |
public function edit_list_contact_status( $contact_ids, $list_ids, $status ) {
|
685 |
global $wpdb;
|
686 |
|
687 |
+
$contact_ids = implode( ',', $contact_ids );
|
688 |
+
$list_ids = implode( ',', $list_ids );
|
|
|
|
|
689 |
$current_date = ig_get_current_date_time();
|
690 |
|
691 |
+
$query_result = array();
|
|
|
692 |
if ( 'subscribed' === $status ) {
|
693 |
+
$query_result = $wpdb->query(
|
694 |
+
$wpdb->prepare(
|
695 |
+
"UPDATE {$wpdb->prefix}ig_lists_contacts SET status = %s, subscribed_at = %s WHERE FIND_IN_SET( contact_id, %s ) AND FIND_IN_SET( list_id, %s )",
|
696 |
+
array(
|
697 |
+
$status,
|
698 |
+
$current_date,
|
699 |
+
$contact_ids,
|
700 |
+
$list_ids
|
701 |
+
)
|
702 |
+
)
|
703 |
+
);
|
704 |
} elseif ( 'unsubscribed' === $status ) {
|
705 |
+
$query_result = $wpdb->query(
|
706 |
+
$wpdb->prepare(
|
707 |
+
"UPDATE {$wpdb->prefix}ig_lists_contacts SET status = %s, unsubscribed_at = %s WHERE FIND_IN_SET( contact_id, %s ) AND FIND_IN_SET( list_id, %s )",
|
708 |
+
array(
|
709 |
+
$status,
|
710 |
+
$current_date,
|
711 |
+
$contact_ids,
|
712 |
+
$list_ids
|
713 |
+
)
|
714 |
+
)
|
715 |
+
);
|
716 |
} elseif ( 'unconfirmed' === $status ) {
|
717 |
+
$query_result = $wpdb->query(
|
718 |
+
$wpdb->prepare(
|
719 |
+
"UPDATE {$wpdb->prefix}ig_lists_contacts SET status = %s, optin_type = %d, subscribed_at = NULL, unsubscribed_at = NULL WHERE FIND_IN_SET( contact_id, %s ) AND FIND_IN_SET( list_id, %s )",
|
720 |
+
array(
|
721 |
+
$status,
|
722 |
+
IG_DOUBLE_OPTIN,
|
723 |
+
$contact_ids,
|
724 |
+
$list_ids
|
725 |
+
)
|
726 |
+
)
|
727 |
+
);
|
728 |
}
|
729 |
|
730 |
+
return $query_result;
|
731 |
}
|
732 |
|
733 |
/**
|
742 |
*/
|
743 |
public function get_total_contacts_by_date( $status = 'subscribed', $days = 60 ) {
|
744 |
|
745 |
+
if ( 'subscribed' === $status ) {
|
746 |
$results = $this->get_total_subscribed_contacts_by_date( $days );
|
747 |
}
|
748 |
|
778 |
* @since 4.4.2
|
779 |
*/
|
780 |
public function get_total_subscribed_contacts_by_date( $days = 60 ) {
|
781 |
+
global $wpbd;
|
782 |
|
783 |
$columns = array( 'DATE(created_at) as date', 'count(DISTINCT(id)) as total' );
|
784 |
+
$where = 'unsubscribed = %d';
|
785 |
$args[] = 0;
|
786 |
|
787 |
if ( 0 != $days ) {
|
788 |
$days = esc_sql( $days );
|
789 |
+
$where .= ' AND created_at >= DATE_SUB(NOW(), INTERVAL %d DAY)';
|
790 |
$args[] = $days;
|
791 |
}
|
792 |
|
794 |
|
795 |
$where .= $group_by;
|
796 |
|
797 |
+
$where = $wpbd->prepare( $where, $args );
|
798 |
|
799 |
$results = $this->get_columns_by_condition( $columns, $where );
|
800 |
|
818 |
* @since 4.4.2
|
819 |
*/
|
820 |
public function get_total_subscribed_contacts_before_days( $days = 60 ) {
|
821 |
+
global $wpbd;
|
822 |
|
823 |
$columns = array( 'count(DISTINCT(id)) as total' );
|
824 |
+
$where = 'unsubscribed = %d';
|
825 |
$args[] = 0;
|
826 |
|
827 |
if ( 0 != $days ) {
|
828 |
$days = esc_sql( $days );
|
829 |
+
$where .= ' AND created_at < DATE_SUB(NOW(), INTERVAL %d DAY)';
|
830 |
$args[] = $days;
|
831 |
}
|
832 |
|
833 |
+
$where = $wpbd->prepare( $where, $args );
|
834 |
|
835 |
$results = $this->get_columns_by_condition( $columns, $where );
|
836 |
|
lite/includes/db/class-es-db-forms.php
CHANGED
@@ -6,7 +6,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
}
|
7 |
|
8 |
class ES_DB_Forms extends ES_DB {
|
|
|
9 |
/**
|
|
|
|
|
10 |
* @since 4.2.2
|
11 |
* @var string
|
12 |
*
|
@@ -14,6 +17,8 @@ class ES_DB_Forms extends ES_DB {
|
|
14 |
public $table_name;
|
15 |
|
16 |
/**
|
|
|
|
|
17 |
* @since 4.2.2
|
18 |
* @var string
|
19 |
*
|
@@ -21,6 +26,8 @@ class ES_DB_Forms extends ES_DB {
|
|
21 |
public $version;
|
22 |
|
23 |
/**
|
|
|
|
|
24 |
* @since 4.2.2
|
25 |
* @var string
|
26 |
*
|
@@ -99,11 +106,7 @@ class ES_DB_Forms extends ES_DB {
|
|
99 |
|
100 |
global $wpdb;
|
101 |
|
102 |
-
$
|
103 |
-
|
104 |
-
$query = "SELECT id, name FROM $forms_table";
|
105 |
-
|
106 |
-
$results = $wpdb->get_results( $query, ARRAY_A );
|
107 |
|
108 |
$id_name_map = array();
|
109 |
if ( count( $results ) > 0 ) {
|
@@ -160,7 +163,7 @@ class ES_DB_Forms extends ES_DB {
|
|
160 |
public function get_form_by_af_id( $af_id ) {
|
161 |
global $wpdb;
|
162 |
|
163 |
-
$where = $wpdb->prepare(
|
164 |
|
165 |
$forms = $this->get_by_conditions( $where );
|
166 |
|
@@ -183,13 +186,15 @@ class ES_DB_Forms extends ES_DB {
|
|
183 |
public function migrate_advanced_forms() {
|
184 |
global $wpdb;
|
185 |
|
186 |
-
$
|
187 |
-
$is_table_exists = $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE '%s'", $table ) ) === $table;
|
188 |
|
189 |
$lists_name_id_map = ES()->lists_db->get_list_id_name_map( '', true );
|
|
|
190 |
if ( $is_table_exists ) {
|
191 |
-
$
|
192 |
-
|
|
|
|
|
193 |
|
194 |
if ( count( $forms ) > 0 ) {
|
195 |
|
@@ -228,8 +233,8 @@ class ES_DB_Forms extends ES_DB {
|
|
228 |
'id' => 'name',
|
229 |
'params' => array(
|
230 |
'label' => 'Name',
|
231 |
-
'show' => (
|
232 |
-
'required' => (
|
233 |
),
|
234 |
|
235 |
'position' => 1
|
@@ -241,8 +246,8 @@ class ES_DB_Forms extends ES_DB {
|
|
241 |
'id' => 'email',
|
242 |
'params' => array(
|
243 |
'label' => 'Email',
|
244 |
-
'show' => (
|
245 |
-
'required' => (
|
246 |
),
|
247 |
|
248 |
'position' => 2
|
@@ -254,8 +259,8 @@ class ES_DB_Forms extends ES_DB {
|
|
254 |
'id' => 'lists',
|
255 |
'params' => array(
|
256 |
'label' => 'Lists',
|
257 |
-
'show' => (
|
258 |
-
'required' => (
|
259 |
'values' => $list_ids
|
260 |
),
|
261 |
|
@@ -339,4 +344,4 @@ class ES_DB_Forms extends ES_DB {
|
|
339 |
}
|
340 |
|
341 |
|
342 |
-
}
|
6 |
}
|
7 |
|
8 |
class ES_DB_Forms extends ES_DB {
|
9 |
+
|
10 |
/**
|
11 |
+
* Table name
|
12 |
+
*
|
13 |
* @since 4.2.2
|
14 |
* @var string
|
15 |
*
|
17 |
public $table_name;
|
18 |
|
19 |
/**
|
20 |
+
* Table DB version
|
21 |
+
*
|
22 |
* @since 4.2.2
|
23 |
* @var string
|
24 |
*
|
26 |
public $version;
|
27 |
|
28 |
/**
|
29 |
+
* Table primary key column name
|
30 |
+
*
|
31 |
* @since 4.2.2
|
32 |
* @var string
|
33 |
*
|
106 |
|
107 |
global $wpdb;
|
108 |
|
109 |
+
$results = $wpdb->get_results( "SELECT id, name FROM {$wpdb->prefix}ig_forms", ARRAY_A );
|
|
|
|
|
|
|
|
|
110 |
|
111 |
$id_name_map = array();
|
112 |
if ( count( $results ) > 0 ) {
|
163 |
public function get_form_by_af_id( $af_id ) {
|
164 |
global $wpdb;
|
165 |
|
166 |
+
$where = $wpdb->prepare( 'af_id = %d', $af_id );
|
167 |
|
168 |
$forms = $this->get_by_conditions( $where );
|
169 |
|
186 |
public function migrate_advanced_forms() {
|
187 |
global $wpdb;
|
188 |
|
189 |
+
$is_table_exists = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->prefix . 'es_advanced_form' ) ) === $wpdb->prefix . 'es_advanced_form';
|
|
|
190 |
|
191 |
$lists_name_id_map = ES()->lists_db->get_list_id_name_map( '', true );
|
192 |
+
|
193 |
if ( $is_table_exists ) {
|
194 |
+
$forms = $wpdb->get_results(
|
195 |
+
"SELECT * FROM {$wpdb->prefix}es_advanced_form",
|
196 |
+
ARRAY_A
|
197 |
+
);
|
198 |
|
199 |
if ( count( $forms ) > 0 ) {
|
200 |
|
233 |
'id' => 'name',
|
234 |
'params' => array(
|
235 |
'label' => 'Name',
|
236 |
+
'show' => ( 'YES' === $es_af_name ) ? true : false,
|
237 |
+
'required' => ( 'YES' === $es_af_name_mand ) ? true : false
|
238 |
),
|
239 |
|
240 |
'position' => 1
|
246 |
'id' => 'email',
|
247 |
'params' => array(
|
248 |
'label' => 'Email',
|
249 |
+
'show' => ( 'YES' === $es_af_email ) ? true : false,
|
250 |
+
'required' => ( 'YES' === $es_af_email_mand ) ? true : false
|
251 |
),
|
252 |
|
253 |
'position' => 2
|
259 |
'id' => 'lists',
|
260 |
'params' => array(
|
261 |
'label' => 'Lists',
|
262 |
+
'show' => ( 'YES' === $es_af_group ) ? true : false,
|
263 |
+
'required' => ( 'YES' === $es_af_group_mand ) ? true : false,
|
264 |
'values' => $list_ids
|
265 |
),
|
266 |
|
344 |
}
|
345 |
|
346 |
|
347 |
+
}
|
lite/includes/db/class-es-db-links.php
CHANGED
@@ -142,7 +142,7 @@ if ( ! class_exists( 'ES_DB_Links' ) ) {
|
|
142 |
public function get_link_by_campaign_id( $link, $campaign_id = 0, $message_id = 0, $index = 0 ) {
|
143 |
global $wpdb;
|
144 |
|
145 |
-
$where = $wpdb->prepare(
|
146 |
|
147 |
return $this->get_by_conditions( $where );
|
148 |
}
|
@@ -159,7 +159,7 @@ if ( ! class_exists( 'ES_DB_Links' ) ) {
|
|
159 |
public function get_links_by_message_id( $message_id = 0 ) {
|
160 |
global $wpdb;
|
161 |
|
162 |
-
$where = $wpdb->prepare(
|
163 |
|
164 |
return $this->get_by_conditions( $where );
|
165 |
}
|
142 |
public function get_link_by_campaign_id( $link, $campaign_id = 0, $message_id = 0, $index = 0 ) {
|
143 |
global $wpdb;
|
144 |
|
145 |
+
$where = $wpdb->prepare( ' link = %s AND campaign_id = %d AND message_id = %d AND i = %d', $link, $campaign_id, $message_id, $index );
|
146 |
|
147 |
return $this->get_by_conditions( $where );
|
148 |
}
|
159 |
public function get_links_by_message_id( $message_id = 0 ) {
|
160 |
global $wpdb;
|
161 |
|
162 |
+
$where = $wpdb->prepare( ' message_id = %d', $message_id );
|
163 |
|
164 |
return $this->get_by_conditions( $where );
|
165 |
}
|
lite/includes/db/class-es-db-lists-contacts.php
CHANGED
@@ -5,7 +5,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
5 |
}
|
6 |
|
7 |
class ES_DB_Lists_Contacts extends ES_DB {
|
|
|
8 |
/**
|
|
|
|
|
9 |
* @since 4.3.5
|
10 |
*
|
11 |
* @var $table_name
|
@@ -13,6 +16,8 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
13 |
public $table_name;
|
14 |
|
15 |
/**
|
|
|
|
|
16 |
* @since 4.3.5
|
17 |
*
|
18 |
* @var $version
|
@@ -20,6 +25,8 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
20 |
public $version;
|
21 |
|
22 |
/**
|
|
|
|
|
23 |
* @since 4.3.5
|
24 |
*
|
25 |
* @var $primary_key
|
@@ -224,6 +231,8 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
224 |
}
|
225 |
|
226 |
/**
|
|
|
|
|
227 |
* @param $id
|
228 |
* @param string $status
|
229 |
*
|
@@ -239,20 +248,18 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
239 |
return array();
|
240 |
}
|
241 |
|
242 |
-
$where
|
243 |
-
$args[] = esc_sql( $contact_id );
|
244 |
|
245 |
if ( ! empty( $status ) ) {
|
246 |
-
$where
|
247 |
-
$args[] = esc_sql( $status );
|
248 |
}
|
249 |
|
250 |
-
$where = $wpdb->prepare( $where, $args );
|
251 |
-
|
252 |
return $this->get_column_by_condition( 'list_id', $where );
|
253 |
}
|
254 |
|
255 |
/**
|
|
|
|
|
256 |
* @param int $contact_id
|
257 |
*
|
258 |
* @return array
|
@@ -268,8 +275,7 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
268 |
return array();
|
269 |
}
|
270 |
|
271 |
-
$where =
|
272 |
-
$where = $wpdb->prepare( $where, $contact_id );
|
273 |
|
274 |
return $this->get_columns_map( 'list_id', 'status', $where );
|
275 |
}
|
@@ -360,7 +366,7 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
360 |
$list_ids_str = $this->prepare_for_in_query( $list_ids );
|
361 |
|
362 |
if ( ! empty( $where ) ) {
|
363 |
-
$where .=
|
364 |
}
|
365 |
|
366 |
$where .= "list_id IN ($list_ids_str)";
|
@@ -418,14 +424,14 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
418 |
$contact[ $key ]['contact_id'] = $email_id_map[ $contact['email'] ];
|
419 |
$status = 'subscribed';
|
420 |
$optin_type = IG_SINGLE_OPTIN;
|
421 |
-
if ( $contact['status']
|
422 |
$optin_type = IG_SINGLE_OPTIN;
|
423 |
-
} elseif ( $contact['status']
|
424 |
$optin_type = IG_DOUBLE_OPTIN;
|
425 |
-
} elseif ( $contact['status']
|
426 |
$optin_type = IG_DOUBLE_OPTIN;
|
427 |
$status = 'Unconfirmed';
|
428 |
-
} elseif ( $contact['status']
|
429 |
$optin_type = IG_DOUBLE_OPTIN;
|
430 |
$status = 'unsubscribed';
|
431 |
}
|
@@ -499,7 +505,7 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
499 |
public function get_total_count_by_list( $list_id = 0, $status = 'subscribed' ) {
|
500 |
|
501 |
// Convert to integer only if it a numberic value and not an array.
|
502 |
-
if( is_numeric( $list_id ) ) {
|
503 |
$list_id = absint( $list_id );
|
504 |
}
|
505 |
|
@@ -521,7 +527,7 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
521 |
* @since 4.3.6 Added $distinct
|
522 |
*/
|
523 |
public function get_total_contacts( $where = '', $distinct = true ) {
|
524 |
-
global $
|
525 |
|
526 |
if ( $distinct ) {
|
527 |
$query = "SELECT count(DISTINCT(contact_id)) FROM $this->table_name";
|
@@ -532,8 +538,8 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
532 |
if ( ! empty( $where ) ) {
|
533 |
$query .= " WHERE $where";
|
534 |
}
|
535 |
-
|
536 |
-
return $
|
537 |
}
|
538 |
|
539 |
/**
|
@@ -596,24 +602,44 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
596 |
$ids = array_map( 'absint', $ids );
|
597 |
$status = esc_sql( $status );
|
598 |
|
599 |
-
$
|
600 |
|
601 |
$current_date = ig_get_current_date_time();
|
602 |
|
603 |
$query = '';
|
604 |
if ( 'subscribed' === $status ) {
|
605 |
-
|
606 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
607 |
} elseif ( 'unsubscribed' === $status ) {
|
608 |
-
|
609 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
610 |
} elseif ( 'unconfirmed' === $status ) {
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
|
|
|
|
|
|
|
|
617 |
}
|
618 |
|
619 |
return false;
|
@@ -638,11 +664,10 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
638 |
$ids = array( $ids );
|
639 |
}
|
640 |
|
641 |
-
$ids
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
$where = $wpdb->prepare( "contact_id IN ($ids) && status != %s", $status );
|
646 |
|
647 |
if ( $this->count( $where ) ) {
|
648 |
return true;
|
@@ -737,7 +762,7 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
737 |
* @since 4.3.6
|
738 |
*/
|
739 |
public function get_contacts( $status = 'all', $list_id = 0, $days = 0, $count_only = false, $distinct = true ) {
|
740 |
-
global $
|
741 |
|
742 |
$expected_statuses = array( 'subscribed', 'unsubscribed', 'unconfirmed', 'confirmed', 'all' );
|
743 |
|
@@ -745,35 +770,35 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
745 |
return array();
|
746 |
}
|
747 |
|
748 |
-
$status
|
749 |
-
if( is_array( $list_id ) ) {
|
750 |
$list_id = array_map( 'esc_sql', $list_id );
|
751 |
} else {
|
752 |
$list_id = esc_sql( $list_id );
|
753 |
}
|
754 |
|
755 |
-
$where[] =
|
756 |
$args[] = 1;
|
757 |
if ( ! empty( $status ) ) {
|
758 |
switch ( $status ) {
|
759 |
case 'subscribed':
|
760 |
case 'unsubscribed':
|
761 |
case 'unconfirmed':
|
762 |
-
$where[] =
|
763 |
$args[] = $status;
|
764 |
break;
|
765 |
case 'confirmed':
|
766 |
-
$where[] =
|
767 |
$args[] = $status;
|
768 |
$args[] = IG_DOUBLE_OPTIN;
|
769 |
break;
|
770 |
default:
|
771 |
-
$where[] =
|
772 |
break;
|
773 |
}
|
774 |
}
|
775 |
|
776 |
-
if( is_array( $list_id ) ) {
|
777 |
$ids_count = count( $list_id );
|
778 |
$ids_placeholders = array_fill( 0, $ids_count, '%d' );
|
779 |
$ids_query = ' list_id IN( ' . implode( ',', $ids_placeholders ) . ' )';
|
@@ -783,7 +808,7 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
783 |
$list_id = absint( $list_id );
|
784 |
if ( ! empty( $list_id ) ) {
|
785 |
$list_id = esc_sql( $list_id );
|
786 |
-
$where[] =
|
787 |
$args[] = $list_id;
|
788 |
}
|
789 |
}
|
@@ -793,17 +818,17 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
793 |
$days = esc_sql( $days );
|
794 |
|
795 |
if ( 'unsubscribed' === $status ) {
|
796 |
-
$where[] =
|
797 |
$args[] = $days;
|
798 |
} elseif ( 'subscribed' === $status ) {
|
799 |
-
$where[] =
|
800 |
$args[] = $days;
|
801 |
}
|
802 |
}
|
803 |
|
804 |
if ( count( $where ) > 0 ) {
|
805 |
-
$where = implode(
|
806 |
-
$where = $
|
807 |
}
|
808 |
|
809 |
if ( $count_only ) {
|
@@ -953,4 +978,4 @@ class ES_DB_Lists_Contacts extends ES_DB {
|
|
953 |
}
|
954 |
|
955 |
|
956 |
-
}
|
5 |
}
|
6 |
|
7 |
class ES_DB_Lists_Contacts extends ES_DB {
|
8 |
+
|
9 |
/**
|
10 |
+
* Table name
|
11 |
+
*
|
12 |
* @since 4.3.5
|
13 |
*
|
14 |
* @var $table_name
|
16 |
public $table_name;
|
17 |
|
18 |
/**
|
19 |
+
* Table DB version
|
20 |
+
*
|
21 |
* @since 4.3.5
|
22 |
*
|
23 |
* @var $version
|
25 |
public $version;
|
26 |
|
27 |
/**
|
28 |
+
* Table primary key column name
|
29 |
+
*
|
30 |
* @since 4.3.5
|
31 |
*
|
32 |
* @var $primary_key
|
231 |
}
|
232 |
|
233 |
/**
|
234 |
+
* Get list ids by contact id
|
235 |
+
*
|
236 |
* @param $id
|
237 |
* @param string $status
|
238 |
*
|
248 |
return array();
|
249 |
}
|
250 |
|
251 |
+
$where = $wpdb->prepare( 'contact_id = %d', esc_sql( $contact_id ) );
|
|
|
252 |
|
253 |
if ( ! empty( $status ) ) {
|
254 |
+
$where .= $wpdb->prepare( ' AND status = %s', esc_sql( $status ) );
|
|
|
255 |
}
|
256 |
|
|
|
|
|
257 |
return $this->get_column_by_condition( 'list_id', $where );
|
258 |
}
|
259 |
|
260 |
/**
|
261 |
+
* Get mapping of contact status with list
|
262 |
+
*
|
263 |
* @param int $contact_id
|
264 |
*
|
265 |
* @return array
|
275 |
return array();
|
276 |
}
|
277 |
|
278 |
+
$where = $wpdb->prepare( 'contact_id = %d', $contact_id );
|
|
|
279 |
|
280 |
return $this->get_columns_map( 'list_id', 'status', $where );
|
281 |
}
|
366 |
$list_ids_str = $this->prepare_for_in_query( $list_ids );
|
367 |
|
368 |
if ( ! empty( $where ) ) {
|
369 |
+
$where .= ' AND ';
|
370 |
}
|
371 |
|
372 |
$where .= "list_id IN ($list_ids_str)";
|
424 |
$contact[ $key ]['contact_id'] = $email_id_map[ $contact['email'] ];
|
425 |
$status = 'subscribed';
|
426 |
$optin_type = IG_SINGLE_OPTIN;
|
427 |
+
if ( 'Single Opt In' === $contact['status'] ) {
|
428 |
$optin_type = IG_SINGLE_OPTIN;
|
429 |
+
} elseif ( 'Confirmed' === $contact['status'] ) {
|
430 |
$optin_type = IG_DOUBLE_OPTIN;
|
431 |
+
} elseif ( 'Unconfirmed' === $contact['status'] ) {
|
432 |
$optin_type = IG_DOUBLE_OPTIN;
|
433 |
$status = 'Unconfirmed';
|
434 |
+
} elseif ( 'Unsubscribed' === $contact['status'] ) {
|
435 |
$optin_type = IG_DOUBLE_OPTIN;
|
436 |
$status = 'unsubscribed';
|
437 |
}
|
505 |
public function get_total_count_by_list( $list_id = 0, $status = 'subscribed' ) {
|
506 |
|
507 |
// Convert to integer only if it a numberic value and not an array.
|
508 |
+
if ( is_numeric( $list_id ) ) {
|
509 |
$list_id = absint( $list_id );
|
510 |
}
|
511 |
|
527 |
* @since 4.3.6 Added $distinct
|
528 |
*/
|
529 |
public function get_total_contacts( $where = '', $distinct = true ) {
|
530 |
+
global $wpbd;
|
531 |
|
532 |
if ( $distinct ) {
|
533 |
$query = "SELECT count(DISTINCT(contact_id)) FROM $this->table_name";
|
538 |
if ( ! empty( $where ) ) {
|
539 |
$query .= " WHERE $where";
|
540 |
}
|
541 |
+
|
542 |
+
return $wpbd->get_var( $query );
|
543 |
}
|
544 |
|
545 |
/**
|
602 |
$ids = array_map( 'absint', $ids );
|
603 |
$status = esc_sql( $status );
|
604 |
|
605 |
+
$ids_str = implode( ',', $ids );
|
606 |
|
607 |
$current_date = ig_get_current_date_time();
|
608 |
|
609 |
$query = '';
|
610 |
if ( 'subscribed' === $status ) {
|
611 |
+
return $wpdb->query(
|
612 |
+
$wpdb->prepare(
|
613 |
+
"UPDATE {$wpdb->prefix}ig_lists_contacts SET status = %s, subscribed_at = %s WHERE FIND_IN_SET(contact_id, %s)",
|
614 |
+
array(
|
615 |
+
$status,
|
616 |
+
$current_date,
|
617 |
+
$ids_str
|
618 |
+
)
|
619 |
+
)
|
620 |
+
);
|
621 |
} elseif ( 'unsubscribed' === $status ) {
|
622 |
+
return $wpdb->query(
|
623 |
+
$wpdb->prepare(
|
624 |
+
"UPDATE {$wpdb->prefix}ig_lists_contacts SET status = %s, unsubscribed_at = %s WHERE FIND_IN_SET(contact_id, %s)",
|
625 |
+
array(
|
626 |
+
$status,
|
627 |
+
$current_date,
|
628 |
+
$ids_str
|
629 |
+
)
|
630 |
+
)
|
631 |
+
);
|
632 |
} elseif ( 'unconfirmed' === $status ) {
|
633 |
+
return $wpdb->query(
|
634 |
+
$wpdb->prepare(
|
635 |
+
"UPDATE {$wpdb->prefix}ig_lists_contacts SET status = %s, optin_type = %d, subscribed_at = NULL, unsubscribed_at = NULL WHERE FIND_IN_SET(contact_id, %s)",
|
636 |
+
array(
|
637 |
+
$status,
|
638 |
+
IG_DOUBLE_OPTIN,
|
639 |
+
$ids_str
|
640 |
+
)
|
641 |
+
)
|
642 |
+
);
|
643 |
}
|
644 |
|
645 |
return false;
|
664 |
$ids = array( $ids );
|
665 |
}
|
666 |
|
667 |
+
$ids = array_map( 'absint', $ids );
|
668 |
+
$ids_str = implode( ',', $ids );
|
669 |
+
|
670 |
+
$where = $wpdb->prepare( 'FIND_IN_SET(contact_id, %s) && status != %s', $ids_str, $status );
|
|
|
671 |
|
672 |
if ( $this->count( $where ) ) {
|
673 |
return true;
|
762 |
* @since 4.3.6
|
763 |
*/
|
764 |
public function get_contacts( $status = 'all', $list_id = 0, $days = 0, $count_only = false, $distinct = true ) {
|
765 |
+
global $wpbd;
|
766 |
|
767 |
$expected_statuses = array( 'subscribed', 'unsubscribed', 'unconfirmed', 'confirmed', 'all' );
|
768 |
|
770 |
return array();
|
771 |
}
|
772 |
|
773 |
+
$status = esc_sql( $status );
|
774 |
+
if ( is_array( $list_id ) ) {
|
775 |
$list_id = array_map( 'esc_sql', $list_id );
|
776 |
} else {
|
777 |
$list_id = esc_sql( $list_id );
|
778 |
}
|
779 |
|
780 |
+
$where[] = '1 = %d';
|
781 |
$args[] = 1;
|
782 |
if ( ! empty( $status ) ) {
|
783 |
switch ( $status ) {
|
784 |
case 'subscribed':
|
785 |
case 'unsubscribed':
|
786 |
case 'unconfirmed':
|
787 |
+
$where[] = 'status = %s';
|
788 |
$args[] = $status;
|
789 |
break;
|
790 |
case 'confirmed':
|
791 |
+
$where[] = 'status = %s AND optin_type = %d';
|
792 |
$args[] = $status;
|
793 |
$args[] = IG_DOUBLE_OPTIN;
|
794 |
break;
|
795 |
default:
|
796 |
+
$where[] = '1 = 1';
|
797 |
break;
|
798 |
}
|
799 |
}
|
800 |
|
801 |
+
if ( is_array( $list_id ) ) {
|
802 |
$ids_count = count( $list_id );
|
803 |
$ids_placeholders = array_fill( 0, $ids_count, '%d' );
|
804 |
$ids_query = ' list_id IN( ' . implode( ',', $ids_placeholders ) . ' )';
|
808 |
$list_id = absint( $list_id );
|
809 |
if ( ! empty( $list_id ) ) {
|
810 |
$list_id = esc_sql( $list_id );
|
811 |
+
$where[] = 'list_id = %d';
|
812 |
$args[] = $list_id;
|
813 |
}
|
814 |
}
|
818 |
$days = esc_sql( $days );
|
819 |
|
820 |
if ( 'unsubscribed' === $status ) {
|
821 |
+
$where[] = 'unsubscribed_at >= DATE_SUB(NOW(), INTERVAL %d DAY)';
|
822 |
$args[] = $days;
|
823 |
} elseif ( 'subscribed' === $status ) {
|
824 |
+
$where[] = 'subscribed_at >= DATE_SUB(NOW(), INTERVAL %d DAY)';
|
825 |
$args[] = $days;
|
826 |
}
|
827 |
}
|
828 |
|
829 |
if ( count( $where ) > 0 ) {
|
830 |
+
$where = implode( ' AND ', $where );
|
831 |
+
$where = $wpbd->prepare( $where, $args );
|
832 |
}
|
833 |
|
834 |
if ( $count_only ) {
|
978 |
}
|
979 |
|
980 |
|
981 |
+
}
|
lite/includes/db/class-es-db-lists.php
CHANGED
@@ -5,19 +5,28 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
5 |
}
|
6 |
|
7 |
class ES_DB_Lists extends ES_DB {
|
|
|
8 |
/**
|
|
|
|
|
9 |
* @since 4.0.0
|
10 |
* @var $table_name
|
11 |
*
|
12 |
*/
|
13 |
public $table_name;
|
|
|
14 |
/**
|
|
|
|
|
15 |
* @since 4.0.0
|
16 |
* @var $version
|
17 |
*
|
18 |
*/
|
19 |
public $version;
|
|
|
20 |
/**
|
|
|
|
|
21 |
* @since 4.0.0
|
22 |
* @var $primary_key
|
23 |
*
|
@@ -197,10 +206,12 @@ class ES_DB_Lists extends ES_DB {
|
|
197 |
public function get_all_lists_name_by_contact( $id ) {
|
198 |
global $wpdb;
|
199 |
|
200 |
-
$
|
201 |
-
|
202 |
-
|
203 |
-
|
|
|
|
|
204 |
|
205 |
return $res;
|
206 |
}
|
5 |
}
|
6 |
|
7 |
class ES_DB_Lists extends ES_DB {
|
8 |
+
|
9 |
/**
|
10 |
+
* Table name
|
11 |
+
*
|
12 |
* @since 4.0.0
|
13 |
* @var $table_name
|
14 |
*
|
15 |
*/
|
16 |
public $table_name;
|
17 |
+
|
18 |
/**
|
19 |
+
* Table DB version
|
20 |
+
*
|
21 |
* @since 4.0.0
|
22 |
* @var $version
|
23 |
*
|
24 |
*/
|
25 |
public $version;
|
26 |
+
|
27 |
/**
|
28 |
+
* Table primary key column name
|
29 |
+
*
|
30 |
* @since 4.0.0
|
31 |
* @var $primary_key
|
32 |
*
|
206 |
public function get_all_lists_name_by_contact( $id ) {
|
207 |
global $wpdb;
|
208 |
|
209 |
+
$res = $wpdb->get_col(
|
210 |
+
$wpdb->prepare(
|
211 |
+
"SELECT `name` FROM {$wpdb->prefix}ig_lists WHERE id IN ( SELECT list_id FROM {$wpdb->prefix}ig_lists_contacts WHERE contact_id = %d )",
|
212 |
+
$id
|
213 |
+
)
|
214 |
+
);
|
215 |
|
216 |
return $res;
|
217 |
}
|
lite/includes/db/class-es-db-mailing-queue.php
CHANGED
@@ -64,9 +64,12 @@ class ES_DB_Mailing_Queue {
|
|
64 |
public static function get_notification_hash_to_be_sent() {
|
65 |
global $wpdb;
|
66 |
|
67 |
-
$
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
70 |
|
71 |
//TODO :: update start date
|
72 |
|
@@ -75,23 +78,32 @@ class ES_DB_Mailing_Queue {
|
|
75 |
}
|
76 |
|
77 |
public static function get_notification_to_be_sent( $campaign_hash = '' ) {
|
78 |
-
global $wpdb;
|
79 |
|
80 |
$notification = array();
|
81 |
|
82 |
$ig_mailing_queue_table = IG_MAILING_QUEUE_TABLE;
|
83 |
|
|
|
84 |
if ( ! empty( $campaign_hash ) ) {
|
85 |
-
$
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
87 |
} else {
|
88 |
$current_time = ig_get_current_date_time();
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
|
93 |
-
$results = $wpdb->get_results( $query, ARRAY_A );
|
94 |
-
|
95 |
if ( count( $results ) > 0 ) {
|
96 |
$notification = array_shift( $results );
|
97 |
// refresh content
|
@@ -111,10 +123,10 @@ class ES_DB_Mailing_Queue {
|
|
111 |
//update sent date
|
112 |
$currentdate = ig_get_current_date_time();
|
113 |
$query_str = "UPDATE {$ig_mailing_queue_table} SET start_at = %s ";
|
114 |
-
$where =
|
115 |
$query_str = ! empty( $query_sub_str ) ? $query_str . $query_sub_str . $where : $query_str . $where;
|
116 |
-
$query = $
|
117 |
-
$return_id = $
|
118 |
}
|
119 |
|
120 |
return $notification;
|
@@ -122,34 +134,43 @@ class ES_DB_Mailing_Queue {
|
|
122 |
}
|
123 |
|
124 |
// Query to insert sent emails (cron) records in table: es_sentdetails
|
125 |
-
public static function update_sent_status( $hash =
|
126 |
|
127 |
global $wpdb;
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
$sql = "UPDATE " . IG_MAILING_QUEUE_TABLE . " SET status = %s";
|
132 |
-
$values[] = $status;
|
133 |
-
|
134 |
if ( 'Sent' === $status ) {
|
135 |
-
$
|
136 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
}
|
138 |
|
139 |
-
$sql .= " WHERE hash = %s";
|
140 |
-
$values[] = $hash;
|
141 |
-
|
142 |
-
$query = $wpdb->prepare( $sql, $values );
|
143 |
-
$return_id = $wpdb->query( $query );
|
144 |
-
|
145 |
return $return_id;
|
146 |
}
|
147 |
|
148 |
/* Get sent email count */
|
149 |
public static function get_sent_email_count( $notification_hash ) {
|
150 |
global $wpdb;
|
151 |
-
$
|
152 |
-
|
|
|
|
|
|
|
|
|
153 |
$email_count = array_shift( $email_count );
|
154 |
|
155 |
return $email_count;
|
@@ -159,8 +180,13 @@ class ES_DB_Mailing_Queue {
|
|
159 |
global $wpdb;
|
160 |
|
161 |
$notification = array();
|
162 |
-
$
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
if ( count( $results ) > 0 ) {
|
166 |
$notification = array_shift( $results );
|
@@ -173,8 +199,10 @@ class ES_DB_Mailing_Queue {
|
|
173 |
global $wpdb;
|
174 |
|
175 |
$notification = array();
|
176 |
-
$
|
177 |
-
|
|
|
|
|
178 |
|
179 |
if ( count( $results ) > 0 ) {
|
180 |
$notification = array_shift( $results );
|
@@ -186,24 +214,37 @@ class ES_DB_Mailing_Queue {
|
|
186 |
public static function get_notifications( $per_page = 5, $page_number = 1 ) {
|
187 |
global $wpdb;
|
188 |
|
189 |
-
$sql = "SELECT * FROM " . IG_MAILING_QUEUE_TABLE . " ORDER BY created_at DESC ";
|
190 |
-
|
191 |
if ( ! empty( $per_page ) && ! empty( $page_number ) ) {
|
192 |
$start_limit = ( $page_number - 1 ) * $per_page;
|
193 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
}
|
195 |
|
196 |
-
$result = $wpdb->get_results( $sql, ARRAY_A );
|
197 |
-
|
198 |
return $result;
|
199 |
}
|
200 |
|
201 |
public static function get_notifications_count() {
|
202 |
global $wpdb;
|
203 |
|
204 |
-
$
|
205 |
-
|
206 |
-
|
|
|
|
|
|
|
207 |
|
208 |
return $result[0];
|
209 |
}
|
@@ -213,13 +254,14 @@ class ES_DB_Mailing_Queue {
|
|
213 |
|
214 |
$ids = esc_sql( $ids );
|
215 |
|
216 |
-
$ids = implode( ',
|
217 |
|
218 |
-
$
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
|
|
223 |
}
|
224 |
|
225 |
public static function add_notification( $data ) {
|
@@ -259,8 +301,14 @@ class ES_DB_Mailing_Queue {
|
|
259 |
public static function get_id_details_map() {
|
260 |
global $wpdb;
|
261 |
|
262 |
-
$query =
|
263 |
-
$results = $wpdb->get_results(
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
$details = array();
|
265 |
if ( count( $results ) > 0 ) {
|
266 |
foreach ( $results as $result ) {
|
@@ -276,8 +324,13 @@ class ES_DB_Mailing_Queue {
|
|
276 |
global $wpdb;
|
277 |
|
278 |
$report = array();
|
279 |
-
$
|
280 |
-
|
|
|
|
|
|
|
|
|
|
|
281 |
|
282 |
if ( count( $results ) > 0 ) {
|
283 |
$report = array_shift( $results );
|
@@ -287,6 +340,8 @@ class ES_DB_Mailing_Queue {
|
|
287 |
}
|
288 |
|
289 |
/**
|
|
|
|
|
290 |
* @param int $count
|
291 |
*
|
292 |
* @return array|object|null
|
@@ -300,24 +355,26 @@ class ES_DB_Mailing_Queue {
|
|
300 |
$count = 5;
|
301 |
}
|
302 |
|
303 |
-
|
304 |
-
|
305 |
-
|
|
|
|
|
|
|
|
|
306 |
}
|
307 |
|
308 |
public static function do_insert( $place_holders, $values ) {
|
309 |
-
global $wpdb;
|
310 |
|
311 |
-
$
|
312 |
-
|
313 |
-
$query = "INSERT INTO {$mailing_queue_table} (`hash`, `campaign_id`, `subject`, `body`, `count`, `status`, `start_at`, `finish_at`, `created_at`, `updated_at`) VALUES ";
|
314 |
$query .= implode( ', ', $place_holders );
|
315 |
-
$sql
|
316 |
|
317 |
$logger = get_ig_logger();
|
318 |
$logger->info( 'Query....<<<<<' . $sql );
|
319 |
|
320 |
-
if ( $
|
321 |
return true;
|
322 |
} else {
|
323 |
return false;
|
@@ -328,8 +385,12 @@ class ES_DB_Mailing_Queue {
|
|
328 |
public static function migrate_notifications() {
|
329 |
global $wpdb;
|
330 |
|
331 |
-
$
|
332 |
-
|
|
|
|
|
|
|
|
|
333 |
|
334 |
if ( $total > 0 ) {
|
335 |
$columns = self::get_columns();
|
@@ -342,10 +403,17 @@ class ES_DB_Mailing_Queue {
|
|
342 |
for ( $i = 0; $i < $total_bataches; $i ++ ) {
|
343 |
$batch_start = $i * $batch_size;
|
344 |
|
345 |
-
$
|
346 |
-
|
347 |
-
|
348 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
foreach ( $results as $key => $result ) {
|
350 |
$queue_data['hash'] = $result['es_sent_guid'];
|
351 |
$queue_data['campaign_id'] = 0;
|
@@ -365,7 +433,7 @@ class ES_DB_Mailing_Queue {
|
|
365 |
$formats[] = $format;
|
366 |
}
|
367 |
|
368 |
-
$place_holders[] =
|
369 |
}
|
370 |
|
371 |
ES_DB::do_insert( IG_MAILING_QUEUE_TABLE, $fields, $place_holders, $values );
|
64 |
public static function get_notification_hash_to_be_sent() {
|
65 |
global $wpdb;
|
66 |
|
67 |
+
$hash = $wpdb->get_var(
|
68 |
+
$wpdb->prepare(
|
69 |
+
"SELECT hash FROM {$wpdb->prefix}ig_mailing_queue WHERE status = %s ORDER BY id LIMIT 0, 1",
|
70 |
+
'In Queue'
|
71 |
+
)
|
72 |
+
);
|
73 |
|
74 |
//TODO :: update start date
|
75 |
|
78 |
}
|
79 |
|
80 |
public static function get_notification_to_be_sent( $campaign_hash = '' ) {
|
81 |
+
global $wpdb, $wpbd;
|
82 |
|
83 |
$notification = array();
|
84 |
|
85 |
$ig_mailing_queue_table = IG_MAILING_QUEUE_TABLE;
|
86 |
|
87 |
+
$results = array();
|
88 |
if ( ! empty( $campaign_hash ) ) {
|
89 |
+
$results = $wpdb->get_results(
|
90 |
+
$wpdb->prepare(
|
91 |
+
"SELECT * FROM {$wpdb->prefix}ig_mailing_queue WHERE hash = %s",
|
92 |
+
array( $campaign_hash )
|
93 |
+
),
|
94 |
+
ARRAY_A
|
95 |
+
);
|
96 |
} else {
|
97 |
$current_time = ig_get_current_date_time();
|
98 |
+
$results = $wpdb->get_results(
|
99 |
+
$wpdb->prepare(
|
100 |
+
"SELECT * FROM {$wpdb->prefix}ig_mailing_queue WHERE status IN ('Sending', 'In Queue') AND start_at <= %s ORDER BY start_at, id LIMIT 0, 1",
|
101 |
+
$current_time
|
102 |
+
),
|
103 |
+
ARRAY_A
|
104 |
+
);
|
105 |
}
|
106 |
|
|
|
|
|
107 |
if ( count( $results ) > 0 ) {
|
108 |
$notification = array_shift( $results );
|
109 |
// refresh content
|
123 |
//update sent date
|
124 |
$currentdate = ig_get_current_date_time();
|
125 |
$query_str = "UPDATE {$ig_mailing_queue_table} SET start_at = %s ";
|
126 |
+
$where = ' WHERE hash = %s AND finish_at = %s';
|
127 |
$query_str = ! empty( $query_sub_str ) ? $query_str . $query_sub_str . $where : $query_str . $where;
|
128 |
+
$query = $wpbd->prepare( $query_str, array( $currentdate, $notification['hash'], '0000-00-00 00:00:00' ) );
|
129 |
+
$return_id = $wpbd->query( $query );
|
130 |
}
|
131 |
|
132 |
return $notification;
|
134 |
}
|
135 |
|
136 |
// Query to insert sent emails (cron) records in table: es_sentdetails
|
137 |
+
public static function update_sent_status( $hash = '', $status = 'In Queue' ) {
|
138 |
|
139 |
global $wpdb;
|
140 |
+
|
141 |
+
// If status is sent then add finish_at time as well.
|
|
|
|
|
|
|
|
|
142 |
if ( 'Sent' === $status ) {
|
143 |
+
$current_date_time = ig_get_current_date_time();
|
144 |
+
$return_id = $wpdb->query(
|
145 |
+
$wpdb->prepare(
|
146 |
+
"UPDATE {$wpdb->prefix}ig_mailing_queue SET status = %s, finish_at = %s WHERE hash = %s",
|
147 |
+
$status,
|
148 |
+
$current_date_time,
|
149 |
+
$hash
|
150 |
+
)
|
151 |
+
);
|
152 |
+
} else {
|
153 |
+
$return_id = $wpdb->query(
|
154 |
+
$wpdb->prepare(
|
155 |
+
"UPDATE {$wpdb->prefix}ig_mailing_queue SET status = %s WHERE hash = %s",
|
156 |
+
$status,
|
157 |
+
$hash
|
158 |
+
)
|
159 |
+
);
|
160 |
}
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
return $return_id;
|
163 |
}
|
164 |
|
165 |
/* Get sent email count */
|
166 |
public static function get_sent_email_count( $notification_hash ) {
|
167 |
global $wpdb;
|
168 |
+
$email_count = $wpdb->get_col(
|
169 |
+
$wpdb->prepare(
|
170 |
+
"SELECT count FROM {$wpdb->prefix}ig_mailing_queue WHERE hash = %s ",
|
171 |
+
array( $notification_hash )
|
172 |
+
)
|
173 |
+
);
|
174 |
$email_count = array_shift( $email_count );
|
175 |
|
176 |
return $email_count;
|
180 |
global $wpdb;
|
181 |
|
182 |
$notification = array();
|
183 |
+
$results = $wpdb->get_results(
|
184 |
+
$wpdb->prepare(
|
185 |
+
"SELECT * FROM {$wpdb->prefix}ig_mailing_queue WHERE hash = %s",
|
186 |
+
$notification_hash
|
187 |
+
),
|
188 |
+
ARRAY_A
|
189 |
+
);
|
190 |
|
191 |
if ( count( $results ) > 0 ) {
|
192 |
$notification = array_shift( $results );
|
199 |
global $wpdb;
|
200 |
|
201 |
$notification = array();
|
202 |
+
$results = $wpdb->get_results(
|
203 |
+
$wpdb->prepare( "SELECT * FROM {$wpdb->prefix}ig_mailing_queue WHERE campaign_id = %d", $campaign_id ),
|
204 |
+
ARRAY_A
|
205 |
+
);
|
206 |
|
207 |
if ( count( $results ) > 0 ) {
|
208 |
$notification = array_shift( $results );
|
214 |
public static function get_notifications( $per_page = 5, $page_number = 1 ) {
|
215 |
global $wpdb;
|
216 |
|
|
|
|
|
217 |
if ( ! empty( $per_page ) && ! empty( $page_number ) ) {
|
218 |
$start_limit = ( $page_number - 1 ) * $per_page;
|
219 |
+
$result = $wpdb->get_results(
|
220 |
+
$wpdb->prepare(
|
221 |
+
"SELECT * FROM {$wpdb->prefix}ig_mailing_queue ORDER BY created_at DESC LIMIT %d, %d",
|
222 |
+
$start_limit,
|
223 |
+
$per_page
|
224 |
+
),
|
225 |
+
ARRAY_A
|
226 |
+
);
|
227 |
+
} else {
|
228 |
+
$result = $wpdb->get_results(
|
229 |
+
$wpdb->prepare(
|
230 |
+
"SELECT * FROM {$wpdb->prefix}ig_mailing_queue ORDER BY created_at DESC "
|
231 |
+
),
|
232 |
+
ARRAY_A
|
233 |
+
);
|
234 |
}
|
235 |
|
|
|
|
|
236 |
return $result;
|
237 |
}
|
238 |
|
239 |
public static function get_notifications_count() {
|
240 |
global $wpdb;
|
241 |
|
242 |
+
$result = $wpdb->get_col(
|
243 |
+
$wpdb->prepare(
|
244 |
+
"SELECT count(*) as total_notifications FROM {$wpdb->prefix}ig_mailing_queue WHERE %d",
|
245 |
+
1
|
246 |
+
)
|
247 |
+
);
|
248 |
|
249 |
return $result[0];
|
250 |
}
|
254 |
|
255 |
$ids = esc_sql( $ids );
|
256 |
|
257 |
+
$ids = implode( ',', array_map( 'absint', $ids ) );
|
258 |
|
259 |
+
$wpdb->query(
|
260 |
+
$wpdb->prepare(
|
261 |
+
"DELETE FROM {$wpdb->prefix}ig_mailing_queue WHERE FIND_IN_SET(id, %s)",
|
262 |
+
$ids
|
263 |
+
)
|
264 |
+
);
|
265 |
}
|
266 |
|
267 |
public static function add_notification( $data ) {
|
301 |
public static function get_id_details_map() {
|
302 |
global $wpdb;
|
303 |
|
304 |
+
$query = 'SELECT id, start_at, hash FROM ' . IG_MAILING_QUEUE_TABLE;
|
305 |
+
$results = $wpdb->get_results(
|
306 |
+
$wpdb->prepare(
|
307 |
+
"SELECT id, start_at, hash FROM {$wpdb->prefix}ig_mailing_queue WHERE %d",
|
308 |
+
1
|
309 |
+
),
|
310 |
+
ARRAY_A
|
311 |
+
);
|
312 |
$details = array();
|
313 |
if ( count( $results ) > 0 ) {
|
314 |
foreach ( $results as $result ) {
|
324 |
global $wpdb;
|
325 |
|
326 |
$report = array();
|
327 |
+
$results = $wpdb->get_results(
|
328 |
+
$wpdb->prepare(
|
329 |
+
"SELECT * FROM {$wpdb->prefix}ig_mailing_queue WHERE id = %s",
|
330 |
+
$mailing_queue_id
|
331 |
+
),
|
332 |
+
ARRAY_A
|
333 |
+
);
|
334 |
|
335 |
if ( count( $results ) > 0 ) {
|
336 |
$report = array_shift( $results );
|
340 |
}
|
341 |
|
342 |
/**
|
343 |
+
* Get recent campaigns data
|
344 |
+
*
|
345 |
* @param int $count
|
346 |
*
|
347 |
* @return array|object|null
|
355 |
$count = 5;
|
356 |
}
|
357 |
|
358 |
+
return $wpdb->get_results(
|
359 |
+
$wpdb->prepare(
|
360 |
+
"SELECT id, hash, campaign_id, subject, start_at, status, finish_at FROM {$wpdb->prefix}ig_mailing_queue order by created_at DESC LIMIT 0, %d",
|
361 |
+
$count
|
362 |
+
),
|
363 |
+
ARRAY_A
|
364 |
+
);
|
365 |
}
|
366 |
|
367 |
public static function do_insert( $place_holders, $values ) {
|
368 |
+
global $wpdb, $wpbd;
|
369 |
|
370 |
+
$query = "INSERT INTO {$wpdb->prefix}ig_mailing_queue (`hash`, `campaign_id`, `subject`, `body`, `count`, `status`, `start_at`, `finish_at`, `created_at`, `updated_at`) VALUES ";
|
|
|
|
|
371 |
$query .= implode( ', ', $place_holders );
|
372 |
+
$sql = $wpbd->prepare( $query, $values );
|
373 |
|
374 |
$logger = get_ig_logger();
|
375 |
$logger->info( 'Query....<<<<<' . $sql );
|
376 |
|
377 |
+
if ( $wpbd->query( $sql ) ) {
|
378 |
return true;
|
379 |
} else {
|
380 |
return false;
|
385 |
public static function migrate_notifications() {
|
386 |
global $wpdb;
|
387 |
|
388 |
+
$total = $wpdb->get_var(
|
389 |
+
$wpdb->prepare(
|
390 |
+
"SELECT count(*) as total FROM {$wpdb->prefix}es_notification WHERE %d",
|
391 |
+
1
|
392 |
+
)
|
393 |
+
);
|
394 |
|
395 |
if ( $total > 0 ) {
|
396 |
$columns = self::get_columns();
|
403 |
for ( $i = 0; $i < $total_bataches; $i ++ ) {
|
404 |
$batch_start = $i * $batch_size;
|
405 |
|
406 |
+
$results = $wpdb->get_results(
|
407 |
+
$wpdb->prepare(
|
408 |
+
"SELECT * FROM {$wpdb->prefix}es_sentdetails LIMIT %d, %d",
|
409 |
+
$batch_start,
|
410 |
+
$batch_size
|
411 |
+
),
|
412 |
+
ARRAY_A
|
413 |
+
);
|
414 |
+
|
415 |
+
$values = array();
|
416 |
+
$place_holders = array();
|
417 |
foreach ( $results as $key => $result ) {
|
418 |
$queue_data['hash'] = $result['es_sent_guid'];
|
419 |
$queue_data['campaign_id'] = 0;
|
433 |
$formats[] = $format;
|
434 |
}
|
435 |
|
436 |
+
$place_holders[] = '( ' . implode( ', ', $formats ) . ' )';
|
437 |
}
|
438 |
|
439 |
ES_DB::do_insert( IG_MAILING_QUEUE_TABLE, $fields, $place_holders, $values );
|
lite/includes/db/class-es-db-notifications.php
CHANGED
@@ -26,10 +26,13 @@ class ES_DB_Notifications {
|
|
26 |
*/
|
27 |
public static function migrate_post_notification_es_template_type() {
|
28 |
global $wpdb;
|
29 |
-
|
30 |
-
$
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
33 |
|
34 |
return $update;
|
35 |
}
|
@@ -44,9 +47,12 @@ class ES_DB_Notifications {
|
|
44 |
public static function migrate_newsletter_es_template_type() {
|
45 |
global $wpdb;
|
46 |
|
47 |
-
$
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
50 |
|
51 |
return $update;
|
52 |
}
|
26 |
*/
|
27 |
public static function migrate_post_notification_es_template_type() {
|
28 |
global $wpdb;
|
29 |
+
|
30 |
+
$update = $wpdb->query(
|
31 |
+
$wpdb->prepare(
|
32 |
+
"UPDATE {$wpdb->prefix}postmeta SET meta_value = %s WHERE meta_key = %s AND meta_value = %s",
|
33 |
+
array( 'post_notification', 'es_template_type', 'Post Notification' )
|
34 |
+
)
|
35 |
+
);
|
36 |
|
37 |
return $update;
|
38 |
}
|
47 |
public static function migrate_newsletter_es_template_type() {
|
48 |
global $wpdb;
|
49 |
|
50 |
+
$update = $wpdb->query(
|
51 |
+
$wpdb->prepare(
|
52 |
+
"UPDATE {$wpdb->prefix}postmeta SET meta_value = %s WHERE meta_key = %s AND meta_value = %s",
|
53 |
+
array( 'newsletter', 'es_template_type', 'Newsletter' )
|
54 |
+
)
|
55 |
+
);
|
56 |
|
57 |
return $update;
|
58 |
}
|
lite/includes/db/class-es-db-queue.php
CHANGED
@@ -11,6 +11,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
11 |
*/
|
12 |
class ES_DB_Queue extends ES_DB {
|
13 |
/**
|
|
|
|
|
14 |
* @since 4.2.1
|
15 |
* @var $table_name
|
16 |
*
|
@@ -18,6 +20,8 @@ class ES_DB_Queue extends ES_DB {
|
|
18 |
public $table_name;
|
19 |
|
20 |
/**
|
|
|
|
|
21 |
* @since 4.2.1
|
22 |
* @var $version
|
23 |
*
|
@@ -25,6 +29,8 @@ class ES_DB_Queue extends ES_DB {
|
|
25 |
public $version;
|
26 |
|
27 |
/**
|
|
|
|
|
28 |
* @since 4.2.1
|
29 |
* @var $primary_key
|
30 |
*
|
@@ -56,12 +62,16 @@ class ES_DB_Queue extends ES_DB {
|
|
56 |
*
|
57 |
* @since 4.2.1
|
58 |
*/
|
59 |
-
public function delete_from_queue($campaign_id, $contact_id) {
|
60 |
global $wpdb;
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
67 |
}
|
11 |
*/
|
12 |
class ES_DB_Queue extends ES_DB {
|
13 |
/**
|
14 |
+
* Table name
|
15 |
+
*
|
16 |
* @since 4.2.1
|
17 |
* @var $table_name
|
18 |
*
|
20 |
public $table_name;
|
21 |
|
22 |
/**
|
23 |
+
* Table DB version
|
24 |
+
*
|
25 |
* @since 4.2.1
|
26 |
* @var $version
|
27 |
*
|
29 |
public $version;
|
30 |
|
31 |
/**
|
32 |
+
* Table primary key column name
|
33 |
+
*
|
34 |
* @since 4.2.1
|
35 |
* @var $primary_key
|
36 |
*
|
62 |
*
|
63 |
* @since 4.2.1
|
64 |
*/
|
65 |
+
public function delete_from_queue( $campaign_id, $contact_id) {
|
66 |
global $wpdb;
|
67 |
|
68 |
+
return $wpdb->query(
|
69 |
+
$wpdb->prepare(
|
70 |
+
"DELETE FROM {$wpdb->prefix}ig_queue WHERE campaign_id = %d AND contact_id = %d",
|
71 |
+
$campaign_id,
|
72 |
+
$contact_id
|
73 |
+
)
|
74 |
+
);
|
75 |
}
|
76 |
|
77 |
}
|
lite/includes/db/class-es-db-sending-queue.php
CHANGED
@@ -53,10 +53,17 @@ class ES_DB_Sending_Queue {
|
|
53 |
public static function get_emails_to_be_sent_by_hash( $guid, $limit ) {
|
54 |
global $wpdb;
|
55 |
|
56 |
-
$
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
return $subscribers;
|
62 |
}
|
@@ -65,31 +72,39 @@ class ES_DB_Sending_Queue {
|
|
65 |
global $wpdb;
|
66 |
|
67 |
$updated = false;
|
68 |
-
if (
|
69 |
return $updated;
|
70 |
}
|
71 |
|
72 |
$id_str = '';
|
73 |
if ( is_array( $contact_ids ) && count( $contact_ids ) > 0 ) {
|
74 |
-
$id_str = implode(
|
75 |
} elseif ( is_string( $contact_ids ) ) {
|
76 |
$id_str = $contact_ids;
|
77 |
}
|
78 |
|
79 |
if ( ! empty( $id_str ) ) {
|
80 |
-
$sql = "UPDATE " . IG_SENDING_QUEUE_TABLE . " SET status = %s";
|
81 |
-
|
82 |
if ( 'Sent' === $status ) {
|
83 |
$current_time = ig_get_current_date_time();
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
-
|
88 |
-
$sql .= " WHERE mailing_queue_id = %d AND contact_id IN ($id_str)";
|
89 |
-
|
90 |
-
$sql = $wpdb->prepare( $sql, $status, $message_id );
|
91 |
-
|
92 |
-
$updated = $wpdb->query( $sql );
|
93 |
}
|
94 |
|
95 |
return $updated;
|
@@ -103,10 +118,12 @@ class ES_DB_Sending_Queue {
|
|
103 |
|
104 |
$result = 0;
|
105 |
if ( ! empty( $notification_hash ) ) {
|
106 |
-
$
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
|
|
110 |
}
|
111 |
|
112 |
return $result;
|
@@ -117,10 +134,12 @@ class ES_DB_Sending_Queue {
|
|
117 |
|
118 |
global $wpdb;
|
119 |
|
120 |
-
$
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
124 |
|
125 |
return $result;
|
126 |
|
@@ -131,11 +150,13 @@ class ES_DB_Sending_Queue {
|
|
131 |
global $wpdb;
|
132 |
|
133 |
$result = 0;
|
134 |
-
if (
|
135 |
-
$
|
136 |
-
|
137 |
-
|
138 |
-
|
|
|
|
|
139 |
}
|
140 |
|
141 |
return $result;
|
@@ -146,22 +167,29 @@ class ES_DB_Sending_Queue {
|
|
146 |
global $wpdb;
|
147 |
|
148 |
$emails = array();
|
149 |
-
if (
|
150 |
-
$
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
// We are not migrating reports data because it caused lots of migration issues
|
154 |
// in the past. So, we are fetching reports data from older table if we don't get
|
155 |
// the data from the new table.
|
156 |
-
|
157 |
// This is generally fetch the data for older campaigns
|
158 |
if ( count( $emails ) == 0 ) {
|
159 |
-
$
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
|
|
|
|
|
|
165 |
}
|
166 |
}
|
167 |
}
|
@@ -186,7 +214,8 @@ class ES_DB_Sending_Queue {
|
|
186 |
|
187 |
$emails = array();
|
188 |
foreach ( $batches as $key => $batch ) {
|
189 |
-
$place_holders =
|
|
|
190 |
foreach ( $batch as $subscriber ) {
|
191 |
|
192 |
$email = ! empty( $subscriber['email'] ) ? $subscriber['email'] : '';
|
@@ -206,7 +235,7 @@ class ES_DB_Sending_Queue {
|
|
206 |
$formats[] = $format;
|
207 |
}
|
208 |
|
209 |
-
$place_holders[] =
|
210 |
}
|
211 |
}
|
212 |
|
@@ -218,15 +247,15 @@ class ES_DB_Sending_Queue {
|
|
218 |
}
|
219 |
|
220 |
public static function do_insert( $place_holders, $values ) {
|
221 |
-
global $
|
222 |
|
223 |
$delivery_reports_table = IG_SENDING_QUEUE_TABLE;
|
224 |
|
225 |
-
$query
|
226 |
$query .= implode( ', ', $place_holders );
|
227 |
-
$sql
|
228 |
|
229 |
-
if ( $
|
230 |
return true;
|
231 |
} else {
|
232 |
return false;
|
@@ -239,19 +268,27 @@ class ES_DB_Sending_Queue {
|
|
239 |
|
240 |
$current_date = ig_get_current_date_time();
|
241 |
|
242 |
-
$query
|
243 |
-
|
244 |
-
|
245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
}
|
247 |
|
|
|
|
|
248 |
public static function migrate_reports_data() {
|
249 |
global $wpdb;
|
250 |
|
251 |
$mailing_queue_details = ES_DB_Mailing_Queue::get_id_details_map();
|
252 |
$email_details = ES()->contacts_db->get_email_details_map();
|
253 |
|
254 |
-
$query =
|
255 |
|
256 |
$total = $wpdb->get_var( $query );
|
257 |
|
@@ -280,13 +317,16 @@ class ES_DB_Sending_Queue {
|
|
280 |
set_transient( 'ig_es_running_migration_for_' . $i, true, 300 );
|
281 |
$batch_start = $i * $batch_size;
|
282 |
|
283 |
-
$query
|
284 |
-
|
285 |
$results = $wpdb->get_results( $query, ARRAY_A );
|
286 |
-
|
|
|
|
|
|
|
|
|
287 |
foreach ( $results as $key => $result ) {
|
288 |
$email = $result['es_deliver_emailmail'];
|
289 |
-
$is_opened = (
|
290 |
|
291 |
$contact_id = 0;
|
292 |
$hash = '';
|
@@ -315,7 +355,7 @@ class ES_DB_Sending_Queue {
|
|
315 |
$formats[] = $format;
|
316 |
}
|
317 |
|
318 |
-
$place_holders[] =
|
319 |
}
|
320 |
|
321 |
$logger->info( '------------------[Running.....]: ' . $i, array( 'source' => 'es_update' ) );
|
@@ -330,6 +370,7 @@ class ES_DB_Sending_Queue {
|
|
330 |
}
|
331 |
}
|
332 |
}
|
|
|
333 |
|
334 |
/*
|
335 |
public static function migrate_reports_data() {
|
@@ -414,49 +455,55 @@ class ES_DB_Sending_Queue {
|
|
414 |
}
|
415 |
}
|
416 |
*/
|
|
|
417 |
public static function delete_records_from_delivereport( $ids ) {
|
418 |
-
global $
|
419 |
|
420 |
$delivereport_ids = implode( ',', array_map( 'absint', $ids ) );
|
421 |
|
422 |
-
$query =
|
423 |
|
424 |
-
$
|
425 |
}
|
426 |
|
427 |
public static function delete_sending_queue_by_mailing_id( $mailing_queue_ids ) {
|
428 |
global $wpdb;
|
429 |
|
430 |
$mailing_queue_ids = esc_sql( $mailing_queue_ids );
|
|
|
431 |
|
432 |
-
$
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
$wpdb->query( $query );
|
439 |
}
|
440 |
|
441 |
// Query to get total viewed emails per report
|
442 |
-
public static function get_viewed_count_by_hash( $hash =
|
443 |
|
444 |
global $wpdb;
|
445 |
|
446 |
$result = 0;
|
447 |
|
448 |
-
if (
|
449 |
-
$
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
$result = $wpdb->get_var(
|
|
|
|
|
|
|
|
|
|
|
460 |
}
|
461 |
}
|
462 |
|
@@ -466,23 +513,29 @@ class ES_DB_Sending_Queue {
|
|
466 |
|
467 |
}
|
468 |
|
469 |
-
public static function get_total_email_count_by_hash( $hash =
|
470 |
|
471 |
global $wpdb;
|
472 |
|
473 |
$result = 0;
|
474 |
|
475 |
-
if (
|
476 |
-
$
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
|
|
|
|
481 |
$es_deliver_report_table = EMAIL_SUBSCRIBERS_STATS_TABLE;
|
482 |
-
$table_name = $wpdb->get_var(
|
483 |
if ( $table_name === $es_deliver_report_table ) {
|
484 |
-
$
|
485 |
-
|
|
|
|
|
|
|
|
|
486 |
}
|
487 |
}
|
488 |
}
|
@@ -502,7 +555,7 @@ class ES_DB_Sending_Queue {
|
|
502 |
*/
|
503 |
public static function get_total_contacts_opened_emails( $days = 0 ) {
|
504 |
|
505 |
-
global $
|
506 |
|
507 |
$ig_sending_queue_table = IG_SENDING_QUEUE_TABLE;
|
508 |
|
@@ -512,12 +565,12 @@ class ES_DB_Sending_Queue {
|
|
512 |
|
513 |
if ( 0 != $days ) {
|
514 |
$days = esc_sql( $days );
|
515 |
-
$where =
|
516 |
-
$query
|
517 |
$args[] = $days;
|
518 |
}
|
519 |
|
520 |
-
return $
|
521 |
}
|
522 |
|
523 |
|
@@ -541,11 +594,17 @@ class ES_DB_Sending_Queue {
|
|
541 |
return array();
|
542 |
}
|
543 |
|
544 |
-
$emails_str =
|
545 |
|
546 |
-
$
|
547 |
-
|
548 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
549 |
|
550 |
$emails_id_map = array();
|
551 |
if ( count( $results ) > 0 ) {
|
53 |
public static function get_emails_to_be_sent_by_hash( $guid, $limit ) {
|
54 |
global $wpdb;
|
55 |
|
56 |
+
$subscribers = $wpdb->get_results(
|
57 |
+
$wpdb->prepare(
|
58 |
+
"SELECT * FROM {$wpdb->prefix}ig_sending_queue WHERE status = %s AND mailing_queue_hash = %s ORDER BY id LIMIT 0, %d",
|
59 |
+
array(
|
60 |
+
'In Queue',
|
61 |
+
$guid,
|
62 |
+
$limit
|
63 |
+
)
|
64 |
+
),
|
65 |
+
ARRAY_A
|
66 |
+
);
|
67 |
|
68 |
return $subscribers;
|
69 |
}
|
72 |
global $wpdb;
|
73 |
|
74 |
$updated = false;
|
75 |
+
if ( 0 == $message_id ) {
|
76 |
return $updated;
|
77 |
}
|
78 |
|
79 |
$id_str = '';
|
80 |
if ( is_array( $contact_ids ) && count( $contact_ids ) > 0 ) {
|
81 |
+
$id_str = implode( ',', $contact_ids );
|
82 |
} elseif ( is_string( $contact_ids ) ) {
|
83 |
$id_str = $contact_ids;
|
84 |
}
|
85 |
|
86 |
if ( ! empty( $id_str ) ) {
|
|
|
|
|
87 |
if ( 'Sent' === $status ) {
|
88 |
$current_time = ig_get_current_date_time();
|
89 |
+
$updated = $wpdb->query(
|
90 |
+
$wpdb->prepare(
|
91 |
+
"UPDATE {$wpdb->prefix}ig_sending_queue SET status = %s, sent_at = %s WHERE mailing_queue_id = %d AND FIND_IN_SET(contact_id, %s)",
|
92 |
+
$status,
|
93 |
+
$current_time,
|
94 |
+
$message_id,
|
95 |
+
$id_str
|
96 |
+
)
|
97 |
+
);
|
98 |
+
} else {
|
99 |
+
$updated = $wpdb->query(
|
100 |
+
$wpdb->prepare(
|
101 |
+
"UPDATE {$wpdb->prefix}ig_sending_queue SET status = %s WHERE mailing_queue_id = %d AND FIND_IN_SET(contact_id, %s)",
|
102 |
+
$status,
|
103 |
+
$message_id,
|
104 |
+
$id_str
|
105 |
+
)
|
106 |
+
);
|
107 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
|
110 |
return $updated;
|
118 |
|
119 |
$result = 0;
|
120 |
if ( ! empty( $notification_hash ) ) {
|
121 |
+
$result = $wpdb->get_var(
|
122 |
+
$wpdb->prepare(
|
123 |
+
"SELECT COUNT(*) AS count FROM {$wpdb->prefix}ig_sending_queue WHERE mailing_queue_hash = %s AND status = %s",
|
124 |
+
array( $notification_hash, 'In Queue' )
|
125 |
+
)
|
126 |
+
);
|
127 |
}
|
128 |
|
129 |
return $result;
|
134 |
|
135 |
global $wpdb;
|
136 |
|
137 |
+
$result = $wpdb->get_var(
|
138 |
+
$wpdb->prepare(
|
139 |
+
"SELECT COUNT(*) AS count FROM {$wpdb->prefix}ig_sending_queue WHERE status = %s",
|
140 |
+
array( 'In Queue' )
|
141 |
+
)
|
142 |
+
);
|
143 |
|
144 |
return $result;
|
145 |
|
150 |
global $wpdb;
|
151 |
|
152 |
$result = 0;
|
153 |
+
if ( '' != $notification_hash ) {
|
154 |
+
$result = $wpdb->get_var(
|
155 |
+
$wpdb->prepare(
|
156 |
+
"SELECT COUNT(*) AS count FROM {$wpdb->prefix}ig_sending_queue WHERE mailing_queue_hash = %s AND status = %s",
|
157 |
+
array( $notification_hash, 'Sent' )
|
158 |
+
)
|
159 |
+
);
|
160 |
}
|
161 |
|
162 |
return $result;
|
167 |
global $wpdb;
|
168 |
|
169 |
$emails = array();
|
170 |
+
if ( '' != $notification_hash ) {
|
171 |
+
$emails = $wpdb->get_results(
|
172 |
+
$wpdb->prepare(
|
173 |
+
"SELECT * FROM {$wpdb->prefix}ig_sending_queue WHERE mailing_queue_hash = %s",
|
174 |
+
array( $notification_hash )
|
175 |
+
),
|
176 |
+
ARRAY_A
|
177 |
+
);
|
178 |
|
179 |
// We are not migrating reports data because it caused lots of migration issues
|
180 |
// in the past. So, we are fetching reports data from older table if we don't get
|
181 |
// the data from the new table.
|
|
|
182 |
// This is generally fetch the data for older campaigns
|
183 |
if ( count( $emails ) == 0 ) {
|
184 |
+
$result = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s ', $wpdb->prefix . 'es_deliverreport' ) );
|
185 |
+
if ( $result === $wpdb->prefix . 'es_deliverreport' ) {
|
186 |
+
$emails = $wpdb->get_results(
|
187 |
+
$wpdb->prepare(
|
188 |
+
"SELECT * FROM {$wpdb->prefix}es_deliverreport WHERE es_deliver_sentguid = %s",
|
189 |
+
array( $notification_hash )
|
190 |
+
),
|
191 |
+
ARRAY_A
|
192 |
+
);
|
193 |
}
|
194 |
}
|
195 |
}
|
214 |
|
215 |
$emails = array();
|
216 |
foreach ( $batches as $key => $batch ) {
|
217 |
+
$place_holders = array();
|
218 |
+
$values = array();
|
219 |
foreach ( $batch as $subscriber ) {
|
220 |
|
221 |
$email = ! empty( $subscriber['email'] ) ? $subscriber['email'] : '';
|
235 |
$formats[] = $format;
|
236 |
}
|
237 |
|
238 |
+
$place_holders[] = '( ' . implode( ', ', $formats ) . ' )';
|
239 |
}
|
240 |
}
|
241 |
|
247 |
}
|
248 |
|
249 |
public static function do_insert( $place_holders, $values ) {
|
250 |
+
global $wpbd;
|
251 |
|
252 |
$delivery_reports_table = IG_SENDING_QUEUE_TABLE;
|
253 |
|
254 |
+
$query = "INSERT INTO $delivery_reports_table (`mailing_queue_id`, `mailing_queue_hash`, `campaign_id`, `contact_id`, `contact_hash`, `email`, `status`, `links`, `opened`, `sent_at`, `opened_at`) VALUES ";
|
255 |
$query .= implode( ', ', $place_holders );
|
256 |
+
$sql = $wpbd->prepare( "$query ", $values );
|
257 |
|
258 |
+
if ( $wpbd->query( $sql ) ) {
|
259 |
return true;
|
260 |
} else {
|
261 |
return false;
|
268 |
|
269 |
$current_date = ig_get_current_date_time();
|
270 |
|
271 |
+
return $wpdb->query(
|
272 |
+
$wpdb->prepare(
|
273 |
+
"UPDATE {$wpdb->prefix}ig_sending_queue SET opened_at = %s, opened = %d WHERE (mailing_queue_id = %d OR mailing_queue_hash = %s ) AND email = %s",
|
274 |
+
$current_date,
|
275 |
+
1,
|
276 |
+
$message_id,
|
277 |
+
$guid,
|
278 |
+
$email
|
279 |
+
)
|
280 |
+
);
|
281 |
}
|
282 |
|
283 |
+
/*
|
284 |
+
* Commenting for now as we might need this function in the future.
|
285 |
public static function migrate_reports_data() {
|
286 |
global $wpdb;
|
287 |
|
288 |
$mailing_queue_details = ES_DB_Mailing_Queue::get_id_details_map();
|
289 |
$email_details = ES()->contacts_db->get_email_details_map();
|
290 |
|
291 |
+
$query = 'SELECT count(*) as total FROM ' . EMAIL_SUBSCRIBERS_STATS_TABLE;
|
292 |
|
293 |
$total = $wpdb->get_var( $query );
|
294 |
|
317 |
set_transient( 'ig_es_running_migration_for_' . $i, true, 300 );
|
318 |
$batch_start = $i * $batch_size;
|
319 |
|
320 |
+
$query = 'SELECT * FROM ' . EMAIL_SUBSCRIBERS_STATS_TABLE . " LIMIT {$batch_start}, {$batch_size}";
|
|
|
321 |
$results = $wpdb->get_results( $query, ARRAY_A );
|
322 |
+
|
323 |
+
$values = array();
|
324 |
+
$data = array();
|
325 |
+
$place_holders = array();
|
326 |
+
|
327 |
foreach ( $results as $key => $result ) {
|
328 |
$email = $result['es_deliver_emailmail'];
|
329 |
+
$is_opened = ( '0000-00-00 00:00:00' != $result['es_deliver_viewdate'] ) ? 1 : 0;
|
330 |
|
331 |
$contact_id = 0;
|
332 |
$hash = '';
|
355 |
$formats[] = $format;
|
356 |
}
|
357 |
|
358 |
+
$place_holders[] = '( ' . implode( ', ', $formats ) . ' )';
|
359 |
}
|
360 |
|
361 |
$logger->info( '------------------[Running.....]: ' . $i, array( 'source' => 'es_update' ) );
|
370 |
}
|
371 |
}
|
372 |
}
|
373 |
+
*/
|
374 |
|
375 |
/*
|
376 |
public static function migrate_reports_data() {
|
455 |
}
|
456 |
}
|
457 |
*/
|
458 |
+
|
459 |
public static function delete_records_from_delivereport( $ids ) {
|
460 |
+
global $wpbd;
|
461 |
|
462 |
$delivereport_ids = implode( ',', array_map( 'absint', $ids ) );
|
463 |
|
464 |
+
$query = 'DELETE FROM ' . EMAIL_SUBSCRIBERS_STATS_TABLE . " WHERE es_deliver_id IN ($delivereport_ids)";
|
465 |
|
466 |
+
$wpbd->query( $query );
|
467 |
}
|
468 |
|
469 |
public static function delete_sending_queue_by_mailing_id( $mailing_queue_ids ) {
|
470 |
global $wpdb;
|
471 |
|
472 |
$mailing_queue_ids = esc_sql( $mailing_queue_ids );
|
473 |
+
$mailing_queue_ids = implode( ',', array_map( 'absint', $mailing_queue_ids ) );
|
474 |
|
475 |
+
$wpdb->query(
|
476 |
+
$wpdb->prepare(
|
477 |
+
"DELETE FROM {$wpdb->prefix}ig_sending_queue WHERE FIND_IN_SET (mailing_queue_id, %s)",
|
478 |
+
$mailing_queue_ids
|
479 |
+
)
|
480 |
+
);
|
|
|
481 |
}
|
482 |
|
483 |
// Query to get total viewed emails per report
|
484 |
+
public static function get_viewed_count_by_hash( $hash = '' ) {
|
485 |
|
486 |
global $wpdb;
|
487 |
|
488 |
$result = 0;
|
489 |
|
490 |
+
if ( '' != $hash ) {
|
491 |
+
$result = $wpdb->get_var(
|
492 |
+
$wpdb->prepare(
|
493 |
+
"SELECT COUNT(*) AS count FROM {$wpdb->prefix}ig_sending_queue WHERE opened = 1 AND mailing_queue_hash = %s",
|
494 |
+
array( $hash )
|
495 |
+
)
|
496 |
+
);
|
497 |
+
|
498 |
+
if ( 0 == $result ) {
|
499 |
+
$table_name = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->prefix . 'es_deliverreport' ) );
|
500 |
+
if ( $table_name === $wpdb->prefix . 'es_deliverreport' ) {
|
501 |
+
$result = $wpdb->get_var(
|
502 |
+
$wpdb->prepare(
|
503 |
+
"SELECT COUNT(*) AS count FROM {$wpdb->prefix}es_deliverreport WHERE es_deliver_status = 'Viewed' AND es_deliver_sentguid = %s",
|
504 |
+
array( $hash )
|
505 |
+
)
|
506 |
+
);
|
507 |
}
|
508 |
}
|
509 |
|
513 |
|
514 |
}
|
515 |
|
516 |
+
public static function get_total_email_count_by_hash( $hash = '' ) {
|
517 |
|
518 |
global $wpdb;
|
519 |
|
520 |
$result = 0;
|
521 |
|
522 |
+
if ( '' != $hash ) {
|
523 |
+
$result = $wpdb->get_var(
|
524 |
+
$wpdb->prepare(
|
525 |
+
"SELECT COUNT(*) AS count FROM {$wpdb->prefix}ig_sending_queue WHERE mailing_queue_hash = %s",
|
526 |
+
array( $hash )
|
527 |
+
)
|
528 |
+
);
|
529 |
+
if ( 0 == $result ) {
|
530 |
$es_deliver_report_table = EMAIL_SUBSCRIBERS_STATS_TABLE;
|
531 |
+
$table_name = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->prefix . 'es_deliverreport' ) );
|
532 |
if ( $table_name === $es_deliver_report_table ) {
|
533 |
+
$result = $wpdb->get_var(
|
534 |
+
$wpdb->prepare(
|
535 |
+
"SELECT COUNT(*) AS count FROM {$wpdb->prefix}es_deliverreport WHERE es_deliver_sentguid = %s",
|
536 |
+
array( $hash )
|
537 |
+
)
|
538 |
+
);
|
539 |
}
|
540 |
}
|
541 |
}
|
555 |
*/
|
556 |
public static function get_total_contacts_opened_emails( $days = 0 ) {
|
557 |
|
558 |
+
global $wpbd;
|
559 |
|
560 |
$ig_sending_queue_table = IG_SENDING_QUEUE_TABLE;
|
561 |
|
565 |
|
566 |
if ( 0 != $days ) {
|
567 |
$days = esc_sql( $days );
|
568 |
+
$where = ' AND opened_at >= DATE_SUB(NOW(), INTERVAL %d DAY)';
|
569 |
+
$query .= $where;
|
570 |
$args[] = $days;
|
571 |
}
|
572 |
|
573 |
+
return $wpbd->get_var( $wpbd->prepare( $query, $args ) );
|
574 |
}
|
575 |
|
576 |
|
594 |
return array();
|
595 |
}
|
596 |
|
597 |
+
$emails_str = implode( ',', $emails );
|
598 |
|
599 |
+
$results = $wpdb->get_results(
|
600 |
+
$wpdb->prepare(
|
601 |
+
// We are using FIND_IN_SET since IN clause requires emails to be seperated by single quotes(') which get escaped when passed as a placeholder value in $wp->prepare.
|
602 |
+
"SELECT contact_id, email FROM {$wpdb->prefix}ig_sending_queue WHERE campaign_id = %d AND FIND_IN_SET( email, %s)",
|
603 |
+
$campaign_id,
|
604 |
+
$emails_str
|
605 |
+
),
|
606 |
+
ARRAY_A
|
607 |
+
);
|
608 |
|
609 |
$emails_id_map = array();
|
610 |
if ( count( $results ) > 0 ) {
|
lite/includes/db/class-es-db.php
CHANGED
@@ -10,7 +10,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
10 |
* @since 4.0
|
11 |
*/
|
12 |
abstract class ES_DB {
|
|
|
13 |
/**
|
|
|
|
|
14 |
* @since 4.0.0
|
15 |
* @var $table_name
|
16 |
*
|
@@ -18,6 +21,8 @@ abstract class ES_DB {
|
|
18 |
public $table_name;
|
19 |
|
20 |
/**
|
|
|
|
|
21 |
* @since 4.0.0
|
22 |
* @var $version
|
23 |
*
|
@@ -25,6 +30,8 @@ abstract class ES_DB {
|
|
25 |
public $version;
|
26 |
|
27 |
/**
|
|
|
|
|
28 |
* @since 4.0.0
|
29 |
* @var $primary_key
|
30 |
*
|
@@ -51,6 +58,8 @@ abstract class ES_DB {
|
|
51 |
}
|
52 |
|
53 |
/**
|
|
|
|
|
54 |
* @return array
|
55 |
*
|
56 |
* @since 4.0.0
|
@@ -69,9 +78,9 @@ abstract class ES_DB {
|
|
69 |
* @since 4.0.0
|
70 |
*/
|
71 |
public function get( $row_id, $output = ARRAY_A ) {
|
72 |
-
global $
|
73 |
|
74 |
-
return $
|
75 |
}
|
76 |
|
77 |
/**
|
@@ -85,10 +94,10 @@ abstract class ES_DB {
|
|
85 |
* @since 4.0.0
|
86 |
*/
|
87 |
public function get_by( $column, $row_id, $output = ARRAY_A ) {
|
88 |
-
global $
|
89 |
$column = esc_sql( $column );
|
90 |
|
91 |
-
return $
|
92 |
}
|
93 |
|
94 |
/**
|
@@ -99,7 +108,7 @@ abstract class ES_DB {
|
|
99 |
* @since 4.2.1
|
100 |
*/
|
101 |
public function get_by_conditions( $where = '', $output = ARRAY_A ) {
|
102 |
-
global $
|
103 |
|
104 |
$query = "SELECT * FROM $this->table_name";
|
105 |
|
@@ -107,7 +116,7 @@ abstract class ES_DB {
|
|
107 |
$query .= " WHERE $where";
|
108 |
}
|
109 |
|
110 |
-
return $
|
111 |
}
|
112 |
|
113 |
/**
|
@@ -132,14 +141,14 @@ abstract class ES_DB {
|
|
132 |
* @since 4.0.0
|
133 |
*/
|
134 |
public function get_column( $column, $row_id = 0 ) {
|
135 |
-
global $
|
136 |
|
137 |
$column = esc_sql( $column );
|
138 |
|
139 |
if ( $row_id ) {
|
140 |
-
return $
|
141 |
} else {
|
142 |
-
return $
|
143 |
}
|
144 |
}
|
145 |
|
@@ -157,15 +166,15 @@ abstract class ES_DB {
|
|
157 |
* @since 4.3.4 Added support to retrieve whole column
|
158 |
*/
|
159 |
public function get_column_by( $column, $column_where, $column_value, $only_one = true ) {
|
160 |
-
global $
|
161 |
|
162 |
$column_where = esc_sql( $column_where );
|
163 |
$column = esc_sql( $column );
|
164 |
|
165 |
if ( $only_one ) {
|
166 |
-
return $
|
167 |
} else {
|
168 |
-
return $
|
169 |
}
|
170 |
}
|
171 |
|
@@ -180,14 +189,14 @@ abstract class ES_DB {
|
|
180 |
* @since 4.3.5
|
181 |
*/
|
182 |
public function get_column_by_condition( $column, $where = '' ) {
|
183 |
-
global $
|
184 |
|
185 |
$column = esc_sql( $column );
|
186 |
|
187 |
if ( ! empty( $where ) ) {
|
188 |
-
return $
|
189 |
} else {
|
190 |
-
return $
|
191 |
}
|
192 |
}
|
193 |
|
@@ -202,7 +211,7 @@ abstract class ES_DB {
|
|
202 |
* @since 4.3.5
|
203 |
*/
|
204 |
public function get_columns_by_condition( $columns = array(), $where = '', $output = ARRAY_A ) {
|
205 |
-
global $
|
206 |
|
207 |
if ( ! is_array( $columns ) ) {
|
208 |
return array();
|
@@ -213,9 +222,9 @@ abstract class ES_DB {
|
|
213 |
$columns = implode( ', ', $columns );
|
214 |
|
215 |
if ( ! empty( $where ) ) {
|
216 |
-
return $
|
217 |
} else {
|
218 |
-
return $
|
219 |
}
|
220 |
}
|
221 |
|
@@ -315,7 +324,7 @@ abstract class ES_DB {
|
|
315 |
*/
|
316 |
public function delete( $row_id = 0 ) {
|
317 |
|
318 |
-
global $
|
319 |
|
320 |
// Row ID must be positive integer
|
321 |
$row_id = absint( $row_id );
|
@@ -324,7 +333,7 @@ abstract class ES_DB {
|
|
324 |
return false;
|
325 |
}
|
326 |
|
327 |
-
$where = $
|
328 |
|
329 |
if ( false === $this->delete_by_condition( $where ) ) {
|
330 |
return false;
|
@@ -370,13 +379,13 @@ abstract class ES_DB {
|
|
370 |
* @since 4.2.4
|
371 |
*/
|
372 |
public function delete_by_condition( $where = '' ) {
|
373 |
-
global $
|
374 |
|
375 |
if ( empty( $where ) ) {
|
376 |
return false;
|
377 |
}
|
378 |
|
379 |
-
if ( false === $
|
380 |
return false;
|
381 |
}
|
382 |
|
@@ -396,7 +405,7 @@ abstract class ES_DB {
|
|
396 |
global $wpdb;
|
397 |
$table = sanitize_text_field( $table );
|
398 |
|
399 |
-
return $wpdb->get_var( $wpdb->prepare(
|
400 |
}
|
401 |
|
402 |
/**
|
@@ -418,15 +427,15 @@ abstract class ES_DB {
|
|
418 |
* @since 4.2.1
|
419 |
*/
|
420 |
public function count( $where = '' ) {
|
421 |
-
global $
|
422 |
|
423 |
$query = "SELECT count(*) FROM $this->table_name";
|
424 |
|
425 |
if ( ! empty( $where ) ) {
|
426 |
$query .= " WHERE $where";
|
427 |
}
|
428 |
-
|
429 |
-
return $
|
430 |
}
|
431 |
|
432 |
/**
|
@@ -440,7 +449,7 @@ abstract class ES_DB {
|
|
440 |
* @since 4.3.5 Fixed issues and started using it.
|
441 |
*/
|
442 |
public function bulk_insert( $values, $length = 100 ) {
|
443 |
-
global $
|
444 |
|
445 |
if ( ! is_array( $values ) ) {
|
446 |
return false;
|
@@ -480,7 +489,8 @@ abstract class ES_DB {
|
|
480 |
|
481 |
foreach ( $batches as $key => $batch ) {
|
482 |
|
483 |
-
$place_holders =
|
|
|
484 |
|
485 |
foreach ( $batch as $value ) {
|
486 |
|
@@ -490,21 +500,21 @@ abstract class ES_DB {
|
|
490 |
$formats[] = $format;
|
491 |
}
|
492 |
|
493 |
-
$place_holders[] =
|
494 |
-
$fields_str =
|
495 |
}
|
496 |
|
497 |
-
$query
|
498 |
$query .= implode( ', ', $place_holders );
|
499 |
-
$sql
|
500 |
|
501 |
-
if ( ! $
|
502 |
$error_flag = true;
|
503 |
}
|
504 |
}
|
505 |
|
506 |
// Check if error occured during executing the query.
|
507 |
-
if( $error_flag ) {
|
508 |
return false;
|
509 |
}
|
510 |
|
@@ -512,6 +522,8 @@ abstract class ES_DB {
|
|
512 |
}
|
513 |
|
514 |
/**
|
|
|
|
|
515 |
* @param $table_name
|
516 |
* @param $fields
|
517 |
* @param $place_holders
|
@@ -519,18 +531,17 @@ abstract class ES_DB {
|
|
519 |
*
|
520 |
* @return bool
|
521 |
*
|
522 |
-
*
|
523 |
*/
|
524 |
public static function do_insert( $table_name, $fields, $place_holders, $values ) {
|
525 |
-
global $
|
526 |
|
527 |
-
$fields_str =
|
528 |
|
529 |
-
$query
|
530 |
$query .= implode( ', ', $place_holders );
|
531 |
-
$sql
|
532 |
|
533 |
-
if ( $
|
534 |
return true;
|
535 |
} else {
|
536 |
return false;
|
@@ -554,7 +565,7 @@ abstract class ES_DB {
|
|
554 |
/**
|
555 |
* Get map of two columns
|
556 |
*
|
557 |
-
*
|
558 |
*
|
559 |
* @param string $column_1
|
560 |
* @param string $column_2
|
10 |
* @since 4.0
|
11 |
*/
|
12 |
abstract class ES_DB {
|
13 |
+
|
14 |
/**
|
15 |
+
* Table name
|
16 |
+
*
|
17 |
* @since 4.0.0
|
18 |
* @var $table_name
|
19 |
*
|
21 |
public $table_name;
|
22 |
|
23 |
/**
|
24 |
+
* Table DB version
|
25 |
+
*
|
26 |
* @since 4.0.0
|
27 |
* @var $version
|
28 |
*
|
30 |
public $version;
|
31 |
|
32 |
/**
|
33 |
+
* Table primary key column name
|
34 |
+
*
|
35 |
* @since 4.0.0
|
36 |
* @var $primary_key
|
37 |
*
|
58 |
}
|
59 |
|
60 |
/**
|
61 |
+
* Get columns default values
|
62 |
+
*
|
63 |
* @return array
|
64 |
*
|
65 |
* @since 4.0.0
|
78 |
* @since 4.0.0
|
79 |
*/
|
80 |
public function get( $row_id, $output = ARRAY_A ) {
|
81 |
+
global $wpbd;
|
82 |
|
83 |
+
return $wpbd->get_row( $wpbd->prepare( "SELECT * FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ), $output );
|
84 |
}
|
85 |
|
86 |
/**
|
94 |
* @since 4.0.0
|
95 |
*/
|
96 |
public function get_by( $column, $row_id, $output = ARRAY_A ) {
|
97 |
+
global $wpbd;
|
98 |
$column = esc_sql( $column );
|
99 |
|
100 |
+
return $wpbd->get_row( $wpbd->prepare( "SELECT * FROM $this->table_name WHERE $column = %s LIMIT 1;", $row_id ), $output );
|
101 |
}
|
102 |
|
103 |
/**
|
108 |
* @since 4.2.1
|
109 |
*/
|
110 |
public function get_by_conditions( $where = '', $output = ARRAY_A ) {
|
111 |
+
global $wpbd;
|
112 |
|
113 |
$query = "SELECT * FROM $this->table_name";
|
114 |
|
116 |
$query .= " WHERE $where";
|
117 |
}
|
118 |
|
119 |
+
return $wpbd->get_results( $query, $output );
|
120 |
}
|
121 |
|
122 |
/**
|
141 |
* @since 4.0.0
|
142 |
*/
|
143 |
public function get_column( $column, $row_id = 0 ) {
|
144 |
+
global $wpbd;
|
145 |
|
146 |
$column = esc_sql( $column );
|
147 |
|
148 |
if ( $row_id ) {
|
149 |
+
return $wpbd->get_var( $wpbd->prepare( "SELECT $column FROM $this->table_name WHERE $this->primary_key = %s LIMIT 1;", $row_id ) );
|
150 |
} else {
|
151 |
+
return $wpbd->get_col( "SELECT $column FROM $this->table_name" );
|
152 |
}
|
153 |
}
|
154 |
|
166 |
* @since 4.3.4 Added support to retrieve whole column
|
167 |
*/
|
168 |
public function get_column_by( $column, $column_where, $column_value, $only_one = true ) {
|
169 |
+
global $wpbd;
|
170 |
|
171 |
$column_where = esc_sql( $column_where );
|
172 |
$column = esc_sql( $column );
|
173 |
|
174 |
if ( $only_one ) {
|
175 |
+
return $wpbd->get_var( $wpbd->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = %s LIMIT 1;", $column_value ) );
|
176 |
} else {
|
177 |
+
return $wpbd->get_col( $wpbd->prepare( "SELECT $column FROM $this->table_name WHERE $column_where = %s;", $column_value ) );
|
178 |
}
|
179 |
}
|
180 |
|
189 |
* @since 4.3.5
|
190 |
*/
|
191 |
public function get_column_by_condition( $column, $where = '' ) {
|
192 |
+
global $wpbd;
|
193 |
|
194 |
$column = esc_sql( $column );
|
195 |
|
196 |
if ( ! empty( $where ) ) {
|
197 |
+
return $wpbd->get_col( "SELECT $column FROM $this->table_name WHERE $where" );
|
198 |
} else {
|
199 |
+
return $wpbd->get_col( "SELECT $column FROM $this->table_name" );
|
200 |
}
|
201 |
}
|
202 |
|
211 |
* @since 4.3.5
|
212 |
*/
|
213 |
public function get_columns_by_condition( $columns = array(), $where = '', $output = ARRAY_A ) {
|
214 |
+
global $wpbd;
|
215 |
|
216 |
if ( ! is_array( $columns ) ) {
|
217 |
return array();
|
222 |
$columns = implode( ', ', $columns );
|
223 |
|
224 |
if ( ! empty( $where ) ) {
|
225 |
+
return $wpbd->get_results( "SELECT $columns FROM $this->table_name WHERE $where", $output );
|
226 |
} else {
|
227 |
+
return $wpbd->get_results( "SELECT $columns FROM $this->table_name", $output );
|
228 |
}
|
229 |
}
|
230 |
|
324 |
*/
|
325 |
public function delete( $row_id = 0 ) {
|
326 |
|
327 |
+
global $wpbd;
|
328 |
|
329 |
// Row ID must be positive integer
|
330 |
$row_id = absint( $row_id );
|
333 |
return false;
|
334 |
}
|
335 |
|
336 |
+
$where = $wpbd->prepare( "$this->primary_key = %d", $row_id );
|
337 |
|
338 |
if ( false === $this->delete_by_condition( $where ) ) {
|
339 |
return false;
|
379 |
* @since 4.2.4
|
380 |
*/
|
381 |
public function delete_by_condition( $where = '' ) {
|
382 |
+
global $wpbd;
|
383 |
|
384 |
if ( empty( $where ) ) {
|
385 |
return false;
|
386 |
}
|
387 |
|
388 |
+
if ( false === $wpbd->query( "DELETE FROM $this->table_name WHERE $where" ) ) {
|
389 |
return false;
|
390 |
}
|
391 |
|
405 |
global $wpdb;
|
406 |
$table = sanitize_text_field( $table );
|
407 |
|
408 |
+
return $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ) === $table;
|
409 |
}
|
410 |
|
411 |
/**
|
427 |
* @since 4.2.1
|
428 |
*/
|
429 |
public function count( $where = '' ) {
|
430 |
+
global $wpbd;
|
431 |
|
432 |
$query = "SELECT count(*) FROM $this->table_name";
|
433 |
|
434 |
if ( ! empty( $where ) ) {
|
435 |
$query .= " WHERE $where";
|
436 |
}
|
437 |
+
|
438 |
+
return $wpbd->get_var( $query );
|
439 |
}
|
440 |
|
441 |
/**
|
449 |
* @since 4.3.5 Fixed issues and started using it.
|
450 |
*/
|
451 |
public function bulk_insert( $values, $length = 100 ) {
|
452 |
+
global $wpbd;
|
453 |
|
454 |
if ( ! is_array( $values ) ) {
|
455 |
return false;
|
489 |
|
490 |
foreach ( $batches as $key => $batch ) {
|
491 |
|
492 |
+
$place_holders = array();
|
493 |
+
$final_values = array();
|
494 |
|
495 |
foreach ( $batch as $value ) {
|
496 |
|
500 |
$formats[] = $format;
|
501 |
}
|
502 |
|
503 |
+
$place_holders[] = '( ' . implode( ', ', $formats ) . ' )';
|
504 |
+
$fields_str = '`' . implode( '`, `', $fields ) . '`';
|
505 |
}
|
506 |
|
507 |
+
$query = "INSERT INTO $this->table_name ({$fields_str}) VALUES ";
|
508 |
$query .= implode( ', ', $place_holders );
|
509 |
+
$sql = $wpbd->prepare( $query, $final_values );
|
510 |
|
511 |
+
if ( ! $wpbd->query( $sql ) ) {
|
512 |
$error_flag = true;
|
513 |
}
|
514 |
}
|
515 |
|
516 |
// Check if error occured during executing the query.
|
517 |
+
if ( $error_flag ) {
|
518 |
return false;
|
519 |
}
|
520 |
|
522 |
}
|
523 |
|
524 |
/**
|
525 |
+
* Bulk insert data into given table
|
526 |
+
*
|
527 |
* @param $table_name
|
528 |
* @param $fields
|
529 |
* @param $place_holders
|
531 |
*
|
532 |
* @return bool
|
533 |
*
|
|
|
534 |
*/
|
535 |
public static function do_insert( $table_name, $fields, $place_holders, $values ) {
|
536 |
+
global $wpbd;
|
537 |
|
538 |
+
$fields_str = '`' . implode( '`, `', $fields ) . '`';
|
539 |
|
540 |
+
$query = "INSERT INTO $table_name ({$fields_str}) VALUES ";
|
541 |
$query .= implode( ', ', $place_holders );
|
542 |
+
$sql = $wpbd->prepare( $query, $values );
|
543 |
|
544 |
+
if ( $wpbd->query( $sql ) ) {
|
545 |
return true;
|
546 |
} else {
|
547 |
return false;
|
565 |
/**
|
566 |
* Get map of two columns
|
567 |
*
|
568 |
+
* E.g array($column_1 => $column_2)
|
569 |
*
|
570 |
* @param string $column_1
|
571 |
* @param string $column_2
|
lite/includes/es-backward.php
CHANGED
@@ -18,7 +18,7 @@ class es_cls_dbquery {
|
|
18 |
return $es_lists;
|
19 |
}
|
20 |
|
21 |
-
public static function es_view_subscriber_ins( $data = array(), $action =
|
22 |
|
23 |
if ( empty( $data['es_email_mail'] ) ) {
|
24 |
return;
|
@@ -59,11 +59,11 @@ class es_cls_dbquery {
|
|
59 |
if ( $contact_id ) {
|
60 |
|
61 |
$optin_type = get_option( 'ig_es_optin_type', true );
|
62 |
-
$optin_type = (
|
63 |
|
64 |
$status = 'subscribed';
|
65 |
|
66 |
-
if (
|
67 |
$status = 'unconfirmed';
|
68 |
}
|
69 |
|
@@ -93,7 +93,7 @@ class es_cls_dbquery {
|
|
93 |
'list_name' => $list_name
|
94 |
);
|
95 |
|
96 |
-
if (
|
97 |
|
98 |
// Send Welcome Email.
|
99 |
ES()->mailer->send_welcome_email( $email, $data );
|
@@ -126,4 +126,4 @@ class es_cls_settings {
|
|
126 |
}
|
127 |
}
|
128 |
|
129 |
-
|
18 |
return $es_lists;
|
19 |
}
|
20 |
|
21 |
+
public static function es_view_subscriber_ins( $data = array(), $action = 'insert' ) {
|
22 |
|
23 |
if ( empty( $data['es_email_mail'] ) ) {
|
24 |
return;
|
59 |
if ( $contact_id ) {
|
60 |
|
61 |
$optin_type = get_option( 'ig_es_optin_type', true );
|
62 |
+
$optin_type = ( 'double_opt_in' === $optin_type ) ? 2 : 1;
|
63 |
|
64 |
$status = 'subscribed';
|
65 |
|
66 |
+
if ( 2 == $optin_type ) {
|
67 |
$status = 'unconfirmed';
|
68 |
}
|
69 |
|
93 |
'list_name' => $list_name
|
94 |
);
|
95 |
|
96 |
+
if ( 1 == $optin_type ) {
|
97 |
|
98 |
// Send Welcome Email.
|
99 |
ES()->mailer->send_welcome_email( $email, $data );
|
126 |
}
|
127 |
}
|
128 |
|
129 |
+
|
lite/includes/es-core-functions.php
CHANGED
@@ -131,7 +131,7 @@ if ( ! function_exists( 'ig_es_format_date_time' ) ) {
|
|
131 |
*/
|
132 |
function ig_es_format_date_time( $date ) {
|
133 |
|
134 |
-
$local_timestamp = (
|
135 |
|
136 |
return $local_timestamp;
|
137 |
}
|
@@ -203,6 +203,7 @@ if ( ! function_exists( 'ig_es_get_data' ) ) {
|
|
203 |
* @since 4.1.15
|
204 |
*/
|
205 |
function ig_es_get_data( $array = array(), $var = '', $default = '', $clean = false ) {
|
|
|
206 |
if ( ! empty( $var ) ) {
|
207 |
$value = isset( $array[ $var ] ) ? wp_unslash( $array[ $var ] ) : $default;
|
208 |
} else {
|
@@ -242,7 +243,16 @@ if ( ! function_exists( 'ig_es_get_post_data' ) ) {
|
|
242 |
*
|
243 |
* @since 4.1.15
|
244 |
*/
|
|
|
245 |
function ig_es_get_post_data( $var = '', $default = '', $clean = true ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
return ig_es_get_data( $_POST, $var, $default, $clean );
|
247 |
}
|
248 |
}
|
@@ -259,21 +269,21 @@ if ( ! function_exists( 'ig_es_get_ip' ) ) {
|
|
259 |
|
260 |
// Get real visitor IP behind CloudFlare network
|
261 |
if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) {
|
262 |
-
$ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
|
263 |
} elseif ( isset( $_SERVER['HTTP_X_REAL_IP'] ) ) {
|
264 |
-
$ip = $_SERVER['HTTP_X_REAL_IP'];
|
265 |
} elseif ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {
|
266 |
-
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
267 |
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
|
268 |
-
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
269 |
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) {
|
270 |
-
$ip = $_SERVER['HTTP_X_FORWARDED'];
|
271 |
} elseif ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) {
|
272 |
-
$ip = $_SERVER['HTTP_FORWARDED_FOR'];
|
273 |
} elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {
|
274 |
-
$ip = $_SERVER['HTTP_FORWARDED'];
|
275 |
} else {
|
276 |
-
$ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : 'UNKNOWN';
|
277 |
}
|
278 |
|
279 |
return $ip;
|
@@ -330,14 +340,6 @@ if ( ! function_exists( 'ig_es_get_gmt_offset' ) ) {
|
|
330 |
|
331 |
$offset = get_option( 'gmt_offset' );
|
332 |
|
333 |
-
if ( $offset == '' ) {
|
334 |
-
$tzstring = get_option( 'timezone_string' );
|
335 |
-
$current = date_default_timezone_get();
|
336 |
-
date_default_timezone_set( $tzstring );
|
337 |
-
$offset = date( 'Z' ) / 3600;
|
338 |
-
date_default_timezone_set( $current );
|
339 |
-
}
|
340 |
-
|
341 |
// check if timestamp has DST
|
342 |
if ( ! is_null( $timestamp ) ) {
|
343 |
$l = localtime( $timestamp, true );
|
@@ -365,17 +367,17 @@ if ( ! function_exists( 'ig_es_get_upcoming_daily_datetime' ) ) {
|
|
365 |
$offset = ig_es_get_gmt_offset( true );
|
366 |
$now = time() + $offset;
|
367 |
|
368 |
-
$year = (int)
|
369 |
-
$month = (int)
|
370 |
-
$day = (int)
|
371 |
-
$hour = (int)
|
372 |
-
$minutes = (int)
|
373 |
-
$seconds = (int)
|
374 |
|
375 |
$timestamp = ( $hour * 3600 ) + ( $minutes * 60 ) + $seconds;
|
376 |
|
377 |
if ( $time < $timestamp ) {
|
378 |
-
$day
|
379 |
}
|
380 |
|
381 |
$t = mktime( 0, 0, 0, $month, $day, $year ) + $time;
|
@@ -410,16 +412,16 @@ if ( ! function_exists( 'ig_es_get_upcoming_weekly_datetime' ) ) {
|
|
410 |
$current_day = (int) current_time( 'w' );
|
411 |
|
412 |
// If campaign day is same as the current day then check campaign time also with current time since campaign time may have not already been passed.
|
413 |
-
if( $current_day === (int) $frequency_interval ) {
|
414 |
// Get curret time.
|
415 |
$current_hours = (int) current_time( 'H' );
|
416 |
$current_minutes = (int) current_time( 'i' );
|
417 |
$current_seconds = (int) current_time( 's' );
|
418 |
|
419 |
-
$current_time
|
420 |
|
421 |
// Check if campaign time has not yet passed then we can use today's date/time else use date/time when campaign day comes next time.
|
422 |
-
if( $current_time < $time ) {
|
423 |
$week_day_str = 'today';
|
424 |
} else {
|
425 |
$week_day_str = 'next ' . $week_days_map[ $frequency_interval ];
|
@@ -447,14 +449,14 @@ if ( ! function_exists( 'ig_es_get_upcoming_monthly_datetime' ) ) {
|
|
447 |
*/
|
448 |
function ig_es_get_upcoming_monthly_datetime( $day, $time ) {
|
449 |
|
450 |
-
$month = (int)
|
451 |
-
$year = (int)
|
452 |
|
453 |
-
$expected_time = strtotime(
|
454 |
|
455 |
if ( $expected_time < time() ) {
|
456 |
|
457 |
-
$month
|
458 |
|
459 |
$expected_time = mktime( 0, 0, 0, $month, $day, $year ) + $time;
|
460 |
|
@@ -491,10 +493,10 @@ if ( ! function_exists( 'ig_es_get_next_future_schedule_date' ) ) {
|
|
491 |
$in_future = ! empty( $data['in_future'] ) ? $data['in_future'] : true;
|
492 |
$time_of_day = isset( $data['time_of_day'] ) ? $data['time_of_day'] : 32400;
|
493 |
|
494 |
-
$offset
|
495 |
-
$now
|
496 |
$utc_start += $offset;
|
497 |
-
$times
|
498 |
|
499 |
$next_date = '';
|
500 |
$change_next_date = true;
|
@@ -505,10 +507,10 @@ if ( ! function_exists( 'ig_es_get_next_future_schedule_date' ) ) {
|
|
505 |
// get how many $time_frame are in the time between now and the starttime
|
506 |
switch ( $time_frame ) {
|
507 |
case 'year':
|
508 |
-
$count =
|
509 |
break;
|
510 |
case 'month':
|
511 |
-
$count = (
|
512 |
break;
|
513 |
case 'week':
|
514 |
$count = floor( ( ( $now - $utc_start ) / 86400 ) / 7 );
|
@@ -522,25 +524,29 @@ if ( ! function_exists( 'ig_es_get_next_future_schedule_date' ) ) {
|
|
522 |
case 'immediately':
|
523 |
$time_frame = 'day';
|
524 |
$next_date = $now;
|
525 |
-
$interval =
|
|
|
526 |
$change_next_date = false;
|
527 |
break;
|
528 |
case 'daily':
|
529 |
$time_frame = 'day';
|
530 |
$next_date = ig_es_get_upcoming_daily_datetime( $time_of_day );
|
531 |
-
$interval =
|
|
|
532 |
$change_next_date = false;
|
533 |
break;
|
534 |
case 'weekly':
|
535 |
$time_frame = 'day';
|
536 |
$next_date = ig_es_get_upcoming_weekly_datetime( $interval, $time_of_day );
|
537 |
-
$interval =
|
|
|
538 |
$change_next_date = false;
|
539 |
break;
|
540 |
case 'monthly':
|
541 |
$time_frame = 'day';
|
542 |
$next_date = ig_es_get_upcoming_monthly_datetime( $interval, $time_of_day );
|
543 |
-
$interval =
|
|
|
544 |
$change_next_date = false;
|
545 |
break;
|
546 |
default:
|
@@ -553,17 +559,17 @@ if ( ! function_exists( 'ig_es_get_next_future_schedule_date' ) ) {
|
|
553 |
|
554 |
// We have already got the next date for weekly & monthly
|
555 |
if ( empty( $next_date ) ) {
|
556 |
-
$next_date = strtotime(
|
557 |
}
|
558 |
|
559 |
// add a single entity if date is still in the past or just now
|
560 |
if ( $in_future && ( $next_date - $now < 0 || $next_date == $utc_start ) && $change_next_date ) {
|
561 |
-
$next_date = strtotime(
|
562 |
}
|
563 |
|
564 |
if ( ! empty( $weekdays ) && count( $weekdays ) < 7 ) {
|
565 |
|
566 |
-
$day_of_week =
|
567 |
|
568 |
$i = 0;
|
569 |
if ( ! $interval ) {
|
@@ -581,7 +587,7 @@ if ( ! function_exists( 'ig_es_get_next_future_schedule_date' ) ) {
|
|
581 |
$next_date = strtotime( "+{$interval} {$time_frame}", $next_date );
|
582 |
}
|
583 |
|
584 |
-
$day_of_week =
|
585 |
|
586 |
// Force break
|
587 |
if ( $i > 500 ) {
|
@@ -641,7 +647,7 @@ if ( ! function_exists( 'ig_es_get_raw_human_interval' ) ) {
|
|
641 |
$interval['days'] = floor( $interval_in_seconds / $seconds_in_day );
|
642 |
|
643 |
// extract hours
|
644 |
-
$hour_seconds
|
645 |
$interval['hours'] = floor( $hour_seconds / $seconds_in__hour );
|
646 |
|
647 |
// extract minutes
|
@@ -649,7 +655,7 @@ if ( ! function_exists( 'ig_es_get_raw_human_interval' ) ) {
|
|
649 |
$interval['minutes'] = floor( $minute_seconds / $seconds_in_minute );
|
650 |
|
651 |
// extract the remaining seconds
|
652 |
-
$remaining_seconds
|
653 |
$interval['seconds'] = ceil( $remaining_seconds );
|
654 |
|
655 |
return $interval;
|
@@ -696,4 +702,176 @@ if ( ! function_exists( 'ig_es_get_human_interval' ) ) {
|
|
696 |
return trim( $human_time );
|
697 |
|
698 |
}
|
699 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
*/
|
132 |
function ig_es_format_date_time( $date ) {
|
133 |
|
134 |
+
$local_timestamp = ( '0000-00-00 00:00:00' !== $date ) ? ES_Common::convert_date_to_wp_date( get_date_from_gmt( $date )) : '<i class="dashicons dashicons-es dashicons-minus"></i>';
|
135 |
|
136 |
return $local_timestamp;
|
137 |
}
|
203 |
* @since 4.1.15
|
204 |
*/
|
205 |
function ig_es_get_data( $array = array(), $var = '', $default = '', $clean = false ) {
|
206 |
+
|
207 |
if ( ! empty( $var ) ) {
|
208 |
$value = isset( $array[ $var ] ) ? wp_unslash( $array[ $var ] ) : $default;
|
209 |
} else {
|
243 |
*
|
244 |
* @since 4.1.15
|
245 |
*/
|
246 |
+
|
247 |
function ig_es_get_post_data( $var = '', $default = '', $clean = true ) {
|
248 |
+
|
249 |
+
$nonce = ! empty( $_POST['es-nonce'] ) ? sanitize_text_field( $_POST['es-nonce'] ) : '';
|
250 |
+
|
251 |
+
if ( wp_verify_nonce( $nonce, 'es-nonce' ) ) {
|
252 |
+
//TODO: Verify Nonce
|
253 |
+
$nonce_verified = true;
|
254 |
+
}
|
255 |
+
|
256 |
return ig_es_get_data( $_POST, $var, $default, $clean );
|
257 |
}
|
258 |
}
|
269 |
|
270 |
// Get real visitor IP behind CloudFlare network
|
271 |
if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) {
|
272 |
+
$ip = sanitize_text_field( $_SERVER['HTTP_CF_CONNECTING_IP'] );
|
273 |
} elseif ( isset( $_SERVER['HTTP_X_REAL_IP'] ) ) {
|
274 |
+
$ip = sanitize_text_field( $_SERVER['HTTP_X_REAL_IP'] );
|
275 |
} elseif ( isset( $_SERVER['HTTP_CLIENT_IP'] ) ) {
|
276 |
+
$ip = sanitize_text_field( $_SERVER['HTTP_CLIENT_IP'] );
|
277 |
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
|
278 |
+
$ip = sanitize_text_field( $_SERVER['HTTP_X_FORWARDED_FOR'] );
|
279 |
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED'] ) ) {
|
280 |
+
$ip = sanitize_text_field( $_SERVER['HTTP_X_FORWARDED'] );
|
281 |
} elseif ( isset( $_SERVER['HTTP_FORWARDED_FOR'] ) ) {
|
282 |
+
$ip = sanitize_text_field( $_SERVER['HTTP_FORWARDED_FOR'] );
|
283 |
} elseif ( isset( $_SERVER['HTTP_FORWARDED'] ) ) {
|
284 |
+
$ip = sanitize_text_field( $_SERVER['HTTP_FORWARDED'] );
|
285 |
} else {
|
286 |
+
$ip = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( $_SERVER['REMOTE_ADDR'] ) : 'UNKNOWN';
|
287 |
}
|
288 |
|
289 |
return $ip;
|
340 |
|
341 |
$offset = get_option( 'gmt_offset' );
|
342 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
// check if timestamp has DST
|
344 |
if ( ! is_null( $timestamp ) ) {
|
345 |
$l = localtime( $timestamp, true );
|
367 |
$offset = ig_es_get_gmt_offset( true );
|
368 |
$now = time() + $offset;
|
369 |
|
370 |
+
$year = (int) gmdate( 'Y', $now );
|
371 |
+
$month = (int) gmdate( 'm', $now );
|
372 |
+
$day = (int) gmdate( 'd', $now );
|
373 |
+
$hour = (int) gmdate( 'H', $now );
|
374 |
+
$minutes = (int) gmdate( 'i', $now );
|
375 |
+
$seconds = (int) gmdate( 's', $now );
|
376 |
|
377 |
$timestamp = ( $hour * 3600 ) + ( $minutes * 60 ) + $seconds;
|
378 |
|
379 |
if ( $time < $timestamp ) {
|
380 |
+
$day++;
|
381 |
}
|
382 |
|
383 |
$t = mktime( 0, 0, 0, $month, $day, $year ) + $time;
|
412 |
$current_day = (int) current_time( 'w' );
|
413 |
|
414 |
// If campaign day is same as the current day then check campaign time also with current time since campaign time may have not already been passed.
|
415 |
+
if ( $current_day === (int) $frequency_interval ) {
|
416 |
// Get curret time.
|
417 |
$current_hours = (int) current_time( 'H' );
|
418 |
$current_minutes = (int) current_time( 'i' );
|
419 |
$current_seconds = (int) current_time( 's' );
|
420 |
|
421 |
+
$current_time = $current_hours * HOUR_IN_SECONDS + $current_minutes * MINUTE_IN_SECONDS + $current_seconds;
|
422 |
|
423 |
// Check if campaign time has not yet passed then we can use today's date/time else use date/time when campaign day comes next time.
|
424 |
+
if ( $current_time < $time ) {
|
425 |
$week_day_str = 'today';
|
426 |
} else {
|
427 |
$week_day_str = 'next ' . $week_days_map[ $frequency_interval ];
|
449 |
*/
|
450 |
function ig_es_get_upcoming_monthly_datetime( $day, $time ) {
|
451 |
|
452 |
+
$month = (int) gmdate( 'm', time() );
|
453 |
+
$year = (int) gmdate( 'Y', time() );
|
454 |
|
455 |
+
$expected_time = strtotime( gmdate( 'Y-m-d' ) ) + $time;
|
456 |
|
457 |
if ( $expected_time < time() ) {
|
458 |
|
459 |
+
$month++;
|
460 |
|
461 |
$expected_time = mktime( 0, 0, 0, $month, $day, $year ) + $time;
|
462 |
|
493 |
$in_future = ! empty( $data['in_future'] ) ? $data['in_future'] : true;
|
494 |
$time_of_day = isset( $data['time_of_day'] ) ? $data['time_of_day'] : 32400;
|
495 |
|
496 |
+
$offset = ig_es_get_gmt_offset( true );
|
497 |
+
$now = time() + $offset;
|
498 |
$utc_start += $offset;
|
499 |
+
$times = 1;
|
500 |
|
501 |
$next_date = '';
|
502 |
$change_next_date = true;
|
507 |
// get how many $time_frame are in the time between now and the starttime
|
508 |
switch ( $time_frame ) {
|
509 |
case 'year':
|
510 |
+
$count = gmdate( 'Y', $now ) - gmdate( 'Y', $utc_start );
|
511 |
break;
|
512 |
case 'month':
|
513 |
+
$count = ( gmdate( 'Y', $now ) - gmdate( 'Y', $utc_start ) ) * 12 + ( gmdate( 'm', $now ) - gmdate( 'm', $utc_start ) );
|
514 |
break;
|
515 |
case 'week':
|
516 |
$count = floor( ( ( $now - $utc_start ) / 86400 ) / 7 );
|
524 |
case 'immediately':
|
525 |
$time_frame = 'day';
|
526 |
$next_date = $now;
|
527 |
+
$interval = 1;
|
528 |
+
$count = 1;
|
529 |
$change_next_date = false;
|
530 |
break;
|
531 |
case 'daily':
|
532 |
$time_frame = 'day';
|
533 |
$next_date = ig_es_get_upcoming_daily_datetime( $time_of_day );
|
534 |
+
$interval = 1;
|
535 |
+
$count = 1;
|
536 |
$change_next_date = false;
|
537 |
break;
|
538 |
case 'weekly':
|
539 |
$time_frame = 'day';
|
540 |
$next_date = ig_es_get_upcoming_weekly_datetime( $interval, $time_of_day );
|
541 |
+
$interval = 1;
|
542 |
+
$count = 1;
|
543 |
$change_next_date = false;
|
544 |
break;
|
545 |
case 'monthly':
|
546 |
$time_frame = 'day';
|
547 |
$next_date = ig_es_get_upcoming_monthly_datetime( $interval, $time_of_day );
|
548 |
+
$interval = 1;
|
549 |
+
$count = 1;
|
550 |
$change_next_date = false;
|
551 |
break;
|
552 |
default:
|
559 |
|
560 |
// We have already got the next date for weekly & monthly
|
561 |
if ( empty( $next_date ) ) {
|
562 |
+
$next_date = strtotime( gmdate( 'Y-m-d H:i:s', $utc_start ) . ' +' . ( $interval * $times ) . " {$time_frame}" );
|
563 |
}
|
564 |
|
565 |
// add a single entity if date is still in the past or just now
|
566 |
if ( $in_future && ( $next_date - $now < 0 || $next_date == $utc_start ) && $change_next_date ) {
|
567 |
+
$next_date = strtotime( gmdate( 'Y-m-d H:i:s', $utc_start ) . ' +' . ( $interval * $times + $interval ) . " {$time_frame}" );
|
568 |
}
|
569 |
|
570 |
if ( ! empty( $weekdays ) && count( $weekdays ) < 7 ) {
|
571 |
|
572 |
+
$day_of_week = gmdate( 'w', $next_date );
|
573 |
|
574 |
$i = 0;
|
575 |
if ( ! $interval ) {
|
587 |
$next_date = strtotime( "+{$interval} {$time_frame}", $next_date );
|
588 |
}
|
589 |
|
590 |
+
$day_of_week = gmdate( 'w', $next_date );
|
591 |
|
592 |
// Force break
|
593 |
if ( $i > 500 ) {
|
647 |
$interval['days'] = floor( $interval_in_seconds / $seconds_in_day );
|
648 |
|
649 |
// extract hours
|
650 |
+
$hour_seconds = $interval_in_seconds % $seconds_in_day;
|
651 |
$interval['hours'] = floor( $hour_seconds / $seconds_in__hour );
|
652 |
|
653 |
// extract minutes
|
655 |
$interval['minutes'] = floor( $minute_seconds / $seconds_in_minute );
|
656 |
|
657 |
// extract the remaining seconds
|
658 |
+
$remaining_seconds = $minute_seconds % $seconds_in_minute;
|
659 |
$interval['seconds'] = ceil( $remaining_seconds );
|
660 |
|
661 |
return $interval;
|
702 |
return trim( $human_time );
|
703 |
|
704 |
}
|
705 |
+
}
|
706 |
+
|
707 |
+
if ( ! function_exists( 'ig_es_allowed_html_tags_in_esc' ) ) {
|
708 |
+
/**
|
709 |
+
* Allow Html tags in WP Kses
|
710 |
+
*
|
711 |
+
* @since 4.5.4
|
712 |
+
*/
|
713 |
+
function ig_es_allowed_html_tags_in_esc() {
|
714 |
+
$context_allowed_tags = wp_kses_allowed_html('post');
|
715 |
+
$custom_allowed_tags = array(
|
716 |
+
'select' => array(
|
717 |
+
'class' => true,
|
718 |
+
'name' => true,
|
719 |
+
'id' => true,
|
720 |
+
'style' => true,
|
721 |
+
'title' => true,
|
722 |
+
'role' => true,
|
723 |
+
'data-*' => true,
|
724 |
+
'tab-*' => true,
|
725 |
+
'multiple' => true,
|
726 |
+
'aria-*' => true,
|
727 |
+
|
728 |
+
),
|
729 |
+
'option' => array(
|
730 |
+
'class' => true,
|
731 |
+
'value' => true,
|
732 |
+
'selected' => true,
|
733 |
+
'name' => true,
|
734 |
+
'id' => true,
|
735 |
+
'style' => true,
|
736 |
+
'title' => true,
|
737 |
+
'data-*' => true,
|
738 |
+
),
|
739 |
+
'input' => array(
|
740 |
+
'class' => true,
|
741 |
+
'name' => true,
|
742 |
+
'type' => true,
|
743 |
+
'value' => true,
|
744 |
+
'id' => true,
|
745 |
+
'checked' => true,
|
746 |
+
'disabled' => true,
|
747 |
+
'selected' => true,
|
748 |
+
'style' => true,
|
749 |
+
'required' => 'required',
|
750 |
+
'min' => true,
|
751 |
+
'max' => true,
|
752 |
+
'maxlength' => true,
|
753 |
+
'size' => true,
|
754 |
+
'placeholder' => true,
|
755 |
+
'autocomplete' => true,
|
756 |
+
'autocapitalize'=> true,
|
757 |
+
'autocorrect' => true,
|
758 |
+
'tabindex' => true,
|
759 |
+
'role' => true,
|
760 |
+
'aria-*' => true,
|
761 |
+
'data-*' => true,
|
762 |
+
),
|
763 |
+
'label' => array(
|
764 |
+
'class' => true,
|
765 |
+
'name' => true,
|
766 |
+
'type' => true,
|
767 |
+
'value' => true,
|
768 |
+
'id' => true,
|
769 |
+
'for' => true,
|
770 |
+
'style' => true,
|
771 |
+
),
|
772 |
+
'form' => array(
|
773 |
+
'class' => true,
|
774 |
+
'name' => true,
|
775 |
+
'value' => true,
|
776 |
+
'id' => true,
|
777 |
+
'style' => true,
|
778 |
+
'action' => true,
|
779 |
+
),
|
780 |
+
'svg' => array(
|
781 |
+
'width' => true,
|
782 |
+
'height' => true,
|
783 |
+
'viewbox' => true,
|
784 |
+
'xmlns' => true,
|
785 |
+
'class' => true,
|
786 |
+
'stroke-linecap' => true,
|
787 |
+
'stroke-linejoin' => true,
|
788 |
+
),
|
789 |
+
'path' => array(
|
790 |
+
'd' => true,
|
791 |
+
'fill' => true,
|
792 |
+
'class' => true,
|
793 |
+
),
|
794 |
+
'main' => array(
|
795 |
+
'align' => true,
|
796 |
+
'dir' => true,
|
797 |
+
'lang' => true,
|
798 |
+
'xml:lang' => true,
|
799 |
+
'aria-describedby' => true,
|
800 |
+
'aria-details' => true,
|
801 |
+
'aria-label' => true,
|
802 |
+
'aria-labelledby' => true,
|
803 |
+
'aria-hidden' => true,
|
804 |
+
'class' => true,
|
805 |
+
'id' => true,
|
806 |
+
'style' => true,
|
807 |
+
'title' => true,
|
808 |
+
'role' => true,
|
809 |
+
'data-*' => true,
|
810 |
+
),
|
811 |
+
'textarea' => array(
|
812 |
+
'autocomplete' => true,
|
813 |
+
),
|
814 |
+
'style' => array(),
|
815 |
+
'link' => array(
|
816 |
+
'rel' => true,
|
817 |
+
'id' => true,
|
818 |
+
'href' => true,
|
819 |
+
'media' => true,
|
820 |
+
),
|
821 |
+
);
|
822 |
+
$allowedtags = array_merge_recursive( $context_allowed_tags, $custom_allowed_tags );
|
823 |
+
|
824 |
+
return $allowedtags;
|
825 |
+
}
|
826 |
+
}
|
827 |
+
|
828 |
+
if ( ! function_exists( 'ig_es_allowed_css_style' ) ) {
|
829 |
+
/**
|
830 |
+
* Allow CSS style in WP Kses
|
831 |
+
*
|
832 |
+
* @since 4.5.4
|
833 |
+
*/
|
834 |
+
function ig_es_allowed_css_style( $default_allowed_attr ) {
|
835 |
+
$custom_allowed_css = array('display', 'opacity');
|
836 |
+
$allowed_attr = array_merge( $default_allowed_attr, $custom_allowed_css );
|
837 |
+
return $allowed_attr;
|
838 |
+
}
|
839 |
+
}
|
840 |
+
|
841 |
+
if ( ! function_exists( 'ig_es_increase_memory_limit' ) ) {
|
842 |
+
|
843 |
+
/**
|
844 |
+
* Return memory limit required for ES heavy operations
|
845 |
+
*
|
846 |
+
* @return string
|
847 |
+
*
|
848 |
+
* @since 4.5.4
|
849 |
+
*/
|
850 |
+
function ig_es_increase_memory_limit() {
|
851 |
+
|
852 |
+
return '256M';
|
853 |
+
}
|
854 |
+
}
|
855 |
+
|
856 |
+
if ( ! function_exists( 'ig_es_remove_utf8_bom' ) ) {
|
857 |
+
|
858 |
+
/**
|
859 |
+
* Remove UTF-8 BOM signature.
|
860 |
+
*
|
861 |
+
* @param string $string String to handle.
|
862 |
+
*
|
863 |
+
* @return string
|
864 |
+
*
|
865 |
+
* @since 4.5.4
|
866 |
+
*/
|
867 |
+
function ig_es_remove_utf8_bom( $string = '' ) {
|
868 |
+
|
869 |
+
// Check if string contains BOM characters.
|
870 |
+
if ( ! empty( $string ) && 'efbbbf' === substr( bin2hex( $string ), 0, 6 ) ) {
|
871 |
+
// Remove BOM characters by extracting substring from the original string after the BOM characters.
|
872 |
+
$string = substr( $string, 3 );
|
873 |
+
}
|
874 |
+
|
875 |
+
return $string;
|
876 |
+
}
|
877 |
+
}
|
lite/includes/feedback.php
CHANGED
@@ -49,7 +49,7 @@ function ig_es_render_general_feedback_widget() {
|
|
49 |
$params = array(
|
50 |
'type' => 'feedback',
|
51 |
'event' => $event,
|
52 |
-
'title' =>
|
53 |
'position' => 'center',
|
54 |
'width' => 700,
|
55 |
'force' => true,
|
@@ -301,7 +301,7 @@ function ig_es_render_broadcast_ui_review() {
|
|
301 |
'showCancelButton' => true,
|
302 |
'cancelButtonText' => __( 'Contact Us', 'email-subscribers' ),
|
303 |
'cancelButtonLink' => 'https://icegram.com',
|
304 |
-
'show_once' => true
|
305 |
);
|
306 |
|
307 |
ES_Common::render_feedback_widget( $params );
|
49 |
$params = array(
|
50 |
'type' => 'feedback',
|
51 |
'event' => $event,
|
52 |
+
'title' => 'Have feedback or question for us?',
|
53 |
'position' => 'center',
|
54 |
'width' => 700,
|
55 |
'force' => true,
|
301 |
'showCancelButton' => true,
|
302 |
'cancelButtonText' => __( 'Contact Us', 'email-subscribers' ),
|
303 |
'cancelButtonLink' => 'https://icegram.com',
|
304 |
+
'show_once' => true,
|
305 |
);
|
306 |
|
307 |
ES_Common::render_feedback_widget( $params );
|
lite/includes/feedback/class-ig-feedback.php
CHANGED
@@ -13,8 +13,6 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
13 |
*
|
14 |
* @class IG_Feedback_V_1_2_3
|
15 |
* @since 1.0.0
|
16 |
-
* @copyright Copyright (c) 2019, Icegram
|
17 |
-
* @license https://opensource.org/licenses/gpl-license GNU Public License
|
18 |
* @author Icegram
|
19 |
* @package feedback
|
20 |
*/
|
@@ -70,6 +68,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
70 |
|
71 |
/**
|
72 |
* Enable/Disable Dev Mode
|
|
|
73 |
* @var bool
|
74 |
*/
|
75 |
public $is_dev_mode = true;
|
@@ -82,7 +81,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
82 |
public $event_prefix;
|
83 |
|
84 |
/**
|
85 |
-
*
|
86 |
*/
|
87 |
public $footer = '<span class="ig-powered-by">Made With 💜 by <a href="https://www.icegram.com/" target="_blank">Icegram</a></span>';
|
88 |
|
@@ -127,7 +126,8 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
127 |
* @since 1.0.12
|
128 |
*/
|
129 |
public function show_review_notice() {
|
130 |
-
|
|
|
131 |
if ( ! defined( 'DOING_AJAX' ) && is_admin() ) {
|
132 |
|
133 |
$enable_review_notice = apply_filters( $this->plugin_abbr . '_enable_review_notice', true );
|
@@ -193,31 +193,33 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
193 |
|
194 |
if ( $can_ask_user_for_review ) {
|
195 |
|
196 |
-
|
|
|
|
|
197 |
|
198 |
$got_feedback = false;
|
199 |
/************** Update Review Status ********************/
|
200 |
-
$nonce = ! empty( $_GET['ig_feedback_nonce'] ) ?
|
201 |
$nonce_verified = wp_verify_nonce( $nonce, 'review' );
|
202 |
|
203 |
$action = '';
|
204 |
if ( $nonce_verified ) {
|
205 |
-
$action = ! empty( $_GET['ig_feedback_action'] ) ?
|
206 |
|
207 |
if ( ! empty( $action ) && $this->is_valid_action( $action ) ) {
|
208 |
update_user_meta( $current_user_id, $action, 1 );
|
209 |
-
update_user_meta( $current_user_id, $action .
|
210 |
|
211 |
// Got the review request?
|
212 |
// Redirect them to review page
|
213 |
if ( $action === $review_done_option ) {
|
214 |
|
215 |
-
$url = ! empty( $_GET['review_url'] ) ? $_GET['review_url'] : '';
|
216 |
|
217 |
if ( ! empty( $url ) ) {
|
218 |
?>
|
219 |
|
220 |
-
|
221 |
|
222 |
<?php
|
223 |
}
|
@@ -232,7 +234,8 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
232 |
|
233 |
$review_url = "https://wordpress.org/support/plugin/{$this->plugin}/reviews/";
|
234 |
$icon_url = plugin_dir_url( __FILE__ ) . 'assets/images/icon-64.png';
|
235 |
-
|
|
|
236 |
|
237 |
$message_data = array(
|
238 |
'review_url' => $review_url,
|
@@ -255,43 +258,43 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
255 |
|
256 |
?>
|
257 |
|
258 |
-
|
259 |
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
|
283 |
-
|
284 |
|
285 |
<?php
|
286 |
|
287 |
echo '<div class="notice notice-success ig-feedback-notice">';
|
288 |
-
echo '<span class="ig-feedback-plugin-icon"> <img src="' . $icon_url . '" alt="Logo"/></span>';
|
289 |
-
echo $message;
|
290 |
echo "<ul class='ig-feedback-notice-links'>";
|
291 |
-
echo sprintf( '<li><a href="%s" class="button-primary" target="_blank" data-rated="' . esc_attr__(
|
292 |
-
|
293 |
esc_url( $review_url ), esc_url( $maybe_later_url ), esc_url( $already_did_url ), esc_url( $no_bug_url ) );
|
294 |
-
echo
|
295 |
echo '</div>';
|
296 |
}
|
297 |
}
|
@@ -352,7 +355,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
352 |
$can_load = apply_filters( $this->plugin_abbr . '_can_load_sweetalert_js', false );
|
353 |
|
354 |
if ( $can_load ) {
|
355 |
-
wp_enqueue_script( 'sweetalert', plugin_dir_url( __FILE__ ) . 'assets/js/sweetalert2.min.js', array( 'jquery' ) );
|
356 |
}
|
357 |
}
|
358 |
|
@@ -423,35 +426,35 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
423 |
|
424 |
$params = $this->prepare_widget_params( $params );
|
425 |
|
426 |
-
$title
|
427 |
-
$slug
|
428 |
-
$event
|
429 |
-
$html
|
430 |
-
|
431 |
?>
|
432 |
|
433 |
-
|
434 |
|
435 |
function doSend(rating, details) {
|
436 |
|
437 |
var data = {
|
438 |
-
action: '<?php echo $this->ajax_action; ?>',
|
439 |
feedback: {
|
440 |
-
type: '<?php echo $params['type']; ?>',
|
441 |
-
slug: '<?php echo $slug; ?>',
|
442 |
title: '<?php echo esc_js( $title ); ?>',
|
443 |
value: rating,
|
444 |
details: details
|
445 |
},
|
446 |
|
447 |
-
event: '<?php echo $event; ?>',
|
448 |
|
449 |
// Add additional information
|
450 |
misc: {
|
451 |
-
plugin: '<?php echo $this->plugin; ?>',
|
452 |
-
plugin_abbr: '<?php echo $this->plugin_abbr; ?>',
|
453 |
-
is_dev_mode: '<?php echo $this->is_dev_mode; ?>',
|
454 |
-
set_transient: '<?php echo $params['set_transient']; ?>'
|
455 |
//system_info: enable_system_info
|
456 |
}
|
457 |
};
|
@@ -464,21 +467,21 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
464 |
setTimeout(function () {
|
465 |
|
466 |
Swal.mixin({
|
467 |
-
footer: '<?php echo $this->footer; ?>',
|
468 |
-
position: '<?php echo $params['position']; ?>',
|
469 |
-
width: <?php echo $params['width']; ?>,
|
470 |
animation: false,
|
471 |
focusConfirm: false,
|
472 |
-
allowEscapeKey: '<?php echo $params['allowEscapeKey']; ?>',
|
473 |
-
showCloseButton: '<?php echo $params['showCloseButton']; ?>',
|
474 |
-
allowOutsideClick: '<?php echo $params['allowOutsideClick']; ?>',
|
475 |
showLoaderOnConfirm: true,
|
476 |
-
confirmButtonText: '<?php echo $params['confirmButtonText']; ?>',
|
477 |
-
backdrop: '<?php echo (int) $params['backdrop']; ?>'
|
478 |
}).queue([
|
479 |
{
|
480 |
title: '<p class="ig-feedback-title"><?php echo esc_js( $params['title'] ); ?></p>',
|
481 |
-
html: '<?php echo $html; ?>',
|
482 |
customClass: {
|
483 |
popup: 'animated fadeInUpBig'
|
484 |
},
|
@@ -524,10 +527,10 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
524 |
|
525 |
Swal.fire({
|
526 |
type: 'success',
|
527 |
-
width: <?php echo $params['width']; ?>,
|
528 |
title: "Thank You!",
|
529 |
showConfirmButton: false,
|
530 |
-
position: '<?php echo $params['position']; ?>',
|
531 |
timer: 1500,
|
532 |
animation: false
|
533 |
});
|
@@ -538,11 +541,11 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
538 |
}, delay * 1000);
|
539 |
}
|
540 |
|
541 |
-
var delay = <?php echo $params['delay']; ?>;
|
542 |
showWidget(delay);
|
543 |
|
544 |
|
545 |
-
|
546 |
<?php
|
547 |
}
|
548 |
|
@@ -559,14 +562,14 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
559 |
|
560 |
?>
|
561 |
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
|
571 |
<?php
|
572 |
|
@@ -590,15 +593,15 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
590 |
|
591 |
?>
|
592 |
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
|
603 |
<?php
|
604 |
|
@@ -617,33 +620,33 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
617 |
*/
|
618 |
public function render_general_feedback( $params = array() ) {
|
619 |
|
620 |
-
$params
|
621 |
-
|
622 |
ob_start();
|
623 |
|
624 |
?>
|
625 |
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
<?php if ( isset( $params['consent'] ) && $params['consent']
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
<?php } ?>
|
645 |
-
|
646 |
-
|
647 |
|
648 |
<?php
|
649 |
|
@@ -659,29 +662,29 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
659 |
ob_start();
|
660 |
?>
|
661 |
|
662 |
-
|
663 |
|
664 |
jQuery(document).ready(function ($) {
|
665 |
|
666 |
function doSend(details, meta, system_info) {
|
667 |
|
668 |
var data = {
|
669 |
-
action: '<?php echo $this->ajax_action; ?>',
|
670 |
feedback: {
|
671 |
-
type: '<?php echo $params['type']; ?>',
|
672 |
-
slug: '<?php echo $slug; ?>',
|
673 |
title: '<?php echo esc_js( $title ); ?>',
|
674 |
details: details
|
675 |
},
|
676 |
|
677 |
-
event: '<?php echo $event; ?>',
|
678 |
|
679 |
// Add additional information
|
680 |
misc: {
|
681 |
-
plugin: '<?php echo $this->plugin; ?>',
|
682 |
-
plugin_abbr: '<?php echo $this->plugin_abbr; ?>',
|
683 |
-
is_dev_mode: '<?php echo $this->is_dev_mode; ?>',
|
684 |
-
set_transient: '<?php echo $params['set_transient']; ?>',
|
685 |
meta_info: meta,
|
686 |
system_info: system_info
|
687 |
}
|
@@ -699,27 +702,27 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
699 |
}
|
700 |
}
|
701 |
|
702 |
-
var feedbackButtonClass = 'ig-feedback-button-<?php echo $this->plugin; ?>';
|
703 |
|
704 |
$('#wpwrap').append('<div class="ig-es-feedback-button ' + feedbackButtonClass + '">Feedback</div>');
|
705 |
|
706 |
$('.' + feedbackButtonClass).on('click', function () {
|
707 |
Swal.mixin({
|
708 |
-
footer: '<?php echo $this->footer; ?>',
|
709 |
-
position: '<?php echo $params['position']; ?>',
|
710 |
-
width: <?php echo $params['width']; ?>,
|
711 |
animation: false,
|
712 |
focusConfirm: false,
|
713 |
allowEscapeKey: true,
|
714 |
-
showCloseButton: '<?php echo $params['showCloseButton']; ?>',
|
715 |
-
allowOutsideClick: '<?php echo $params['allowOutsideClick']; ?>',
|
716 |
showLoaderOnConfirm: true,
|
717 |
-
confirmButtonText: '<?php echo $params['confirmButtonText']; ?>',
|
718 |
-
backdrop: '<?php echo (int) $params['backdrop']; ?>'
|
719 |
}).queue([
|
720 |
{
|
721 |
title: '<p class="ig-feedback-title"><?php echo esc_js( $params['title'] ); ?></p>',
|
722 |
-
html: '<?php echo $html; ?>',
|
723 |
customClass: {
|
724 |
popup: 'animated fadeInUpBig'
|
725 |
},
|
@@ -728,7 +731,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
728 |
|
729 |
},
|
730 |
preConfirm: () => {
|
731 |
-
var $overlay = $('#ig-general-feedback-<?php echo $this->plugin; ?>');
|
732 |
var $form = $overlay.find('form');
|
733 |
|
734 |
var email = $form.find('#ig-feedback-data-email').val();
|
@@ -766,10 +769,10 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
766 |
|
767 |
Swal.fire({
|
768 |
type: 'success',
|
769 |
-
width: <?php echo $params['width']; ?>,
|
770 |
title: "Thank You!",
|
771 |
showConfirmButton: false,
|
772 |
-
position: '<?php echo $params['position']; ?>',
|
773 |
timer: 1500,
|
774 |
animation: false
|
775 |
});
|
@@ -781,7 +784,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
781 |
});
|
782 |
});
|
783 |
|
784 |
-
|
785 |
|
786 |
|
787 |
<?php
|
@@ -797,47 +800,48 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
797 |
|
798 |
$params = $this->prepare_widget_params( $params );
|
799 |
|
800 |
-
$title
|
801 |
-
$widget_tyoe
|
802 |
-
$slug
|
803 |
-
$event
|
804 |
-
$html
|
805 |
$confirm_button_link = ! empty( $params['confirmButtonLink'] ) ? $params['confirmButtonLink'] : '';
|
806 |
-
$cancel_button_link
|
807 |
-
$show_cancel_button
|
808 |
-
$cancel_button_text
|
|
|
809 |
|
810 |
?>
|
811 |
|
812 |
-
|
813 |
|
814 |
Swal.mixin({
|
815 |
-
type: '<?php echo $widget_tyoe; ?>',
|
816 |
-
position: '<?php echo $params['position']; ?>',
|
817 |
-
width: <?php echo $params['width']; ?>,
|
818 |
animation: false,
|
819 |
focusConfirm: true,
|
820 |
allowEscapeKey: true,
|
821 |
-
showCancelButton: <?php echo $show_cancel_button; ?>,
|
822 |
confirmButtonColor: '#0e9f6e',
|
823 |
cancelButtonColor: '#5850ec',
|
824 |
-
cancelButtonText: '<?php echo $cancel_button_text; ?>',
|
825 |
-
showCloseButton: '<?php echo $params['showCloseButton']; ?>',
|
826 |
-
allowOutsideClick: '<?php echo $params['allowOutsideClick']; ?>',
|
827 |
showLoaderOnConfirm: true,
|
828 |
-
confirmButtonText: '<?php echo $params['confirmButtonText']; ?>',
|
829 |
-
backdrop: '<?php echo (int) $params['backdrop']; ?>'
|
830 |
}).queue([
|
831 |
{
|
832 |
title: '<p class="ig-feedback-title"><?php echo esc_js( $params['title'] ); ?></p>',
|
833 |
-
html: '<?php echo $html; ?>',
|
834 |
customClass: {
|
835 |
popup: 'animated fadeInUpBig'
|
836 |
},
|
837 |
|
838 |
preConfirm: () => {
|
839 |
window.open(
|
840 |
-
'<?php echo $confirm_button_link; ?>',
|
841 |
'_blank' // <- This is what makes it open in a new window.
|
842 |
);
|
843 |
}
|
@@ -849,22 +853,22 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
849 |
|
850 |
Swal.fire({
|
851 |
type: 'success',
|
852 |
-
width: <?php echo $params['width']; ?>,
|
853 |
title: "Thank You!",
|
854 |
showConfirmButton: false,
|
855 |
-
position: '<?php echo $params['position']; ?>',
|
856 |
timer: 1500,
|
857 |
animation: false
|
858 |
});
|
859 |
-
} else if(response.dismiss
|
860 |
window.open(
|
861 |
-
'<?php echo $cancel_button_link; ?>',
|
862 |
'_blank' // <- This is what makes it open in a new window.
|
863 |
);
|
864 |
-
|
865 |
});
|
866 |
|
867 |
-
|
868 |
|
869 |
<?php
|
870 |
}
|
@@ -887,29 +891,30 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
887 |
|
888 |
$allow_multiple = ! empty( $params['allow_multiple'] ) ? $params['allow_multiple'] : false;
|
889 |
|
890 |
-
$title
|
891 |
-
$slug
|
892 |
-
$event
|
893 |
-
$desc
|
|
|
894 |
|
895 |
ob_start();
|
896 |
|
897 |
?>
|
898 |
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
|
903 |
-
|
904 |
<?php foreach ( $poll_options as $value => $option ) { ?>
|
905 |
-
|
906 |
<?php } ?>
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
|
914 |
<?php
|
915 |
|
@@ -924,29 +929,29 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
924 |
|
925 |
?>
|
926 |
|
927 |
-
|
928 |
|
929 |
jQuery(document).ready(function ($) {
|
930 |
|
931 |
function doSend(data, meta, system_info) {
|
932 |
|
933 |
var data = {
|
934 |
-
action: '<?php echo $this->ajax_action; ?>',
|
935 |
feedback: {
|
936 |
-
type: '<?php echo $params['type']; ?>',
|
937 |
-
slug: '<?php echo $slug; ?>',
|
938 |
title: '<?php echo esc_js( $title ); ?>',
|
939 |
data: data
|
940 |
},
|
941 |
|
942 |
-
event: '<?php echo $event; ?>',
|
943 |
|
944 |
// Add additional information
|
945 |
misc: {
|
946 |
-
plugin: '<?php echo $this->plugin; ?>',
|
947 |
-
plugin_abbr: '<?php echo $this->plugin_abbr; ?>',
|
948 |
-
is_dev_mode: '<?php echo $this->is_dev_mode; ?>',
|
949 |
-
set_transient: '<?php echo $params['set_transient']; ?>',
|
950 |
meta_info: meta,
|
951 |
system_info: system_info
|
952 |
}
|
@@ -957,20 +962,20 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
957 |
|
958 |
Swal.mixin({
|
959 |
footer: '',
|
960 |
-
position: '<?php echo $params['position']; ?>',
|
961 |
-
width: <?php echo $params['width']; ?>,
|
962 |
animation: false,
|
963 |
focusConfirm: false,
|
964 |
allowEscapeKey: true,
|
965 |
-
showCloseButton: '<?php echo $params['showCloseButton']; ?>',
|
966 |
-
allowOutsideClick: '<?php echo $params['allowOutsideClick']; ?>',
|
967 |
showLoaderOnConfirm: true,
|
968 |
-
confirmButtonText: '<?php echo $params['confirmButtonText']; ?>',
|
969 |
-
backdrop: '<?php echo (int) $params['backdrop']; ?>'
|
970 |
}).queue([
|
971 |
{
|
972 |
title: '<p class="ig-feedback-title"><?php echo esc_js( $params['title'] ); ?></p>',
|
973 |
-
html: '<?php echo $html; ?>',
|
974 |
customClass: {
|
975 |
popup: 'animated fadeInUpBig'
|
976 |
},
|
@@ -979,7 +984,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
979 |
},
|
980 |
|
981 |
preConfirm: () => {
|
982 |
-
var $overlay = $('#ig-general-feedback-<?php echo $this->plugin; ?>');
|
983 |
var $form = $overlay.find('form');
|
984 |
var poll_options = $form.find("input[name='feedback_data[poll_options]']:checked").val();
|
985 |
var message = $form.find("#ig-feedback-data-poll-additional-message").val();
|
@@ -1006,10 +1011,10 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1006 |
|
1007 |
Swal.fire({
|
1008 |
type: 'success',
|
1009 |
-
width: <?php echo $params['width']; ?>,
|
1010 |
title: "Thank You!",
|
1011 |
showConfirmButton: false,
|
1012 |
-
position: '<?php echo $params['position']; ?>',
|
1013 |
timer: 1500,
|
1014 |
animation: false
|
1015 |
});
|
@@ -1020,7 +1025,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1020 |
|
1021 |
});
|
1022 |
|
1023 |
-
|
1024 |
|
1025 |
|
1026 |
<?php
|
@@ -1061,13 +1066,13 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1061 |
$event = $this->event_prefix . 'plugin.deactivation';
|
1062 |
|
1063 |
?>
|
1064 |
-
|
1065 |
jQuery(function ($) {
|
1066 |
-
var $deactivateLink = $('#the-list').find('[data-slug="<?php echo $this->plugin; ?>"] span.deactivate a'),
|
1067 |
-
$overlay = $('#ig-deactivate-survey-<?php echo $this->plugin; ?>'),
|
1068 |
$form = $overlay.find('form'),
|
1069 |
formOpen = false,
|
1070 |
-
consent = $('#ig-deactivate-survey-help-consent-<?php echo $this->plugin; ?>');
|
1071 |
|
1072 |
function togglePersonalInfoFields(show) {
|
1073 |
|
@@ -1143,7 +1148,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1143 |
event.preventDefault();
|
1144 |
loader(true);
|
1145 |
if (!$form.find('input[type=radio]:checked').val()) {
|
1146 |
-
$form.find('.ig-deactivate-survey-footer').prepend('<span class="error"><?php echo esc_js( __( 'Please select an option',
|
1147 |
return;
|
1148 |
}
|
1149 |
|
@@ -1167,22 +1172,22 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1167 |
};
|
1168 |
|
1169 |
var data = {
|
1170 |
-
action: '<?php echo $this->ajax_action; ?>',
|
1171 |
feedback: {
|
1172 |
type: 'radio',
|
1173 |
-
title: '<?php echo $title; ?>',
|
1174 |
-
slug: '<?php echo $slug; ?>',
|
1175 |
value: $form.find('.selected input[type=radio]').attr('data-option-slug'),
|
1176 |
details: $form.find('.selected input[type=text]').val()
|
1177 |
},
|
1178 |
|
1179 |
-
event: '<?php echo $event; ?>',
|
1180 |
|
1181 |
// Add additional information
|
1182 |
misc: {
|
1183 |
-
plugin: '<?php echo $this->plugin; ?>',
|
1184 |
-
plugin_abbr: '<?php echo $this->plugin_abbr; ?>',
|
1185 |
-
is_dev_mode: '<?php echo $this->is_dev_mode; ?>',
|
1186 |
set_cookie: '',
|
1187 |
meta_info: meta,
|
1188 |
system_info: system_info
|
@@ -1203,7 +1208,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1203 |
}
|
1204 |
});
|
1205 |
});
|
1206 |
-
|
1207 |
<?php
|
1208 |
}
|
1209 |
|
@@ -1218,108 +1223,108 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1218 |
return;
|
1219 |
}
|
1220 |
?>
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
<?php
|
1324 |
}
|
1325 |
|
@@ -1338,63 +1343,66 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1338 |
|
1339 |
$options = array(
|
1340 |
1 => array(
|
1341 |
-
'title' => esc_html__( 'I no longer need the plugin',
|
1342 |
'slug' => 'i-no-longer-need-the-plugin'
|
1343 |
),
|
1344 |
2 => array(
|
1345 |
-
'title' => esc_html__( 'I\'m switching to a different plugin',
|
1346 |
'slug' => 'i-am-switching-to-a-different-plugin',
|
1347 |
-
'details' => esc_html__( 'Please share which plugin',
|
1348 |
),
|
1349 |
3 => array(
|
1350 |
-
'title' => esc_html__( 'I couldn\'t get the plugin to work',
|
1351 |
'slug' => 'i-could-not-get-the-plugin-to-work'
|
1352 |
),
|
1353 |
4 => array(
|
1354 |
-
'title' => esc_html__( 'It\'s a temporary deactivation',
|
1355 |
'slug' => 'it-is-a-temporary-deactivation'
|
1356 |
),
|
1357 |
5 => array(
|
1358 |
-
'title' => esc_html__( 'Other',
|
1359 |
'slug' => 'other',
|
1360 |
-
'details' => esc_html__( 'Please share the reason',
|
1361 |
),
|
1362 |
);
|
1363 |
?>
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
|
|
1370 |
<?php foreach ( $options as $id => $option ) : ?>
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
<?php if ( ! empty( $option['details'] ) ) : ?>
|
1377 |
-
|
1378 |
<?php endif; ?>
|
1379 |
-
|
1380 |
<?php endforeach; ?>
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
|
|
|
|
1398 |
<?php
|
1399 |
}
|
1400 |
|
@@ -1639,9 +1647,9 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1639 |
*
|
1640 |
* Send feedback to server
|
1641 |
*/
|
1642 |
-
function submit_feedback() {
|
1643 |
|
1644 |
-
$data =
|
1645 |
|
1646 |
$data['site'] = esc_url( home_url() );
|
1647 |
|
@@ -1649,7 +1657,7 @@ if ( ! class_exists( 'IG_Feedback_V_1_2_3' ) ) {
|
|
1649 |
$plugin_abbr = ! empty( $data['misc']['plugin_abbr'] ) ? $data['misc']['plugin_abbr'] : 'ig_feedback';
|
1650 |
$is_dev_mode = ! empty( $data['misc']['is_dev_mode'] ) ? $data['misc']['is_dev_mo
|
13 |
*
|
14 |
* @class IG_Feedback_V_1_2_3
|
15 |
* @since 1.0.0
|
|
|
|
|
16 |
* @author Icegram
|
17 |
* @package feedback
|
18 |
*/
|
68 |
|
69 |
/**
|
70 |
* Enable/Disable Dev Mode
|
71 |
+
*
|
72 |
* @var bool
|
73 |
*/
|
74 |
public $is_dev_mode = true;
|
81 |
public $event_prefix;
|
82 |
|
83 |
/**
|
84 |
+
* Feedback Footer text
|
85 |
*/
|
86 |
public $footer = '<span class="ig-powered-by">Made With 💜 by <a href="https://www.icegram.com/" target="_blank">Icegram</a></span>';
|
87 |
|
126 |
* @since 1.0.12
|
127 |
*/
|
128 |
public function show_review_notice() {
|
129 |
+
|
130 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
131 |
if ( ! defined( 'DOING_AJAX' ) && is_admin() ) {
|
132 |
|
133 |
$enable_review_notice = apply_filters( $this->plugin_abbr . '_enable_review_notice', true );
|
193 |
|
194 |
if ( $can_ask_user_for_review ) {
|
195 |
|
196 |
+
if ( isset( $_SERVER['HTTP_HOST'] ) && isset( $_SERVER['REQUEST_URI'] ) ) {
|
197 |
+
$current_page_url = '//' . sanitize_text_field( $_SERVER['HTTP_HOST'] ) . sanitize_text_field( $_SERVER['REQUEST_URI'] );
|
198 |
+
}
|
199 |
|
200 |
$got_feedback = false;
|
201 |
/************** Update Review Status ********************/
|
202 |
+
$nonce = ! empty( $_GET['ig_feedback_nonce'] ) ? sanitize_text_field( wp_unslash( $_GET['ig_feedback_nonce'] ) ) : '';
|
203 |
$nonce_verified = wp_verify_nonce( $nonce, 'review' );
|
204 |
|
205 |
$action = '';
|
206 |
if ( $nonce_verified ) {
|
207 |
+
$action = ! empty( $_GET['ig_feedback_action'] ) ? sanitize_text_field( wp_unslash( $_GET['ig_feedback_action'] ) ) : '';
|
208 |
|
209 |
if ( ! empty( $action ) && $this->is_valid_action( $action ) ) {
|
210 |
update_user_meta( $current_user_id, $action, 1 );
|
211 |
+
update_user_meta( $current_user_id, $action . '_time', time() );
|
212 |
|
213 |
// Got the review request?
|
214 |
// Redirect them to review page
|
215 |
if ( $action === $review_done_option ) {
|
216 |
|
217 |
+
$url = ! empty( $_GET['review_url'] ) ? sanitize_text_field( $_GET['review_url'] ) : '';
|
218 |
|
219 |
if ( ! empty( $url ) ) {
|
220 |
?>
|
221 |
|
222 |
+
<meta http-equiv="refresh" content="0; url=<?php echo esc_url( $url ); ?>"/>
|
223 |
|
224 |
<?php
|
225 |
}
|
234 |
|
235 |
$review_url = "https://wordpress.org/support/plugin/{$this->plugin}/reviews/";
|
236 |
$icon_url = plugin_dir_url( __FILE__ ) . 'assets/images/icon-64.png';
|
237 |
+
/* translators: %s: Plugin name */
|
238 |
+
$message = __( sprintf( '<span><p>We hope you\'re enjoying <b>%s</b> plugin! Could you please do us a BIG favor and give us a 5-star rating on WordPress to help us spread the word and boost our motivation?</p>', $this->name ), 'email-subscribers' );
|
239 |
|
240 |
$message_data = array(
|
241 |
'review_url' => $review_url,
|
258 |
|
259 |
?>
|
260 |
|
261 |
+
<style type="text/css">
|
262 |
|
263 |
+
.ig-feedback-notice-links li {
|
264 |
+
display: inline-block;
|
265 |
+
margin-right: 15px;
|
266 |
+
}
|
267 |
|
268 |
+
.ig-feedback-notice-links li a {
|
269 |
+
display: inline-block;
|
270 |
+
color: #10738b;
|
271 |
+
text-decoration: none;
|
272 |
+
padding-left: 26px;
|
273 |
+
position: relative;
|
274 |
+
}
|
275 |
|
276 |
+
.ig-feedback-notice {
|
277 |
+
display: flex;
|
278 |
+
align-items: center;
|
279 |
+
}
|
280 |
|
281 |
+
.ig-feedback-plugin-icon {
|
282 |
+
float: left;
|
283 |
+
margin-right: 0.5em;
|
284 |
+
}
|
285 |
|
286 |
+
</style>
|
287 |
|
288 |
<?php
|
289 |
|
290 |
echo '<div class="notice notice-success ig-feedback-notice">';
|
291 |
+
echo '<span class="ig-feedback-plugin-icon"> <img src="' . esc_url( $icon_url ) . '" alt="Logo"/></span>';
|
292 |
+
echo wp_kses( $message, $allowedtags );
|
293 |
echo "<ul class='ig-feedback-notice-links'>";
|
294 |
+
echo sprintf( '<li><a href="%s" class="button-primary" target="_blank" data-rated="' . esc_attr__( 'Thank You :) ',
|
295 |
+
'email-subscribers' ) . '"><span class="dashicons dashicons-external"></span> Ok, you deserve it</a></li> <li><a href="%s"><span class="dashicons dashicons-calendar-alt"></span> Maybe later</a></li><li><a href="%s"><span class="dashicons dashicons-smiley"></span> I already did!</a></li><li><a href="%s"><span class="dashicons dashicons-no"></span> Don\'t ask me again</a></li>',
|
296 |
esc_url( $review_url ), esc_url( $maybe_later_url ), esc_url( $already_did_url ), esc_url( $no_bug_url ) );
|
297 |
+
echo '</ul></span>';
|
298 |
echo '</div>';
|
299 |
}
|
300 |
}
|
355 |
$can_load = apply_filters( $this->plugin_abbr . '_can_load_sweetalert_js', false );
|
356 |
|
357 |
if ( $can_load ) {
|
358 |
+
wp_enqueue_script( 'sweetalert', plugin_dir_url( __FILE__ ) . 'assets/js/sweetalert2.min.js', array( 'jquery' ), $this->version );
|
359 |
}
|
360 |
}
|
361 |
|
426 |
|
427 |
$params = $this->prepare_widget_params( $params );
|
428 |
|
429 |
+
$title = $params['title'];
|
430 |
+
$slug = sanitize_title( $title );
|
431 |
+
$event = $this->event_prefix . $params['event'];
|
432 |
+
$html = ! empty( $params['html'] ) ? $params['html'] : '';
|
433 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
434 |
?>
|
435 |
|
436 |
+
<script>
|
437 |
|
438 |
function doSend(rating, details) {
|
439 |
|
440 |
var data = {
|
441 |
+
action: '<?php echo esc_js( $this->ajax_action ); ?>',
|
442 |
feedback: {
|
443 |
+
type: '<?php echo esc_js( $params['type'] ); ?>',
|
444 |
+
slug: '<?php echo esc_js( $slug ); ?>',
|
445 |
title: '<?php echo esc_js( $title ); ?>',
|
446 |
value: rating,
|
447 |
details: details
|
448 |
},
|
449 |
|
450 |
+
event: '<?php echo esc_js( $event ); ?>',
|
451 |
|
452 |
// Add additional information
|
453 |
misc: {
|
454 |
+
plugin: '<?php echo esc_js( $this->plugin ); ?>',
|
455 |
+
plugin_abbr: '<?php echo esc_js( $this->plugin_abbr ); ?>',
|
456 |
+
is_dev_mode: '<?php echo esc_js( $this->is_dev_mode ); ?>',
|
457 |
+
set_transient: '<?php echo esc_js( $params['set_transient'] ); ?>'
|
458 |
//system_info: enable_system_info
|
459 |
}
|
460 |
};
|
467 |
setTimeout(function () {
|
468 |
|
469 |
Swal.mixin({
|
470 |
+
footer: '<?php echo wp_kses( $this->footer, $allowedtags ); ?>',
|
471 |
+
position: '<?php echo esc_js( $params['position'] ); ?>',
|
472 |
+
width: <?php echo esc_js( $params['width'] ); ?>,
|
473 |
animation: false,
|
474 |
focusConfirm: false,
|
475 |
+
allowEscapeKey: '<?php echo esc_js( $params['allowEscapeKey'] ); ?>',
|
476 |
+
showCloseButton: '<?php echo esc_js( $params['showCloseButton'] ); ?>',
|
477 |
+
allowOutsideClick: '<?php echo esc_js( $params['allowOutsideClick'] ); ?>',
|
478 |
showLoaderOnConfirm: true,
|
479 |
+
confirmButtonText: '<?php echo wp_kses( $params['confirmButtonText'], $allowedtags ); ?>',
|
480 |
+
backdrop: '<?php echo esc_js( (int) $params['backdrop'] ); ?>'
|
481 |
}).queue([
|
482 |
{
|
483 |
title: '<p class="ig-feedback-title"><?php echo esc_js( $params['title'] ); ?></p>',
|
484 |
+
html: '<?php echo wp_kses( $html, $allowedtags ); ?>',
|
485 |
customClass: {
|
486 |
popup: 'animated fadeInUpBig'
|
487 |
},
|
527 |
|
528 |
Swal.fire({
|
529 |
type: 'success',
|
530 |
+
width: <?php echo esc_js( $params['width'] ); ?>,
|
531 |
title: "Thank You!",
|
532 |
showConfirmButton: false,
|
533 |
+
position: '<?php echo esc_js( $params['position'] ); ?>',
|
534 |
timer: 1500,
|
535 |
animation: false
|
536 |
});
|
541 |
}, delay * 1000);
|
542 |
}
|
543 |
|
544 |
+
var delay = <?php echo esc_js( $params['delay'] ); ?>;
|
545 |
showWidget(delay);
|
546 |
|
547 |
|
548 |
+
</script>
|
549 |
<?php
|
550 |
}
|
551 |
|
562 |
|
563 |
?>
|
564 |
|
565 |
+
<div class="rating">
|
566 |
+
<!--elements are in reversed order, to allow "previous sibling selectors" in CSS-->
|
567 |
+
<input class="ratings" type="radio" name="rating" value="5" id="5"><label for="5">☆</label>
|
568 |
+
<input class="ratings" type="radio" name="rating" value="4" id="4"><label for="4">☆</label>
|
569 |
+
<input class="ratings" type="radio" name="rating" value="3" id="3"><label for="3">☆</label>
|
570 |
+
<input class="ratings" type="radio" name="rating" value="2" id="2"><label for="2">☆</label>
|
571 |
+
<input class="ratings" type="radio" name="rating" value="1" id="1"><label for="1">☆</label>
|
572 |
+
</div>
|
573 |
|
574 |
<?php
|
575 |
|
593 |
|
594 |
?>
|
595 |
|
596 |
+
<div class="emoji">
|
597 |
+
<!--elements are in reversed order, to allow "previous sibling selectors" in CSS-->
|
598 |
+
<input class="emojis" type="radio" name="rating" value="love" id="5"/><label for="5" class="ig-emoji" data-reaction="Love">😍</label>
|
599 |
+
<input class="emojis" type="radio" name="rating" value="smile" id="4"/><label for="4" class="ig-emoji" data-reaction="Smile">😊</label>
|
600 |
+
<input class="emojis" type="radio" name="rating" value="neutral" id="3"/><label for="3" class="ig-emoji" data-reaction="Neutral">😐</label>
|
601 |
+
<input class="emojis" type="radio" name="rating" value="sad" id="1"/><label for="2" class="ig-emoji" data-reaction="Sad">😠</label>
|
602 |
+
<input class="emojis" type="radio" name="rating" value="angry" id="1"/><label for="1" class="ig-emoji" data-reaction="Angry">😡</label>
|
603 |
+
</div>
|
604 |
+
<div id="emoji-info"></div>
|
605 |
|
606 |
<?php
|
607 |
|
620 |
*/
|
621 |
public function render_general_feedback( $params = array() ) {
|
622 |
|
623 |
+
$params = $this->prepare_widget_params( $params );
|
624 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
625 |
ob_start();
|
626 |
|
627 |
?>
|
628 |
|
629 |
+
<div class="ig-general-feedback" id="ig-general-feedback-<?php echo esc_html( $this->plugin ); ?>">
|
630 |
+
<form class="ig-general-feedback" id="ig-general-feedback">
|
631 |
+
<p class="ig-feedback-data-name">
|
632 |
+
<label class="ig-label"><?php esc_html_e( 'Name', 'email-subscribers' ); ?></label><br/>
|
633 |
+
<input type="text" name="feedback_data[name]" id="ig-feedback-data-name" value="<?php echo esc_html( $params['name'] ); ?>"/>
|
634 |
+
</p>
|
635 |
+
<p class="ig-feedback-data-email">
|
636 |
+
<label class="ig-label"><?php esc_html_e( 'Email', 'email-subscribers' ); ?></label><br/>
|
637 |
+
<input type="email" name="feedback_data[email]" id="ig-feedback-data-email" value="<?php echo esc_html( $params['email'] ); ?>"/>
|
638 |
+
</p>
|
639 |
+
<p class="ig-feedback-data-message">
|
640 |
+
<label class="ig-label"><?php esc_html_e( 'Feedback', 'email-subscribers '); ?></label><br/>
|
641 |
+
<textarea name="feedback_data[details]" id="ig-feedback-data-message"></textarea>
|
642 |
+
</p>
|
643 |
+
<?php if ( isset( $params['consent'] ) && true === $params['consent'] ) { ?>
|
644 |
+
<p>
|
645 |
+
<input type="checkbox" name="feedback_data[collect_system_info]" checked="checked" id="ig-feedback-data-consent"/><?php echo esc_html( $params['consent_text'] ); ?>
|
646 |
+
</p>
|
647 |
<?php } ?>
|
648 |
+
</form>
|
649 |
+
</div>
|
650 |
|
651 |
<?php
|
652 |
|
662 |
ob_start();
|
663 |
?>
|
664 |
|
665 |
+
<script type="text/javascript">
|
666 |
|
667 |
jQuery(document).ready(function ($) {
|
668 |
|
669 |
function doSend(details, meta, system_info) {
|
670 |
|
671 |
var data = {
|
672 |
+
action: '<?php echo esc_js( $this->ajax_action ); ?>',
|
673 |
feedback: {
|
674 |
+
type: '<?php echo esc_js( $params['type'] ); ?>',
|
675 |
+
slug: '<?php echo esc_js( $slug ); ?>',
|
676 |
title: '<?php echo esc_js( $title ); ?>',
|
677 |
details: details
|
678 |
},
|
679 |
|
680 |
+
event: '<?php echo esc_js( $event ); ?>',
|
681 |
|
682 |
// Add additional information
|
683 |
misc: {
|
684 |
+
plugin: '<?php echo esc_js( $this->plugin ); ?>',
|
685 |
+
plugin_abbr: '<?php echo esc_js( $this->plugin_abbr ); ?>',
|
686 |
+
is_dev_mode: '<?php echo esc_js( $this->is_dev_mode ); ?>',
|
687 |
+
set_transient: '<?php echo esc_js( $params['set_transient'] ); ?>',
|
688 |
meta_info: meta,
|
689 |
system_info: system_info
|
690 |
}
|
702 |
}
|
703 |
}
|
704 |
|
705 |
+
var feedbackButtonClass = 'ig-feedback-button-<?php echo esc_js( $this->plugin ); ?>';
|
706 |
|
707 |
$('#wpwrap').append('<div class="ig-es-feedback-button ' + feedbackButtonClass + '">Feedback</div>');
|
708 |
|
709 |
$('.' + feedbackButtonClass).on('click', function () {
|
710 |
Swal.mixin({
|
711 |
+
footer: '<?php echo wp_kses( $this->footer, $allowedtags ); ?>',
|
712 |
+
position: '<?php echo esc_js( $params['position'] ); ?>',
|
713 |
+
width: <?php echo esc_js( $params['width'] ); ?>,
|
714 |
animation: false,
|
715 |
focusConfirm: false,
|
716 |
allowEscapeKey: true,
|
717 |
+
showCloseButton: '<?php echo esc_js( $params['showCloseButton'] ); ?>',
|
718 |
+
allowOutsideClick: '<?php echo esc_js( $params['allowOutsideClick'] ); ?>',
|
719 |
showLoaderOnConfirm: true,
|
720 |
+
confirmButtonText: '<?php echo wp_kses( $params['confirmButtonText'], $allowedtags ); ?>',
|
721 |
+
backdrop: '<?php echo esc_js( (int) $params['backdrop'] ); ?>'
|
722 |
}).queue([
|
723 |
{
|
724 |
title: '<p class="ig-feedback-title"><?php echo esc_js( $params['title'] ); ?></p>',
|
725 |
+
html: '<?php echo wp_kses( $html, $allowedtags ); ?>',
|
726 |
customClass: {
|
727 |
popup: 'animated fadeInUpBig'
|
728 |
},
|
731 |
|
732 |
},
|
733 |
preConfirm: () => {
|
734 |
+
var $overlay = $('#ig-general-feedback-<?php echo esc_js( $this->plugin ); ?>');
|
735 |
var $form = $overlay.find('form');
|
736 |
|
737 |
var email = $form.find('#ig-feedback-data-email').val();
|
769 |
|
770 |
Swal.fire({
|
771 |
type: 'success',
|
772 |
+
width: <?php echo esc_js( $params['width'] ); ?>,
|
773 |
title: "Thank You!",
|
774 |
showConfirmButton: false,
|
775 |
+
position: '<?php echo esc_js( $params['position'] ); ?>',
|
776 |
timer: 1500,
|
777 |
animation: false
|
778 |
});
|
784 |
});
|
785 |
});
|
786 |
|
787 |
+
</script>
|
788 |
|
789 |
|
790 |
<?php
|
800 |
|
801 |
$params = $this->prepare_widget_params( $params );
|
802 |
|
803 |
+
$title = $params['title'];
|
804 |
+
$widget_tyoe = !empty($params['widget_tyoe']) ? $params['widget_tyoe'] : 'question';
|
805 |
+
$slug = sanitize_title( $title );
|
806 |
+
$event = $this->event_prefix . $params['event'];
|
807 |
+
$html = ! empty( $params['html'] ) ? $params['html'] : '';
|
808 |
$confirm_button_link = ! empty( $params['confirmButtonLink'] ) ? $params['confirmButtonLink'] : '';
|
809 |
+
$cancel_button_link = ! empty( $params['cancelButtonLink'] ) ? $params['cancelButtonLink'] : '';
|
810 |
+
$show_cancel_button = ! empty( $params['showCancelButton'] ) ? 'true' : 'false';
|
811 |
+
$cancel_button_text = ! empty( $params['cancelButtonText'] ) ? $params['cancelButtonText'] : 'Cancel';
|
812 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
813 |
|
814 |
?>
|
815 |
|
816 |
+
<script>
|
817 |
|
818 |
Swal.mixin({
|
819 |
+
type: '<?php echo esc_js( $widget_tyoe ); ?>',
|
820 |
+
position: '<?php echo esc_js( $params['position'] ); ?>',
|
821 |
+
width: <?php echo esc_js( $params['width'] ); ?>,
|
822 |
animation: false,
|
823 |
focusConfirm: true,
|
824 |
allowEscapeKey: true,
|
825 |
+
showCancelButton: <?php echo esc_js( $show_cancel_button ); ?>,
|
826 |
confirmButtonColor: '#0e9f6e',
|
827 |
cancelButtonColor: '#5850ec',
|
828 |
+
cancelButtonText: '<?php echo wp_kses( $cancel_button_text, $allowedtags ); ?>',
|
829 |
+
showCloseButton: '<?php echo esc_js( $params['showCloseButton'] ); ?>',
|
830 |
+
allowOutsideClick: '<?php echo esc_js( $params['allowOutsideClick'] ); ?>',
|
831 |
showLoaderOnConfirm: true,
|
832 |
+
confirmButtonText: '<?php echo wp_kses( $params['confirmButtonText'], $allowedtags ); ?>',
|
833 |
+
backdrop: '<?php echo esc_js( (int) $params['backdrop'] ); ?>'
|
834 |
}).queue([
|
835 |
{
|
836 |
title: '<p class="ig-feedback-title"><?php echo esc_js( $params['title'] ); ?></p>',
|
837 |
+
html: '<?php echo wp_kses( $html , $allowedtags ); ?>',
|
838 |
customClass: {
|
839 |
popup: 'animated fadeInUpBig'
|
840 |
},
|
841 |
|
842 |
preConfirm: () => {
|
843 |
window.open(
|
844 |
+
'<?php echo wp_kses( $confirm_button_link, $allowedtags ); ?>',
|
845 |
'_blank' // <- This is what makes it open in a new window.
|
846 |
);
|
847 |
}
|
853 |
|
854 |
Swal.fire({
|
855 |
type: 'success',
|
856 |
+
width: <?php echo esc_js( $params['width'] ); ?>,
|
857 |
title: "Thank You!",
|
858 |
showConfirmButton: false,
|
859 |
+
position: '<?php echo esc_js( $params['position'] ); ?>',
|
860 |
timer: 1500,
|
861 |
animation: false
|
862 |
});
|
863 |
+
} else if( 'cancel' == response.dismiss ) {
|
864 |
window.open(
|
865 |
+
'<?php echo wp_kses( $cancel_button_link, $allowedtags ); ?>',
|
866 |
'_blank' // <- This is what makes it open in a new window.
|
867 |
);
|
868 |
+
}
|
869 |
});
|
870 |
|
871 |
+
</script>
|
872 |
|
873 |
<?php
|
874 |
}
|
891 |
|
892 |
$allow_multiple = ! empty( $params['allow_multiple'] ) ? $params['allow_multiple'] : false;
|
893 |
|
894 |
+
$title = $params['title'];
|
895 |
+
$slug = sanitize_title( $title );
|
896 |
+
$event = $this->event_prefix . $params['event'];
|
897 |
+
$desc = ! empty( $params['desc'] ) ? $params['desc'] : '';
|
898 |
+
$allowedtags = ig_es_allowed_html_tags_in_esc();
|
899 |
|
900 |
ob_start();
|
901 |
|
902 |
?>
|
903 |
|
904 |
+
<div class="ig-general-feedback" id="ig-general-feedback-<?php echo esc_attr( $this->plugin ); ?>">
|
905 |
+
<form class="ig-general-feedback" id="ig-general-feedback">
|
906 |
+
<p><?php echo wp_kses( $desc, $allowedtags ); ?></p>
|
907 |
|
908 |
+
<p class="ig-general-feedback mb-3">
|
909 |
<?php foreach ( $poll_options as $value => $option ) { ?>
|
910 |
+
<input type="radio" name="feedback_data[poll_options]" value="<?php echo esc_attr( $value ); ?>"><b style="color: <?php echo esc_attr( $option['color'] ); ?>"><?php echo wp_kses( $option['text'] , $allowedtags ); ?></b><br/>
|
911 |
<?php } ?>
|
912 |
+
</p>
|
913 |
+
<p class="ig-feedback-data-poll-message mb-3" id="ig-feedback-data-poll-message">
|
914 |
+
<textarea name="feedback_data[details]" id="ig-feedback-data-poll-additional-message" placeholder="Additional feedback"></textarea>
|
915 |
+
</p>
|
916 |
+
</form>
|
917 |
+
</div>
|
918 |
|
919 |
<?php
|
920 |
|
929 |
|
930 |
?>
|
931 |
|
932 |
+
<script type="text/javascript">
|
933 |
|
934 |
jQuery(document).ready(function ($) {
|
935 |
|
936 |
function doSend(data, meta, system_info) {
|
937 |
|
938 |
var data = {
|
939 |
+
action: '<?php echo esc_js( $this->ajax_action ); ?>',
|
940 |
feedback: {
|
941 |
+
type: '<?php echo esc_js( $params['type'] ); ?>',
|
942 |
+
slug: '<?php echo esc_js( $slug ); ?>',
|
943 |
title: '<?php echo esc_js( $title ); ?>',
|
944 |
data: data
|
945 |
},
|
946 |
|
947 |
+
event: '<?php echo esc_js( $event ); ?>',
|
948 |
|
949 |
// Add additional information
|
950 |
misc: {
|
951 |
+
plugin: '<?php echo esc_js( $this->plugin ); ?>',
|
952 |
+
plugin_abbr: '<?php echo esc_js( $this->plugin_abbr ); ?>',
|
953 |
+
is_dev_mode: '<?php echo esc_js( $this->is_dev_mode ); ?>',
|
954 |
+
set_transient: '<?php echo esc_js( $params['set_transient'] ); ?>',
|
955 |
meta_info: meta,
|
956 |
system_info: system_info
|
957 |
}
|
962 |
|
963 |
Swal.mixin({
|
964 |
footer: '',
|
965 |
+
position: '<?php echo esc_js( $params['position'] ); ?>',
|
966 |
+
width: <?php echo esc_js( $params['width'] ); ?>,
|
967 |
animation: false,
|
968 |
focusConfirm: false,
|
969 |
allowEscapeKey: true,
|
970 |
+
showCloseButton: '<?php echo esc_js( $params['showCloseButton'] ); ?>',
|
971 |
+
allowOutsideClick: '<?php echo esc_js( $params['allowOutsideClick'] ); ?>',
|
972 |
showLoaderOnConfirm: true,
|
973 |
+
confirmButtonText: '<?php echo wp_kses( $params['confirmButtonText'], $allowedtags ); ?>',
|
974 |
+
backdrop: '<?php echo esc_js( (int) $params['backdrop'] ); ?>'
|
975 |
}).queue([
|
976 |
{
|
977 |
title: '<p class="ig-feedback-title"><?php echo esc_js( $params['title'] ); ?></p>',
|
978 |
+
html: '<?php echo wp_kses( $html, $allowedtags ); ?>',
|
979 |
customClass: {
|
980 |
popup: 'animated fadeInUpBig'
|
981 |
},
|
984 |
},
|
985 |
|
986 |
preConfirm: () => {
|
987 |
+
var $overlay = $('#ig-general-feedback-<?php echo esc_js( $this->plugin ); ?>');
|
988 |
var $form = $overlay.find('form');
|
989 |
var poll_options = $form.find("input[name='feedback_data[poll_options]']:checked").val();
|
990 |
var message = $form.find("#ig-feedback-data-poll-additional-message").val();
|
1011 |
|
1012 |
Swal.fire({
|
1013 |
type: 'success',
|
1014 |
+
width: <?php echo esc_js( $params['width'] ); ?>,
|
1015 |
title: "Thank You!",
|
1016 |
showConfirmButton: false,
|
1017 |
+
position: '<?php echo esc_js( $params['position'] ); ?>',
|
1018 |
timer: 1500,
|
1019 |
animation: false
|
1020 |
});
|
1025 |
|
1026 |
});
|
1027 |
|
1028 |
+
</script>
|
1029 |
|
1030 |
|
1031 |
<?php
|
1066 |
$event = $this->event_prefix . 'plugin.deactivation';
|
1067 |
|
1068 |
?>
|
1069 |
+
<script type="text/javascript">
|
1070 |
jQuery(function ($) {
|
1071 |
+
var $deactivateLink = $('#the-list').find('[data-slug="<?php echo esc_js( $this->plugin ); ?>"] span.deactivate a'),
|
1072 |
+
$overlay = $('#ig-deactivate-survey-<?php echo esc_js( $this->plugin ); ?>'),
|
1073 |
$form = $overlay.find('form'),
|
1074 |
formOpen = false,
|
1075 |
+
consent = $('#ig-deactivate-survey-help-consent-<?php echo esc_js( $this->plugin ); ?>');
|
1076 |
|
1077 |
function togglePersonalInfoFields(show) {
|
1078 |
|
1148 |
event.preventDefault();
|
1149 |
loader(true);
|
1150 |
if (!$form.find('input[type=radio]:checked').val()) {
|
1151 |
+
$form.find('.ig-deactivate-survey-footer').prepend('<span class="error"><?php echo esc_js( __( 'Please select an option', 'email-subscribers' ) ); ?></span>');
|
1152 |
return;
|
1153 |
}
|
1154 |
|
1172 |
};
|
1173 |
|
1174 |
var data = {
|
1175 |
+
action: '<?php echo esc_js( $this->ajax_action ); ?>',
|
1176 |
feedback: {
|
1177 |
type: 'radio',
|
1178 |
+
title: '<?php echo esc_js( $title ); ?>',
|
1179 |
+
slug: '<?php echo esc_js( $slug ); ?>',
|
1180 |
value: $form.find('.selected input[type=radio]').attr('data-option-slug'),
|
1181 |
details: $form.find('.selected input[type=text]').val()
|
1182 |
},
|
1183 |
|
1184 |
+
event: '<?php echo esc_js( $event ); ?>',
|
1185 |
|
1186 |
// Add additional information
|
1187 |
misc: {
|
1188 |
+
plugin: '<?php echo esc_js( $this->plugin ); ?>',
|
1189 |
+
plugin_abbr: '<?php echo esc_js( $this->plugin_abbr ); ?>',
|
1190 |
+
is_dev_mode: '<?php echo esc_js( $this->is_dev_mode ); ?>',
|
1191 |
set_cookie: '',
|
1192 |
meta_info: meta,
|
1193 |
system_info: system_info
|
1208 |
}
|
1209 |
});
|
1210 |
});
|
1211 |
+
</script>
|
1212 |
<?php
|
1213 |
}
|
1214 |
|
1223 |
return;
|
1224 |
}
|
1225 |
?>
|
1226 |
+
<style type="text/css">
|
1227 |
+
.ig-deactivate-survey-modal {
|
1228 |
+
display: none;
|
1229 |
+
table-layout: fixed;
|
1230 |
+
position: fixed;
|
1231 |
+
z-index: 9999;
|
1232 |
+
width: 100%;
|
1233 |
+
height: 100%;
|
1234 |
+
text-align: center;
|
1235 |
+
font-size: 14px;
|
1236 |
+
top: 0;
|
1237 |
+
left: 0;
|
1238 |
+
background: rgba(0, 0, 0, 0.8);
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
.ig-deactivate-survey-wrap {
|
1242 |
+
display: table-cell;
|
1243 |
+
vertical-align: middle;
|
1244 |
+
}
|
1245 |
+
|
1246 |
+
.ig-deactivate-survey {
|
1247 |
+
background-color: #fff;
|
1248 |
+
max-width: 550px;
|
1249 |
+
margin: 0 auto;
|
1250 |
+
padding: 30px;
|
1251 |
+
text-align: left;
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
.ig-deactivate-survey .error {
|
1255 |
+
display: block;
|
1256 |
+
color: red;
|
1257 |
+
margin: 0 0 10px 0;
|
1258 |
+
}
|
1259 |
+
|
1260 |
+
.ig-deactivate-survey-title {
|
1261 |
+
display: block;
|
1262 |
+
font-size: 18px;
|
1263 |
+
font-weight: 700;
|
1264 |
+
text-transform: uppercase;
|
1265 |
+
border-bottom: 1px solid #ddd;
|
1266 |
+
padding: 0 0 18px 0;
|
1267 |
+
margin: 0 0 18px 0;
|
1268 |
+
}
|
1269 |
+
|
1270 |
+
.ig-deactivate-survey-options {
|
1271 |
+
border-bottom: 1px solid #ddd;
|
1272 |
+
padding: 0 0 18px 0;
|
1273 |
+
margin: 0 0 18px 0;
|
1274 |
+
}
|
1275 |
+
|
1276 |
+
.ig-deactivate-survey-info-data {
|
1277 |
+
padding: 0 0 18px 0;
|
1278 |
+
margin: 10px 10px 10px 30px;
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
.ig-deactivate-survey-info-name, .ig-deactivate-survey-info-email-address {
|
1282 |
+
width: 230px;
|
1283 |
+
margin: 10px;
|
1284 |
+
}
|
1285 |
+
|
1286 |
+
.ig-deactivate-survey-title span {
|
1287 |
+
color: #999;
|
1288 |
+
margin-right: 10px;
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
.ig-deactivate-survey-desc {
|
1292 |
+
display: block;
|
1293 |
+
font-weight: 600;
|
1294 |
+
margin: 0 0 18px 0;
|
1295 |
+
}
|
1296 |
+
|
1297 |
+
.ig-deactivate-survey-option {
|
1298 |
+
margin: 0 0 10px 0;
|
1299 |
+
}
|
1300 |
+
|
1301 |
+
.ig-deactivate-survey-option-input {
|
1302 |
+
margin-right: 10px !important;
|
1303 |
+
}
|
1304 |
+
|
1305 |
+
.ig-deactivate-survey-option-details {
|
1306 |
+
display: none;
|
1307 |
+
width: 90%;
|
1308 |
+
margin: 10px 0 0 30px;
|
1309 |
+
}
|
1310 |
+
|
1311 |
+
.ig-deactivate-survey-footer {
|
1312 |
+
margin-top: 18px;
|
1313 |
+
}
|
1314 |
+
|
1315 |
+
.ig-deactivate-survey-deactivate {
|
1316 |
+
float: right;
|
1317 |
+
font-size: 13px;
|
1318 |
+
color: #ccc;
|
1319 |
+
text-decoration: none;
|
1320 |
+
padding-top: 7px;
|
1321 |
+
}
|
1322 |
+
|
1323 |
+
.ig-deactivate-survey-loader {
|
1324 |
+
vertical-align: middle;
|
1325 |
+
padding: 10px;
|
1326 |
+
}
|
1327 |
+
</style>
|
1328 |
<?php
|
1329 |
}
|
1330 |
|
1343 |
|
1344 |
$options = array(
|
1345 |
1 => array(
|
1346 |
+
'title' => esc_html__( 'I no longer need the plugin', 'email-subscribers' ),
|
1347 |
'slug' => 'i-no-longer-need-the-plugin'
|
1348 |
),
|
1349 |
2 => array(
|
1350 |
+
'title' => esc_html__( 'I\'m switching to a different plugin', 'email-subscribers' ),
|
1351 |
'slug' => 'i-am-switching-to-a-different-plugin',
|
1352 |
+
'details' => esc_html__( 'Please share which plugin', 'email-subscribers' ),
|
1353 |
),
|
1354 |
3 => array(
|
1355 |
+
'title' => esc_html__( 'I couldn\'t get the plugin to work', 'email-subscribers' ),
|
1356 |
'slug' => 'i-could-not-get-the-plugin-to-work'
|
1357 |
),
|
1358 |
4 => array(
|
1359 |
+
'title' => esc_html__( 'It\'s a temporary deactivation', 'email-subscribers' ),
|
1360 |
'slug' => 'it-is-a-temporary-deactivation'
|
1361 |
),
|
1362 |
5 => array(
|
1363 |
+
'title' => esc_html__( 'Other', 'email-subscribers' ),
|
1364 |
'slug' => 'other',
|
1365 |
+
'details' => esc_html__( 'Please share the reason', 'email-subscribers' ),
|
1366 |
),
|
1367 |
);
|
1368 |
?>
|
1369 |
+
<div class="ig-deactivate-survey-modal" id="ig-deactivate-survey-<?php echo esc_attr( $this->plugin ); ?>">
|
1370 |
+
<div class="ig-deactivate-survey-wrap">
|
1371 |
+
<form class="ig-deactivate-survey" method="post">
|
1372 |
+
<span class="ig-deactivate-survey-title"><span class="dashicons dashicons-testimonial"></span><?php echo ' ' . esc_html__( 'Quick Feedback', 'email-subscribers' ); ?></span>
|
1373 |
+
<?php /* translators: %s: Plugin name */ ?>
|
1374 |
+
<span class="ig-deactivate-survey-desc"><?php echo sprintf( esc_html__( 'If you have a moment, please share why you are deactivating %s:', 'email-subscribers' ), esc_html( $this->name ) ); ?></span>
|
1375 |
+
<div class="ig-deactivate-survey-options">
|
1376 |
<?php foreach ( $options as $id => $option ) : ?>
|
1377 |
+
<div class="ig-deactivate-survey-option">
|
1378 |
+
<label for="ig-deactivate-survey-option-<?php echo esc_attr( $this->plugin ); ?>-<?php echo esc_attr( $id ); ?>" class="ig-deactivate-survey-option-label">
|
1379 |
+
<input id="ig-deactivate-survey-option-<?php echo esc_attr( $this->plugin ); ?>-<?php echo esc_attr( $id ); ?>" class="ig-deactivate-survey-option-input" type="radio" name="code" value="<?php echo esc_attr( $id ); ?>" data-option-slug="<?php echo esc_attr( $option['slug'] ); ?>"/>
|
1380 |
+
<span class="ig-deactivate-survey-option-reason"><?php echo esc_html( $option['title'] ); ?></span>
|
1381 |
+
</label>
|
1382 |
<?php if ( ! empty( $option['details'] ) ) : ?>
|
1383 |
+
<input class="ig-deactivate-survey-option-details" type="text" placeholder="<?php echo esc_attr( $option['details'] ); ?>"/>
|
1384 |
<?php endif; ?>
|
1385 |
+
</div>
|
1386 |
<?php endforeach; ?>
|
1387 |
+
</div>
|
1388 |
+
<div class="ig-deactivate-survey-help-consent">
|
1389 |
+
<input id="ig-deactivate-survey-help-consent-<?php echo esc_attr( $this->plugin ); ?>" class="ig-deactivate-survey-option-input" type="checkbox" name="code" data-option-slug="<?php echo esc_attr( $option['slug'] ); ?>"/><b><?php esc_html_e('Yes, I give my consent to track plugin usage and contact me back to make this plugin works!', 'email-subscribers'); ?></b>
|
1390 |
+
</div>
|
1391 |
+
<div class="ig-deactivate-survey-info-data">
|
1392 |
+
|
1393 |
+
<input type="text" class="ig-deactivate-survey-info-name" id="ig-deactivate-survey-info-name" placeholder="Enter Name" name="ig-deactivate-survey-info-name" value=""/>
|
1394 |
+
<input type="text" class="ig-deactivate-survey-info-email-address" id="ig-deactivate-survey-info-email-address" name="ig-deactivate-survey-info-email-address" value="<?php echo esc_html( $email ); ?>"/>
|
1395 |
+
</div>
|
1396 |
+
<div class="ig-deactivate-survey-footer">
|
1397 |
+
<?php /* translators: %s: & sign */ ?>
|
1398 |
+
<button type="submit" class="ig-deactivate-survey-submit button button-primary button-large"><?php echo sprintf( esc_html__( 'Submit %s Deactivate', 'email-subscribers'), '&' ); ?></button>
|
1399 |
+
<img class="ig-deactivate-survey-loader" id="ig-deactivate-survey-loader" src="<?php echo esc_url( plugin_dir_url( __FILE__ ) ); ?>/assets/images/loading.gif"/>
|
1400 |
+
<?php /* translators: %s: & sign */ ?>
|
1401 |
+
<a href="#" class="ig-deactivate-survey-deactivate"><?php echo sprintf( esc_html__( 'Skip %s Deactivate', 'email-subscribers' ), '&' ); ?></a>
|
1402 |
+
</div>
|
1403 |
+
</form>
|
1404 |
+
</div>
|
1405 |
+
</div>
|
1406 |
<?php
|
1407 |
}
|
1408 |
|
1647 |
*
|
1648 |
* Send feedback to server
|
1649 |
*/
|
1650 |
+
public function submit_feedback() {
|
1651 |
|
1652 |
+
$data = ig_es_get_post_data();
|
1653 |
|
1654 |
$data['site'] = esc_url( home_url() );
|
1655 |
|
1657 |
$plugin_abbr = ! empty( $data['misc']['plugin_abbr'] ) ? $data['misc']['plugin_abbr'] : 'ig_feedback';
|
1658 |
$is_dev_mode = ! empty( $data['misc']['is_dev_mode'] ) ? $data['misc']['is_dev_mo
|