/home/techb158/on-time-movers.com/wp-content/plugins/mystickyelements
Edit: /home/techb158/on-time-movers.com/wp-content/plugins/mystickyelements/mystickyelements-front.php (69300B)
'defer', 'in_footer'=> true ]);
wp_enqueue_script('autocomplete-email-js', plugins_url('dist/js/email-autocomplete.js', __FILE__), ['jquery'], MY_STICKY_ELEMENT_VERSION, ['strategy' => 'defer', 'in_footer'=> true ]);
if( apply_filters('mystickyelements_enable_intlTelInput_library', true ) ) {
wp_enqueue_style('intl-tel-input', plugins_url('/intl-tel-input-src/build/css/intlTelInput.css', __FILE__), array(), MY_STICKY_ELEMENT_VERSION);
wp_enqueue_script('intl-tel-input-js', plugins_url('/intl-tel-input-src/build/js/intlTelInput.js', __FILE__), array('jquery'), MY_STICKY_ELEMENT_VERSION, ['strategy' => 'defer', 'in_footer'=> true ]);
}
wp_enqueue_script('mystickyelements-fronted-js', plugins_url('dist/js/mystickyelements-fronted.js', __FILE__), array('jquery'), MY_STICKY_ELEMENT_VERSION, ['strategy' => 'defer', 'in_footer'=> true ] );
$locale_settings = array(
'ajaxurl' => admin_url('admin-ajax.php'),
'ajax_nonce' => wp_create_nonce('mystickyelements'),
'plugin_url' => MYSTICKYELEMENTS_URL
);
wp_localize_script('mystickyelements-fronted-js', 'mystickyelements', $locale_settings);
}
public function mystickyelement_element_footer()
{
global $wp;
$contact_form = get_option('mystickyelements-contact-form');
$social_channels = get_option('mystickyelements-social-channels');
$social_channels_tabs = get_option('mystickyelements-social-channels-tabs');
$general_settings = get_option('mystickyelements-general-settings');
$stickyelements_widgets = get_option('stickyelements_widgets');
if ( !isset( $stickyelements_widgets[0]['status'])) {
$widget_status = 1;
}
if ( isset( $stickyelements_widgets[0]['status']) ) {
$widget_status = $stickyelements_widgets[0]['status'];
}
if ( $widget_status == 0 ) {
return;
}
$social_channels_lists = mystickyelements_social_channels();
if (!isset($contact_form['enable']) && !isset($social_channels['enable'])) {
return;
}
$contact_field = get_option( 'mystickyelements-contact-field' );
if ( empty( $contact_field ) ) {
$contact_field = array( 'name', 'phone', 'email', 'message', 'dropdown' );
}
$contact_form_class = '';
if (isset($contact_form['desktop']) && $contact_form['desktop'] == 1) {
$contact_form_class .= ' element-desktop-on';
}
if (isset($contact_form['mobile']) && $contact_form['mobile'] == 1) {
$contact_form_class .= ' element-mobile-on';
}
$form_open_delay_sec = 0;
if (isset($general_settings['form_open_automatic']) && $general_settings['form_open_automatic'] == 1) {
$contact_form_class .= ' elements-open-form-active';
if( isset($general_settings['form_open_delay_sec']) && $general_settings['form_open_delay_sec'] != '' ) {
$form_open_delay_sec = $general_settings['form_open_delay_sec'];
}
}
$close_after = '';
if (isset($contact_form['close_form_automatic']) && $contact_form['close_form_automatic'] == 1 && isset($contact_form['close_after'])) {
$close_after = $contact_form['close_after'];
}
if ( !isset($general_settings['position_mobile']) ) {
$general_settings['position_mobile'] = 'left';
}
$minimize_class = '';
if (isset($general_settings['minimize_tab']) && $general_settings['minimize_tab'] == 1) {
if (isset($general_settings['minimize_desktop']) && $general_settings['minimize_desktop'] == 'desktop' && !wp_is_mobile()) {
$minimize_class = 'element-minimize';
} elseif (isset($general_settings['minimize_mobile']) && $general_settings['minimize_mobile'] == 'mobile' && wp_is_mobile()) {
$minimize_class = 'element-minimize';
}
} else {
$minimize_class = 'no-minimize';
}
/* Change Open Tabs click to hover on Mobile device */
if ( $general_settings['open_tabs_when'] == 'click' && wp_is_mobile() ) {
//$general_settings['open_tabs_when'] = 'hover';
}
$general_settings['widget-size'] = (isset($general_settings['widget-size']) && $general_settings['widget-size']!= '') ? $general_settings['widget-size'] : 'medium';
$general_settings['mobile-widget-size'] = (isset($general_settings['mobile-widget-size']) && $general_settings['mobile-widget-size']!= '') ? $general_settings['mobile-widget-size'] : 'medium';
$general_settings['entry-effect'] = (isset($general_settings['entry-effect']) && $general_settings['entry-effect']!= '') ? $general_settings['entry-effect'] : 'slide-in';
$general_settings['templates'] = (isset($general_settings['templates']) && $general_settings['templates']!= '') ? $general_settings['templates'] : 'default';
$form_open_automatic = (isset($general_settings['form_open_automatic']) && $general_settings['form_open_automatic'] ==1 )? $general_settings['form_open_automatic']: '';
$general_settings['open_tab_default'] = (isset($general_settings['open_tab_default']) && $general_settings['open_tab_default'] ==1 )? $general_settings['open_tab_default']: '';
if ( $general_settings['open_tab_default'] == 1) {
$general_settings['opentab-channel'] = (isset($general_settings['opentab-channel']) && $general_settings['opentab-channel']!= '') ? $general_settings['opentab-channel'] : '';
} else {
$general_settings['opentab-channel'] = '';
}
$mystickyelements_class[] = 'mystickyelements-fixed';
$mystickyelements_class[] = 'mystickyelements-wrap';
$mystickyelements_class[] = 'mystickyelements-position-' . $general_settings['position'];
$mystickyelements_class[] = 'mystickyelements-position-screen-' . $general_settings['position_on_screen'];
$mystickyelements_class[] = 'mystickyelements-position-mobile-' . $general_settings['position_mobile'];
$mystickyelements_class[] = 'mystickyelements-on-' . $general_settings['open_tabs_when'];
$mystickyelements_class[] = 'mystickyelements-size-' . $general_settings['widget-size'];
$mystickyelements_class[] = 'mystickyelements-mobile-size-' . $general_settings['mobile-widget-size'];
$mystickyelements_class[] = 'mystickyelements-entry-effect-' . $general_settings['entry-effect'];
$mystickyelements_class[] = 'mystickyelements-templates-' . $general_settings['templates'];
$border_width = 0;
$border_color = '';
if(isset($general_settings['separator_between_channels']) && intval($general_settings['separator_between_channels'])) {
$mystickyelements_class[] = 'mse-has-separator';
$border_color = isset($general_settings['separator_color']) ? $general_settings['separator_color'] : '#000000';
$border_width = isset($general_settings['separator_width']) ? $general_settings['separator_width'] : 1;
if(in_array($general_settings['templates'], ['default', 'arrow', 'sharp'])) {
if ($general_settings['position'] == 'bottom') {
$mystickyelements_class[] = 'mse-border-right';
} else {
$mystickyelements_class[] = 'mse-border-bottom';
}
}
if(in_array($general_settings['position_mobile'], ['top', 'bottom'])) {
$mystickyelements_class[] = 'mse-mobile-border-right';
} else {
$mystickyelements_class[] = 'mse-mobile-border-bottom';
}
}
$mystickyelements_classes = join( ' ', $mystickyelements_class );
$plugins_allowedtags = array(
'a' => array(
'href' => array(),
'title' => array(),
'target' => array(),
),
'abbr' => array( 'title' => array() ),
'acronym' => array( 'title' => array() ),
'code' => array(),
'pre' => array(),
'em' => array(),
'strong' => array(),
'ul' => array(),
'ol' => array(),
'li' => array(),
'p' => array(),
'br' => array(),
'svg' => array(),
);
if ( !get_option( 'get_mystickyelements_page_views' ) ) {
update_option( 'get_mystickyelements_page_views', 1);
}
?>
dir="rtl"
class="">
-
style="background: " >
";
elseif ( isset($general_settings['minimize_mobile']) && $general_settings['minimize_mobile'] == 'mobile' && wp_is_mobile() ) :
echo "";
elseif ( $general_settings['position'] == 'left' && !wp_is_mobile() ) :
echo esc_attr(($minimize_class == "" ) ? "←" : "→") ;
elseif ( $general_settings['position'] == 'right' && !wp_is_mobile() ) :
echo esc_attr(($minimize_class == "" ) ? "→" : "←");
elseif ( $general_settings['position'] == 'bottom' && !wp_is_mobile() ) :
echo esc_attr(($minimize_class == "" ) ? "↓" : "↑");
elseif ( $general_settings['position_mobile'] == 'left' && wp_is_mobile() ) :
echo esc_attr(($minimize_class == "" ) ? "←" : "→");
elseif ( $general_settings['position_mobile'] == 'right' && wp_is_mobile() ) :
echo esc_attr(($minimize_class == "" ) ? "→" : "←");
elseif ( $general_settings['position_mobile'] == 'bottom' && wp_is_mobile() ) :
echo esc_attr(($minimize_class == "" ) ? "↓" : "↑");
elseif ( $general_settings['position_mobile'] == 'top' && wp_is_mobile() ) :
echo esc_attr(($minimize_class == "" ) ? "↑" : "↓");
endif;
?>
- dir="rtl" data-tab-opt="" data-time-delay="" >
$value):
if ( $key == 'is_empty' ) {
continue;
}
$link_target = isset($value['open_new_tab']) ? 1 : 0;
if ( strpos($key, 'custom_channel') !== false || strpos($key, 'custom_shortcode') !== false ) {
$custom_channel_key_temp = '';
if( strpos($key, 'custom_channel') !== false){
$custom_channel_key_temp = $key;
$key = 'custom_channel';
}
if( strpos($key, 'custom_shortcode') !== false){
$custom_channel_key_temp = $key;
$key = 'custom_shortcode';
}
$social_channels_lists = mystickyelements_custom_social_channels();
$social_channels_list = $social_channels_lists[$key];
if ( isset($value['channel_type']) && $value['channel_type'] != '' && $value['channel_type'] != 'custom' ) {
$custom_social_channels_lists = mystickyelements_social_channels();
$social_channels_list['class'] = $custom_social_channels_lists[$value['channel_type']]['class'];
$social_channels_list['fontawesome_icon'] = $custom_social_channels_lists[$value['channel_type']]['class'];
}
if ( $custom_channel_key_temp != '') {
$key = $custom_channel_key_temp;
}
} else {
$social_channels_lists = mystickyelements_social_channels();
$social_channels_list = (isset( $social_channels_lists[$key] )) ? $social_channels_lists[$key] : '';
if( empty( $social_channels_list ) ) {
return;
}
}
//$social_channels_list = $social_channels_lists[$key];
$element_class = '';
if (isset($value['desktop']) && $value['desktop'] == 1) {
$element_class .= ' element-desktop-on';
}
if (isset($value['mobile']) && $value['mobile'] == 1) {
$element_class .= ' element-mobile-on';
}
//$hover_text = ($value['hover_text'] != '') ? $value['hover_text'] : $social_channels_list['hover_text'];
$hover_text = ($value['hover_text'] != '') ? $value['hover_text'] : '';
$social_link = '';
$channel_type = (isset($value['channel_type'])) ? $value['channel_type'] : '';
switch ($key) {
case 'whatsapp':
if ( is_front_page() || is_home()) {
$title = get_bloginfo( 'name' );
} else {
$title = get_the_title();
}
$value['pre_set_message'] = urlencode_deep($value['pre_set_message']);
$value['text'] = str_replace( ['http://','https://','+',' ','-'], [''], $value['text']);
$value['text'] = "+" . $value['text'];
if ( isset($value['use_whatsapp_web']) && $value['use_whatsapp_web'] == 1) {
$social_link = "https://wa.me/" . $value['text'];
} else {
$social_link = "https://web.whatsapp.com/send?phone=" . $value['text'];
}
if ( isset($value['pre_set_message']) && $value['pre_set_message'] != '' && isset($value['use_whatsapp_web']) && $value['use_whatsapp_web'] == 1 ) {
$social_link .= '?text=' . esc_attr($value['pre_set_message']);
} elseif ( isset($value['pre_set_message']) && $value['pre_set_message'] != '' ) {
$social_link .= '&text=' . esc_attr($value['pre_set_message']);
}
if ( wp_is_mobile()) {
$social_link = "https://wa.me/" . $value['text'];
if ( isset($value['pre_set_message']) && $value['pre_set_message'] != '' ) {
$social_link .= '?text=' . esc_attr($value['pre_set_message']);
}
$link_target = 0;
}
break;
case 'phone':
$value['text'] = str_replace( array('http://', 'https://') , array('','') , $value['text']);
if (strpos($value['text'], 'tel:') == false) {
$social_link = "tel:".esc_attr($value['text']);
} else {
$social_link = esc_attr($value['text']);
}
$link_target = 0;
break;
case 'email':
$title = wp_get_document_title();
if (strpos($value['text'], 'mailto:') == false) {
$social_link = "mailto:" . $value['text'];
} else {
$social_link = $value['text'];
}
if( isset($value['pre_set_message']) && $value['pre_set_message'] != '' ) {
$social_link .= '?subject=' . esc_attr($value['pre_set_message']);
}
$link_target = 0;
break;
case 'wechat':
$social_link = '';
break;
case 'facebook_messenger':
$value['text'] = str_replace( array('http://', 'https://') , array('','') , $value['text']);
$value_dash_count = substr_count ($value['text'], '-');
if( $value_dash_count > 0 ) {
$split_value = explode( '-', $value['text'] );
$value_final = $split_value[count($split_value)-1];
} else {
$value_final = $value['text'];
}
$social_link = 'https://m.me/' . esc_attr($value_final);
if ( wp_is_mobile()) {
$link_target = 0;
}
break;
case 'address':
$social_link = '';
$value['text'] = str_replace( array('http://', 'https://') , array('','') , $value['text']);
if ($value['text'] != '') {
$hover_text .= ': ' . esc_attr($value['text']);
}
break;
case 'business_hours':
$social_link = '';
$value['text'] = str_replace( array('http://', 'https://') , array('','') , $value['text']);
if ($value['text'] != '') {
$hover_text .= ': ' . esc_attr($value['text']);
}
break;
case 'telegram' :
if ( strpos( $value['text'], '//t.me') == '' ) {
$social_link = "https://t.me/" . str_replace( '@', '', $value['text'] );
} else {
$social_link = $value['text'];
}
break;
case 'vk' :
$social_link = 'https://vk.me/' . esc_attr($value['text']);
break;
case 'viber' :
$value['text'] = str_replace('+','', $value['text']);
$iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
if( $iPod || $iPhone ){
$value['text'] = '+'.$value['text'];
}else if($iPad){
$value['text'] = '+'.$value['text'];
}
$social_link = "viber://chat?number=" . esc_attr($value['text']);
if ( wp_is_mobile()) {
$link_target = 0;
}
break;
case 'snapchat' :
$social_link = "https://www.snapchat.com/add/" . esc_attr($value['text']);
break;
case 'skype' :
$social_link = "skype:" . esc_attr($value['text']) . "?chat";
$link_target = 0;
break;
case 'SMS' :
$title = wp_get_document_title();
$social_link = "sms:" . esc_attr( $value['text'] );
if( isset($value['pre_set_message']) && $value['pre_set_message'] != '' ) {
$social_link .= "?&body=". $value['pre_set_message'];
}
$link_target = 0;
break;
case 'qq':
$social_link = '';
$value['text'] = str_replace( array('http://', 'https://') , array('','') , $value['text']);
if ($value['text'] != '') {
$hover_text .= ': ' . esc_attr($value['text']);
}
break;
case 'tiktok':
$pos = strpos( $value['text'] , '@' );
if($pos === false){
$value['text'] = '@'.$value['text'] ;
}
$social_link = 'https://www.tiktok.com/'.$value['text'];
break;
case 'instagram_dm':
$value['text'] = str_replace(["https://www.instagram.com/", "https://ig.me/m/", "https://instagram.com/", "@"], ["","","", ""], $value['text']);
$social_link = "https://ig.me/m/".esc_attr($value['text']);
$social_link = esc_url($social_link);
break;
default:
if ( $channel_type == 'whatsapp') {
$value['text'] = str_replace( ['http://','https://','+',' ','-'], [''], $value['text']);
$value['text'] = "+" . $value['text'];
if ( isset($value['use_whatsapp_web']) && $value['use_whatsapp_web'] == 1) {
$social_link = "https://wa.me/" . $value['text'];
} else {
$social_link = "https://web.whatsapp.com/send?phone=" . $value['text'];
}
if ( isset($value['pre_set_message']) && $value['pre_set_message'] != '' && isset($value['use_whatsapp_web']) && $value['use_whatsapp_web'] == 1 ) {
$social_link .= '?text=' . esc_attr($value['pre_set_message']);
} elseif ( isset($value['pre_set_message']) && $value['pre_set_message'] != '' ) {
$social_link .= '&text=' . esc_attr($value['pre_set_message']);
}
if ( wp_is_mobile()) {
$social_link = "https://wa.me/" . $value['text'];
if ( isset($value['pre_set_message']) && $value['pre_set_message'] != '' ) {
$social_link .= '?text=' . esc_attr($value['pre_set_message']);
}
$link_target = 0;
}
} else {
$social_link = $value['text'];
}
break;
}
if ( isset($social_channels_list['custom_html']) && $social_channels_list['custom_html'] == 1) {
$social_link = '';
$element_class .= ' mystickyelements-custom-html-main';
}
if(preg_match('/^
0, "error" => 0, "errors" => array(), "message" => $message));
die;
}
$contact_form = get_option('mystickyelements-contact-form');
if (isset($contact_form['name']) && $contact_form['name'] == 1) {
if (isset($contact_form['name_require']) && $contact_form['name_require'] == 1 && (!isset($_POST['contact-form-name']) || empty($_POST['contact-form-name']))) {
$error = array(
'key' => "contact-form-name",
'message' => "This field is required"
);
$errors[] = $error;
}
}
if (isset($contact_form['email']) && $contact_form['email'] == 1) {
if (isset($contact_form['email_require']) && $contact_form['email_require'] == 1 && (!isset($_POST['contact-form-email']) || empty($_POST['contact-form-email']))) {
$error = array(
'key' => "contact-form-email",
'message' => "This field is required"
);
$errors[] = $error;
} else if ( isset($contact_form['email_require']) && $contact_form['email_require'] == 1 && isset($_POST['contact-form-email']) && !filter_var($_POST['contact-form-email'], FILTER_VALIDATE_EMAIL)) {
$error = array(
'key' => "contact-form-email",
'message' => "Email address is not valid"
);
$errors[] = $error;
}
}
if (isset($contact_form['message']) && $contact_form['message'] == 1) {
if (isset($contact_form['message_require']) && $contact_form['message_require'] == 1 && (!isset($_POST['contact-form-message']) || empty($_POST['contact-form-message']))) {
$error = array(
'key' => "contact-form-message",
'message' => "This field is required"
);
$errors[] = $error;
}
}
if (isset($contact_form['phone']) && $contact_form['phone'] == 1) {
if (isset($contact_form['phone_require']) && $contact_form['phone_require'] == 1 && (!isset($_POST['contact-form-phone']) || empty($_POST['contact-form-phone']))) {
$error = array(
'key' => "contact-form-phone",
'message' => "This field is required"
);
$errors[] = $error;
}
}
if (isset($contact_form['dropdown']) && $contact_form['dropdown'] == 1) {
if (isset($contact_form['dropdown_require']) && $contact_form['dropdown_require'] == 1 && (!isset($_POST['contact-form-dropdown']) || empty($_POST['contact-form-dropdown']))) {
$error = array(
'key' => "contact-form-dropdown",
'message' => "This field is required"
);
$errors[] = $error;
}
}
$message = "There is error. We are not able to complete your request";
if (empty($errors)) {
if (!isset($_POST['nonce']) || empty($_POST['nonce'])) {
$error = array(
'key' => "mse-form-error",
'message' => "There is error. We are not able to complete your request"
);
$errors[] = $error;
} else if (!isset($_POST['form_id']) || empty($_POST['form_id'])) {
$error = array(
'key' => "mse-form-error",
'message' => "There is error. We are not able to complete your request"
);
$errors[] = $error;
} else if (!wp_verify_nonce($_POST['form_id'], $_POST['nonce'])) {
$error = array(
'key' => "mse-form-error",
'message' => "There is error. We are not able to complete your request"
);
$errors[] = $error;
}
if (!empty($errors)) {
echo json_encode(array("status" => 0, "error" => 1, "errors" => $errors, "message" => $message));
die;
}
} else {
echo json_encode(array("status" => 0, "error" => 1, "errors" => $errors, "message" => $message));
die;
}
/* Check redirct Link set */
$redirect_link = '';
if ( ( isset($contact_form['redirect']) && $contact_form['redirect'] == 1 ) && ( isset($contact_form['redirect_link']) && $contact_form['redirect_link'] != '' ) ) {
$redirect_link = $contact_form['redirect_link'];
}
if (isset($_POST['contact-form-email']) || isset($_POST['contact-form-name']) || isset($_POST['contact-form-phone']) || isset($_POST['contact-form-message']) ) {
$_POST['contact-form-phone'] = (isset($_POST['contact_code'])) ? "+".$_POST['contact_code']." ".$_POST['contact-form-phone'] : $_POST['contact-form-phone'];
if (isset($contact_form['send_leads']) && in_array('mail', $contact_form['send_leads'])) {
$send_mail = (isset($contact_form['sent_to_mail']) && $contact_form['sent_to_mail'] != '') ? $contact_form['sent_to_mail'] : get_option('admin_email');
$subject = "New lead from MyStickyElements - " . sanitize_text_field($_POST['contact-form-name']);
$message = "You got a new lead via your 'MyStickyElements' contact form:" . "\r\n\r\n";
if (isset($_POST['contact-form-name']) && $_POST['contact-form-name'] != '') {
$message .= "
Name: " . sanitize_text_field($_POST['contact-form-name']) . "
\r\n";
}
if (isset($_POST['contact-form-phone']) && $_POST['contact-form-phone'] != '') {
$message .= "
Phone: " . $_POST['contact-form-phone'] . "
\r\n";
}
if (isset($_POST['contact-form-email']) && $_POST['contact-form-email'] != '') {
$message .= "
Email: " . sanitize_email($_POST['contact-form-email']) . "
\r\n";
}
if (isset($_POST['contact-form-dropdown']) && $_POST['contact-form-dropdown'] != '') {
$message .= "
" . esc_attr($contact_form['dropdown-placeholder']) . ": " . sanitize_text_field($_POST['contact-form-dropdown']) . "
\r\n";
}
if (isset($_POST['contact-form-message']) && $_POST['contact-form-message'] != '') {
$message .= "
Message: " . sanitize_text_field(stripslashes($_POST['contact-form-message'])) . "
\r\n \r\n";
}
$message .= "
Thank You" . "
\r\n";
$message .= "
" . get_bloginfo('name') . "
\r\n";
$blog_name = get_bloginfo('name');
$blog_email = get_bloginfo('admin_email');
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$headers .= 'From: ' . $blog_name . ' <' . $blog_email . '>' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
if (wp_mail($send_mail, $subject, $message, $headers)) {
$message = esc_html__('Your request is submitted successfully', 'mystickyelements');
echo json_encode(array("status" => 1, "error" => 0, "errors" => array(), "message" => $message, "redirect_link" => $redirect_link));
die;
} else {
$message = esc_html__('Something went wrong. Please contact site administrator', 'mystickyelements');
echo json_encode(array("status" => 0, "error" => 0, "errors" => array(), "message" => $message));
}
} else {
$resultss = $wpdb->insert(
$wpdb->prefix . 'mystickyelement_contact_lists',
array(
'contact_name' => isset($_POST['contact-form-name']) ? esc_sql(sanitize_text_field($_POST['contact-form-name'])) : '',
'contact_phone' => isset($_POST['contact-form-phone']) ? $_POST['contact-form-phone'] : '',
'contact_email' => isset($_POST['contact-form-email']) ? esc_sql(sanitize_email($_POST['contact-form-email'])) : '',
'contact_message' => isset($_POST['contact-form-message']) ? sanitize_textarea_field(stripslashes($_POST['contact-form-message'])) : '',
'contact_option' => (isset($_POST['contact-form-dropdown'])) ? esc_sql(sanitize_textarea_field($_POST['contact-form-dropdown'])) : '',
'message_date' => date('Y-m-d H:i:s'),
'page_link' => esc_sql(sanitize_text_field($_POST['stickyelements-page-link'])),
)
);
$message = esc_html__('Your message was sent successfully', 'mystickyelements');
echo json_encode(array("status" => 1, "error" => 0, "errors" => array(), "message" => $message, "redirect_link" => $redirect_link));
die;
}
}
wp_die();
}
function get_user_ipaddress() {
if(!empty($_SERVER['HTTP_CLIENT_IP'])){
//ip from share internet
$ip = sanitize_text_field( wp_unslash($_SERVER['HTTP_CLIENT_IP']));
}elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
//ip pass from proxy
$ip = sanitize_text_field( wp_unslash($_SERVER['HTTP_X_FORWARDED_FOR']));
}else{
$ip = sanitize_text_field( wp_unslash($_SERVER['REMOTE_ADDR']));
}
return $ip;
}
}
}
global $front_settings_page;
$front_settings_page = new MyStickyElementsFrontPage_pro();