/home/techb158/on-time-movers.com/wp-content/plugins/mystickyelements
NameSizeModeActions
admin/-0755rm
dist/-0755rm
images/-0755rm
img/-0755rm
intl-tel-input-src/-0755rm
languages/-0755rm
class-email-signup.php64410644editdlrm
class-help.php52140644editdlrm
class-review-box.php307810644editdlrm
class-upgrade-box.php131330644editdlrm
mystickyelements-admin-integration.php70050644editdlrm
mystickyelements-admin-widgetanalytics.php63890644editdlrm
mystickyelements-admin.php1046350644editdlrm
mystickyelements-contact-leads.php15430644editdlrm
mystickyelements-deactivate-form.php91880644editdlrm
mystickyelements-fontawesome-icons.php228520644editdlrm
mystickyelements-fonts.php343710644editdlrm
mystickyelements-front.php693000644editdlrm
mystickyelements-popup.php22220644editdlrm
mystickyelements-widget.php32250644editdlrm
mystickyelements.php1579060644editdlrm
readme.txt275360644editdlrm
recommended-plugins.php263110644editdlrm
upgrade-to-pro.php545060644editdlrm
Edit: /home/techb158/on-time-movers.com/wp-content/plugins/mystickyelements/mystickyelements-admin.php (104635B)
Settings'; $links['need_help'] = ''.__( 'Need help?', 'mystickyelements' ).''; $links['go_pro'] = ''.__( 'Upgrade', 'mystickyelements' ).''; array_unshift($links, $settings_link); return $links; } /* * Load Plugin text domain. */ public function mystickyelements_load_plugin_textdomain() { load_plugin_textdomain('mystickyelements', FALSE, dirname(plugin_basename(__FILE__)).'/languages/'); } /* * enqueue admin side script and style. */ public function mystickyelements_admin_enqueue_script($page) { if($page == 'mystickyelements_page_my-sticky-elements-chatway-plugin') { wp_enqueue_script('thickbox', null, array('jquery')); wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0'); return; } if ( isset($_GET['page']) && ( $_GET['page'] == 'my-sticky-elements' || $_GET['page'] == 'my-sticky-elements-leads' || $_GET['page'] == 'my-sticky-elements-new-widget' || $_GET['page'] == 'recommended-plugins' || $_GET['page'] == 'my-sticky-elements-analytics' || $_GET['page'] == 'my-sticky-elements-integration' || $_GET['page'] == 'my-sticky-elements-upgrade' || $_GET['page'] == 'my-sticky-elements-chatway-plugin') ) { $is_shown = MSE_SIGNUP_CLASS::check_modal_status(); if($is_shown) { wp_enqueue_script( 'mailcheck-js', plugins_url('/dist/js/mailcheck.js', __FILE__), ['jquery'], MY_STICKY_ELEMENT_VERSION); wp_enqueue_script('autocomplete-email-js', plugins_url('/dist/js/email-autocomplete.js', __FILE__), ['jquery'], MY_STICKY_ELEMENT_VERSION, true); wp_enqueue_style('mystickyelements-help-css', plugins_url('/dist/css/mystickyelements-help.css', __FILE__), array(), MY_STICKY_ELEMENT_VERSION); wp_style_add_data('mystickyelements-help-css', 'rtl', 'replace'); } else { wp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css?family=Poppins:400,500,600,700'); wp_enqueue_style('font-awesome-css', plugins_url('/dist/css/font-awesome.css', __FILE__), array(), MY_STICKY_ELEMENT_VERSION); wp_enqueue_style('wp-color-picker'); wp_enqueue_style('mystickyelements-admin-css', plugins_url('/dist/css/mystickyelements-admin.css', __FILE__), array(), MY_STICKY_ELEMENT_VERSION); wp_enqueue_style('mse-app', plugins_url('/dist/css/app.css', __FILE__), array(), MY_STICKY_ELEMENT_VERSION); wp_enqueue_style('select2-css', plugins_url('/css/select2.css', __FILE__), array(), MY_STICKY_ELEMENT_VERSION); wp_enqueue_style('mystickyelements-front-css', plugins_url('/dist/css/mystickyelements-front.css', __FILE__), array(), MY_STICKY_ELEMENT_VERSION); wp_enqueue_style('mystickyelements-help-css', plugins_url('/dist/css/mystickyelements-help.css', __FILE__), array(), MY_STICKY_ELEMENT_VERSION); wp_enqueue_style( 'wp-jquery-ui-dialog' ); wp_enqueue_script( 'jquery-ui-dialog' ); wp_enqueue_script('wp-color-picker'); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('jquery-effects-shake'); wp_enqueue_media(); // include the javascript wp_enqueue_script('thickbox', null, array('jquery')); wp_enqueue_style('jquery-ui-css', plugins_url('/dist/css/datepicker.css', __FILE__), [], MY_STICKY_ELEMENT_VERSION); wp_enqueue_script('jquery-ui-datepicker'); // include the thickbox styles wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0'); wp_enqueue_style("mystickyelements-star-rating-svg", plugins_url('dist/css/star-rating-svg.css', __FILE__), [], MY_STICKY_ELEMENT_VERSION); wp_enqueue_script("mystickyelements-star-rating-svg", plugins_url('dist/js/star-rating-svg.js', __FILE__), ['jquery'], MY_STICKY_ELEMENT_VERSION); //wp_enqueue_script('plugin-install', admin_url('/js/plugin-install.min', __FILE__), array( 'jquery' ), MY_STICKY_ELEMENT_VERSION, true ) ; wp_enqueue_script('select2-js', plugins_url('dist/js/select2.js', __FILE__), array( 'jquery' ), MY_STICKY_ELEMENT_VERSION, true ) ; wp_enqueue_script('timepicker-js', plugins_url('dist/js/timepicker.js', __FILE__), ['jquery'], MY_STICKY_ELEMENT_VERSION, false); wp_enqueue_script('confetti-js', plugins_url('dist/js/confetti.js', __FILE__), array( 'jquery' ), MY_STICKY_ELEMENT_VERSION, true ) ; wp_enqueue_script( 'mailcheck-js', plugins_url('dist/js/mailcheck.js', __FILE__), ['jquery'], MY_STICKY_ELEMENT_VERSION); wp_enqueue_script('autocomplete-email-js', plugins_url('dist/js/email-autocomplete.js', __FILE__), ['jquery'], MY_STICKY_ELEMENT_VERSION, true); wp_enqueue_script('mystickyelements-js', plugins_url('dist/js/mystickyelements-admin.js', __FILE__), array('jquery'), MY_STICKY_ELEMENT_VERSION, true); wp_enqueue_script('mse-app', plugins_url('dist/js/app.js', __FILE__), array('jquery'), MY_STICKY_ELEMENT_VERSION, true); $locale_settings = array( 'ajaxurl' => admin_url('admin-ajax.php'), 'ajax_nonce' => wp_create_nonce('mystickyelements'), 'has_js_access' => current_user_can("unfiltered_html") ? true : false, 'js_message' => esc_html__("Please remove the JavaScript from the channels or ask the website's administrator to give you access to add JavaScript.", "mystickyelements"), 'remove' => esc_html__("Remove", "mystickyelements") ); wp_localize_script('mystickyelements-js', 'mystickyelements', $locale_settings); } } if ( isset($_GET['page']) && $_GET['page'] == 'my-sticky-elements-upgrade' ) { wp_enqueue_style('mystickyelements-pricing-table', plugins_url('dist/css/pricing-table.css', __FILE__), [], MY_STICKY_ELEMENT_VERSION); $queryArgs = [ 'family' => 'Poppins:wght@400;500;600;700&display=swap', 'subset' => 'latin,latin-ext', ]; wp_enqueue_style('google-poppins-fonts', add_query_arg($queryArgs, "//fonts.googleapis.com/css2"), [], null); wp_enqueue_script('mystickyelements-slick', plugins_url('dist/js/slick.js', __FILE__), ['jquery'], MY_STICKY_ELEMENT_VERSION); } } public function check_for_redirection(){ $page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : ''; if($page == 'my-sticky-elements-leads'){ $total_leads = $this->total_my_sticky_elements_widgets(); // Total number of my sticky elements contact form leads $contact_form_channel_active = $this->is_contact_form_channel_active(); // True if contact form is enabled, false otherwise if($total_leads == 0 && !$contact_form_channel_active){ wp_redirect(admin_url('admin.php?page=my-sticky-elements')); exit; } } } public function mystickyelement_inline_css_admin(){ global $submenu; $parent_slug = 'my-sticky-elements'; $elements_widgets = get_option( 'mystickyelements-widgets' ); $total_leads = $this->total_my_sticky_elements_widgets(); // Total number of my sticky elements contact form leads $contact_form_channel_active = $this->is_contact_form_channel_active(); // True if contact form is enabled, false otherwise if (isset($submenu[$parent_slug])) { foreach ($submenu[$parent_slug] as &$item) { if (isset($item[2]) && $item[2] === 'my-sticky-elements-leads') { $item[4] = 'mse-admin-menu-leads'; // add your class here } if (isset($item[2]) && $item[2] === 'my-sticky-elements-new-widget') { $item[4] = 'mse-admin-menu-upgrade'; // add your class here } if (isset($item[0]) && $item[0] === 'MSE upgrade') { $item[4] = 'mse-admin-menu-upgrade'; // add your class here } } } ?> prefix . 'mystickyelement_contact_lists'; $total_leads = 0; // Check if table exists using prepared statement for security $table_check = $wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $tableName)); if ($table_check === $tableName) { // Use prepared statement with identifier placeholder for table name $total_leads = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM %i", $tableName)); $total_leads = absint($total_leads); } return $total_leads; } /** * Is contact Form active * * @return bool True if contact form is enabled, false otherwise */ public function is_contact_form_channel_active() { $contact_form = get_option('mystickyelements-contact-form', false); // Check if contact form exists and is enabled if ($contact_form && isset($contact_form['enable']) && intval($contact_form['enable']) === 1) { return true; } return false; } /* * Add My Sticky Element Page in admin menu. */ public function add_mystickyelement_plugin_page() { $getData = filter_input_array(INPUT_GET); if (isset($getData['hide_mserecommended_plugin']) && isset($getData['nonce'])) { if (current_user_can('manage_options')) { $nonce = $getData['nonce']; if (wp_verify_nonce($nonce, "mse_recommended_plugin")) { update_option('hide_mserecommended_plugin', true); } } } $hide_mserecommended_plugin = get_option('hide_mserecommended_plugin'); $elements_widgets = get_option( 'mystickyelements-widgets' ); $total_leads = $this->total_my_sticky_elements_widgets(); // Total number of my sticky elements contact form leads $contact_form_channel_active = $this->is_contact_form_channel_active(); // True if contact form is enabled, false otherwise $new_widget_link = ( !empty($elements_widgets) ) ? 'my-sticky-elements-new-widget' : 'my-sticky-elements&widget=0'; $default_widget_name = 'Dashboard'; add_menu_page( 'Settings Admin', 'myStickyelements', 'manage_options', 'my-sticky-elements', array( $this, 'mystickyelements_admin_settings_page' ), 'dashicons-sticky' ); if(!empty($elements_widgets) && count($elements_widgets) > 0){ add_submenu_page( 'my-sticky-elements', 'Settings Admin', 'Dashboard', 'manage_options', 'my-sticky-elements', array( $this, 'mystickyelements_admin_settings_page' ) ); }else{ add_submenu_page( 'my-sticky-elements', 'Settings Admin', '+ Create New Widget', 'manage_options', $new_widget_link, array( $this, 'mystickyelements_admin_new_widget_page' ) ); } add_submenu_page( 'my-sticky-elements', 'Settings Admin', 'MSE upgrade', 'manage_options', $new_widget_link, array( $this, 'mystickyelements_admin_new_widget_page' ) ); if( class_exists( 'Chatway' ) ) { add_submenu_page( 'my-sticky-elements', 'Settings Admin', 'Chatway Live Chat', 'manage_options', 'manage-chatway-plugin', array( $this, 'mystickyelements_manage_chatway_plugin' ) ); } else { add_submenu_page( 'my-sticky-elements', 'Settings Admin', 'Chatway Live Chat', 'manage_options', 'my-sticky-elements-chatway-plugin', array( $this, 'mystickyelements_install_chatway_plugin' ) ); } if($contact_form_channel_active == true){ add_submenu_page( 'my-sticky-elements', 'Settings Admin', 'Integrations', 'manage_options', 'my-sticky-elements-integration', array( $this, 'mystickyelements_admin_integration_page' ) ); } add_submenu_page( 'my-sticky-elements', 'Settings Admin', 'Widget Analytics', 'manage_options', 'my-sticky-elements-analytics', [ $this, 'mystickyelements_admin_widget_analytics_page', ] ); add_submenu_page( 'my-sticky-elements', 'Settings Admin', 'Contact Form Leads', 'manage_options', 'my-sticky-elements-leads', array( $this, 'mystickyelements_admin_leads_page' ) ); if ( !$hide_mserecommended_plugin){ add_submenu_page( 'my-sticky-elements', 'Recommended Plugins', 'Recommended Plugins', 'manage_options', 'recommended-plugins', array( $this, 'mystickyelements_recommended_plugins' ) ); } add_submenu_page( 'my-sticky-elements', 'Upgrade to Pro ⭐️', 'Upgrade to Pro ⭐️', 'manage_options', 'my-sticky-elements-upgrade', array( $this, 'mystickyelements_admin_upgrade_to_pro' ) ); } public function mystickyelements_admin_widget_analytics_page(){ $is_shown = MSE_SIGNUP_CLASS::check_modal_status(); if($is_shown) { /* Signup Form When first time activate plugin */ include_once MYSTICKYELEMENTS_PATH . '/admin/email-signup.php'; } else { include('mystickyelements-admin-widgetanalytics.php'); } } public static function sanitize_options($value, $type = "") { if ( !is_array($value)) { $value = stripslashes($value); } if($type == "int") { $value = filter_var($value, FILTER_SANITIZE_NUMBER_INT); } else if($type == "email") { $value = sanitize_email($value); } else if($type == "url") { $value = esc_url_raw($value); } else if($type == "sql") { $value = esc_sql($value); } else { $value = sanitize_text_field($value); } return $value; } public function mystickyelements_admin_upgrade_to_pro() { $is_shown = MSE_SIGNUP_CLASS::check_modal_status(); if($is_shown) { /* Signup Form When first time activate plugin */ include_once MYSTICKYELEMENTS_PATH . '/admin/email-signup.php'; } else { include_once 'upgrade-to-pro.php'; } } /* * My Sticky Elements Settings Page * */ public function mystickyelements_admin_settings_page() { global $wpdb; $is_shown = MSE_SIGNUP_CLASS::check_modal_status(); if($is_shown != 1) { /* Signup Form When first time activate plugin */ require_once MYSTICKYELEMENTS_PATH . 'admin/stickyelements-review-popup.php'; } $widget_tab_index = 'mystickyelements-contact-form'; if ( isset($_POST['mystickyelement-submit']) && !wp_verify_nonce( $_POST['mystickyelement-submit'], 'mystickyelement-submit' ) ) { echo '

' . esc_html__('Unable to complete your request','mystickyelements'). '

'; } else if ( isset($_POST['general-settings']) && !empty($_POST['general-settings']) && wp_verify_nonce( $_POST['mystickyelement-submit'], 'mystickyelement-submit' )) { /* Save/Update Contact Form tab */ $widget_tab_index = isset($_POST['hide_tab_index']) ? $_POST['hide_tab_index'] : 'mystickyelements-contact-form'; $elements_widgets[] = $_POST['widget_name']; update_option( 'mystickyelements-widgets', $elements_widgets ); $contact_field = filter_var_array( $_POST['contact-field'] ); update_option('mystickyelements-contact-field', $contact_field); $post = array(); if(isset($_POST['contact-form'])) { $contact = $_POST['contact-form']; if(isset($contact['enable'])) { $post['enable'] = self::sanitize_options($contact['enable'], "int"); } if(isset($contact['name'])) { $post['name'] = self::sanitize_options($contact['name'], "int"); } if(isset($contact['name_require'])) { $post['name_require'] = self::sanitize_options($contact['name_require'], "int"); } if(isset($contact['name_value'])) { $post['name_value'] = self::sanitize_options($contact['name_value']); } if(isset($contact['phone'])) { $post['phone'] = self::sanitize_options($contact['phone'], "int"); } if(isset($contact['phone_require'])) { $post['phone_require'] = self::sanitize_options($contact['phone_require'], "int"); } if(isset($contact['phone_formate'])) { $post['phone_formate'] = self::sanitize_options($contact['phone_formate'], "int"); } if(isset($contact['phone_value'])) { $post['phone_value'] = self::sanitize_options($contact['phone_value']); } if(isset($contact['email'])) { $post['email'] = self::sanitize_options($contact['email'], "int"); } if(isset($contact['email_require'])) { $post['email_require'] = self::sanitize_options($contact['email_require'], "int"); } if(isset($contact['email_value'])) { $post['email_value'] = self::sanitize_options($contact['email_value']); } if(isset($contact['message'])) { $post['message'] = self::sanitize_options($contact['message'], "int"); } if(isset($contact['message_require'])) { $post['message_require'] = self::sanitize_options($contact['message_require'], "int"); } if(isset($contact['message_value'])) { $post['message_value'] = self::sanitize_options($contact['message_value']); } if(isset($contact['dropdown'])) { $post['dropdown'] = self::sanitize_options($contact['dropdown'], "int"); } if(isset($contact['dropdown_require'])) { $post['dropdown_require'] = self::sanitize_options($contact['dropdown_require'], "int"); } if(isset($contact['submit_button_background_color'])) { $post['submit_button_background_color'] = self::sanitize_options($contact['submit_button_background_color']); } if(isset($contact['submit_button_text_color'])) { $post['submit_button_text_color'] = self::sanitize_options($contact['submit_button_text_color']); } if(isset($contact['submit_button_text'])) { $post['submit_button_text'] = self::sanitize_options($contact['submit_button_text']); } if(isset($contact['tab_background_color'])) { $post['tab_background_color'] = self::sanitize_options($contact['tab_background_color']); } if(isset($contact['tab_text_color'])) { $post['tab_text_color'] = self::sanitize_options($contact['tab_text_color']); } if(isset($contact['form_bg_color'])) { $post['form_bg_color'] = self::sanitize_options($contact['form_bg_color']); } if(isset($contact['headine_text_color'])) { $post['headine_text_color'] = self::sanitize_options($contact['headine_text_color']); } if(isset($contact['text_in_tab'])) { $post['text_in_tab'] = self::sanitize_options($contact['text_in_tab']); } if(isset($contact['contact_title_text'])) { $post['contact_title_text'] = self::sanitize_options($contact['contact_title_text']); } if(isset($contact['send_leads'])) { $post['send_leads'] = array_map([self::class, 'sanitize_options'], $contact['send_leads']); } if(isset($contact['sent_to_mail'])) { $post['sent_to_mail'] = self::sanitize_options($contact['sent_to_mail']); } if(isset($contact['direction'])) { $post['direction'] = self::sanitize_options($contact['direction']); } if(isset($contact['direction'])) { $post['direction'] = self::sanitize_options($contact['direction']); } if(isset($contact['desktop'])) { $post['desktop'] = self::sanitize_options($contact['desktop'], "int"); } if(isset($contact['mobile'])) { $post['mobile'] = self::sanitize_options($contact['mobile'], "int"); } if(isset($contact['dropdown-placeholder'])) { $post['dropdown-placeholder'] = self::sanitize_options($contact['dropdown-placeholder']); } if(isset($contact['dropdown-option'])) { $post['dropdown-option'] = filter_var_array( $contact['dropdown-option'] ); } if(isset($contact['redirect'])) { $post['redirect'] = self::sanitize_options($contact['redirect'], "int"); } if(isset($contact['redirect_link'])) { $post['redirect_link'] = self::sanitize_options($contact['redirect_link']); } if (isset($contact['close_form_automatic'])) { $post['close_form_automatic'] = self::sanitize_options($contact['close_form_automatic'], "int"); } if (isset($contact['close_after'])) { $post['close_after'] = self::sanitize_options($contact['close_after'], "int"); } } update_option('mystickyelements-contact-form', $post); /* Save/Update Social Channels tabs */ $social_channels = array(); if(isset($_POST['social-channels'])) { if(!empty($_POST['social-channels'])) { $social_channels = $_POST['social-channels']; foreach($social_channels as $key=>$val) { $social_channels[$key] = self::sanitize_options($val, "int"); } } } update_option('mystickyelements-social-channels', $social_channels); $social_channels_tab = array(); if(isset($_POST['social-channels-tab'])) { if(!empty($_POST['social-channels-tab'])) { foreach($_POST['social-channels-tab'] as $key=>$option) { if(isset($option['text'])) { if (strpos($key, 'custom_channel') !== false ) { if( is_super_admin() ) { $option['text'] = self::sanitize_options($option['text']); } else { $option['text'] = esc_url($option['text']); } }elseif (strpos($key, 'custom_shortcode') !== false ) { $option['text'] = $option['text']; } else { $option['text'] = self::sanitize_options($option['text']); } } if(isset($option['desktop'])) { $option['desktop'] = self::sanitize_options($option['desktop'], "int"); } if(isset($option['mobile'])) { $option['mobile'] = self::sanitize_options($option['mobile'], "int"); } if(isset($option['bg_color'])) { $option['bg_color'] = self::sanitize_options($option['bg_color']); } if(isset($option['icon_text'])) { $option['icon_text'] = self::sanitize_options($option['icon_text']); } if(isset($option['hover_text'])) { $option['hover_text'] = self::sanitize_options($option['hover_text']); } if (isset($option['open_new_tab'])) { $option['open_new_tab'] = self::sanitize_options($option['open_new_tab']); } if (isset($option['pre_set_message'])) { $option['pre_set_message'] = self::sanitize_options($option['pre_set_message']); } $social_channels_tab[$key] = $option; } } } update_option( 'mystickyelements-social-channels-tabs', $social_channels_tab); /* Save/Update General Settings */ $general_setting = array(); if(isset($_POST['general-settings'])) { if(!empty($_POST['general-settings'])) { foreach($_POST['general-settings'] as $key=>$value) { $general_setting[$key] = self::sanitize_options($value); } } } update_option('mystickyelements-general-settings', $general_setting); /* Send Email Afte set email */ if ( isset($_POST['contact-form']['send_leads']) && $_POST['contact-form']['send_leads'] == 'mail' && $_POST['contact-form']['sent_to_mail'] != '' && !get_option('mystickyelements-contact-mail-sent') ) { $send_mail = $_POST['contact-form']['sent_to_mail']; $subject = "Great job! You created your contact form successfully"; $message = 'Thanks for using MyStickyElements! If you see this message in your spam folder, please click on "Report not spam" so you will get the next leads into your inbox.'; $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 ) ) { update_option( 'mystickyelements-contact-mail-sent', true ); } } $this->mystickyelements_clear_all_caches(); if(isset($_POST['save_view']) && $_POST['save_view'] == 'Save View'){ echo ''; if( isset($_POST['widgest_status']) && $_POST['widgest_status'] == 0 ){ echo ''; } else { echo ''; } } if(( isset($_POST['submit']) && $_POST['submit'] == 'Save' ) || ( isset($_POST['submit']) && $_POST['submit'] == 'Publish' )){ if( isset($_POST['widgest_status']) && $_POST['widgest_status'] == 0 ){ $this->show_save_popup(); } echo ''; echo ''; } } $contact_field = get_option( 'mystickyelements-contact-field' ); $is_widgest_create = 1; if ( empty( $contact_field ) ) { $is_widgest_create = 'my-sticky-elements-new-widget'; $contact_field = array( 'name', 'phone', 'email', 'message', 'dropdown' ); } $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'); if ( !$contact_form && !$social_channels && !$social_channels_tabs && !$general_settings ) { $contact_form = mystickyelement_default_settings( 'contact_form' ); $social_channels = mystickyelement_default_settings( 'social_channels' ); $social_channels_tabs = mystickyelement_default_settings( 'social_channels_tabs' ); $general_settings = mystickyelement_default_settings( 'general_settings' ); } if ( !isset($general_settings['position']) ) { $general_settings['position'] = 'left'; } if ( !isset($general_settings['position_mobile']) ) { $general_settings['position_mobile'] = 'left'; } $social_channels_lists = mystickyelements_social_channels(); $upgrade_url = admin_url("admin.php?page=my-sticky-elements-upgrade"); $is_pro_active = false; $is_shown = MSE_SIGNUP_CLASS::check_modal_status(); if($is_shown) { /* Signup Form When first time activate plugin */ include_once MYSTICKYELEMENTS_PATH . '/admin/email-signup.php'; } else { $default_fonts = array('Arial', 'Tahoma', 'Verdana', 'Helvetica', 'Times New Roman', 'Trebuchet MS', 'Georgia', 'Open Sans Hebrew'); if (isset($general_settings['font_family']) && $general_settings['font_family'] !="" ) : if ( !in_array( $general_settings['font_family'], $default_fonts) ): ?>

">
prefix . "mystickyelement_contact_lists"; $result = $wpdb->get_results ( "SELECT count(*) as count FROM {$table_name} ORDER BY ID DESC" ); if ( $result[0]->count != 0 && !get_option( 'myStickyelements_show_leads' )) { ?> show_save_popup(); } } } public function show_save_popup(){ ?>
[ 'href' => [], 'title' => [], 'target' => [], ], 'abbr' => [ 'title' => [] ], 'acronym' => [ 'title' => [] ], 'code' => [], 'pre' => [], 'em' => [], 'strong' => [], 'ul' => [], 'ol' => [], 'li' => [], 'p' => [], 'br' => [], 'svg' => [ 'xmlns' => [], 'fill' => [], 'viewbox' => [], 'role' => [], 'focusable' => [], 'height' => [], 'width' => [], 'style' => [], ], 'g' => [ "id" => [], "fill" => [], ], 'path' => [ 'class' => [], 'style' => true, 'd' => [], 'fill' => [], ] ]; $social_channel = (isset($_POST['social_channel'])) ? $_POST['social_channel'] : $key; if ($social_channel != '') { $social_channels_tabs = get_option('mystickyelements-social-channels-tabs' . $element_widget_no, true); /* Return when Is Empty key found and isajax not set */ if (isset($social_channels_tabs['is_empty']) && $social_channels_tabs['is_empty'] == 1 && !isset($_POST['is_ajax'])) { return; } $social_channel_value = (isset($social_channels_tabs[$key])) ? $social_channels_tabs[$key] : array(); if (strpos($social_channel, 'custom_channel') !== false || strpos($social_channel, 'custom_shortcode') !== false) { $custom_channel_temp = ''; if (strpos($social_channel, 'custom_channel') !== false) { $custom_channel_temp = $social_channel; $social_channel = 'custom_channel'; } if (strpos($social_channel, 'custom_shortcode') !== false) { $custom_channel_temp = $social_channel; $social_channel = 'custom_shortcode'; } $social_channels_lists = mystickyelements_custom_social_channels(); $social_channels_list = $social_channels_lists[$social_channel]; if ( isset($social_channel_value['channel_type']) && $social_channel_value['channel_type'] != '' && $social_channel_value['channel_type'] != 'custom') { $custom_social_channels_lists = mystickyelements_social_channels(); $social_channel_value['class'] = $custom_social_channels_lists[$social_channel_value['channel_type']]['class']; $social_channels_list['class'] = $custom_social_channels_lists[$social_channel_value['channel_type']]['class']; $social_channel_value['fontawesome_icon'] = $custom_social_channels_lists[$social_channel_value['channel_type']]['class']; $social_channels_list['fontawesome_icon'] = $custom_social_channels_lists[$social_channel_value['channel_type']]['class']; if ( isset($custom_social_channels_lists[$social_channel_value['channel_type']]['custom_svg_icon'])) { $social_channel_value['custom_svg_icon'] = $custom_social_channels_lists[$social_channel_value['channel_type']]['custom_svg_icon']; $social_channels_list['custom_svg_icon'] = $custom_social_channels_lists[$social_channel_value['channel_type']]['custom_svg_icon']; } } if ($custom_channel_temp != '') { $social_channel = $custom_channel_temp; } if (isset($_POST['channel_key']) && $_POST['channel_key'] != '') { $social_channel = $social_channel . '_' . $_POST['channel_key']; } } else { $social_channels_lists = mystickyelements_social_channels(); $social_channels_list = ( isset($social_channels_lists[$social_channel])) ? $social_channels_lists[$social_channel] : []; if( empty($social_channels_list)) { return; } } $social_channels_list['text'] = isset($social_channels_list['text']) ? $social_channels_list['text'] : ""; $social_channels_list['icon_text'] = isset($social_channels_list['icon_text']) ? $social_channels_list['icon_text'] : ""; $social_channels_list['icon_text_size'] = isset($social_channels_list['icon_text_size']) ? $social_channels_list['icon_text_size'] : ""; $social_channels_list['background_color'] = isset($social_channels_list['background_color']) ? $social_channels_list['background_color'] : ""; $social_channels_list['hover_text'] = isset($social_channels_list['hover_text']) ? $social_channels_list['hover_text'] : ""; if (empty($social_channel_value)) { $social_channel_value['text'] = '';//$social_channels_list['text']; $social_channel_value['bg_color'] = $social_channels_list['background_color']; $social_channel_value['icon_text'] = $social_channels_list['icon_text']; $social_channel_value['icon_text_size'] = $social_channels_list['icon_text_size']; $social_channel_value['hover_text'] = $social_channels_list['hover_text']; $social_channel_value['desktop'] = 1; $social_channel_value['mobile'] = 1; $social_channel_value['icon_color'] = ''; } if (!isset($social_channel_value['icon_text'])) { $social_channel_value['icon_text'] = ''; } if (!isset($social_channel_value['icon_text_size'])) { $social_channel_value['icon_text_size'] = ''; } if (!isset($social_channel_value['icon_color'])) { $social_channel_value['icon_color'] = ''; } if (!isset($social_channel_value['pre_set_message'])) { $social_channel_value['pre_set_message'] = ''; } if (isset($social_channels_list['custom']) && $social_channels_list['custom'] == 1 && isset($social_channel_value['fontawesome_icon']) && $social_channel_value['fontawesome_icon'] != '') { $social_channels_list['class'] = $social_channel_value['fontawesome_icon']; } else { $social_channel_value['fontawesome_icon'] = ''; } if (!isset($social_channels_list['custom_icon']) && !isset($social_channel_value['custom_icon'])) { $social_channel_value['custom_icon'] = ''; } if ($key == 'line') { echo ""; } if ($key == 'qzone') { echo ""; } $social_channel_value['text'] = str_replace('\"', '"', $social_channel_value['text']); $social_channel_value['channel_type'] = (isset($social_channel_value['channel_type'])) ? $social_channel_value['channel_type'] : ''; $social_channel_value['open_new_tab'] = (isset($social_channel_value['open_new_tab'])) ? $social_channel_value['open_new_tab'] : ''; $social_channel_value['use_whatsapp_web'] = (isset($social_channel_value['use_whatsapp_web'])) ? $social_channel_value['use_whatsapp_web'] : ''; $social_channel_value['mobile'] = (isset($social_channel_value['mobile'])) ? $social_channel_value['mobile'] : ''; $social_channel_value['desktop'] = (isset($social_channel_value['desktop'])) ? $social_channel_value['desktop'] : ''; $channel_type = (isset($social_channel_value['channel_type'])) ? $social_channel_value['channel_type'] : ''; $social_channel_value['icon_text_color'] = (isset($social_channel_value['icon_text_color'])) ? $social_channel_value['icon_text_color'] : '#ffffff'; if ($channel_type != 'custom' && $channel_type != '') { if ($channel_type == 'whatsapp') { $social_channels_list['is_pre_set_message'] = 1; } } $channel_class = (isset($social_channels_list['channel_class'])) ? $social_channels_list['channel_class'] : ''; ?>
prefix . "mystickyelement_contact_lists"; if ( isset($_POST['stickyelement-contatc-submit']) && !wp_verify_nonce( $_POST['stickyelement-contatc-submit'], 'stickyelement-contatc-submit' ) ) { echo '

' . esc_html__('Unable to complete your request','mystickyelements'). '

'; } else if ( isset($_POST['stickyelement-contatc-submit']) && wp_verify_nonce( $_POST['stickyelement-contatc-submit'], 'stickyelement-contatc-submit' ) ) { if ( isset($_POST['delete_message']) && !empty($_POST['delete_message']) && !wp_doing_ajax()) { $count = count($_POST['delete_message']); foreach ( $_POST['delete_message'] as $key=>$ID) { if ( is_int($ID) ) { $ID = sanitize_text_field($ID); $query = "DELETE FROM {$table_name} WHERE ID = %d"; $query = $wpdb->prepare($query, $ID); //$wpdb->query($query); $wpdb->delete( $table_name, array( 'ID' => sanitize_text_field($ID) ), array( '%d' ) ); } } echo '

' . esc_html__( $count . ' message deleted.','mystickyelements'). '

'; } } ?>

" />
esc_like($searchContent).'%', '%'.$wpdb->esc_like($searchContent).'%', '%'.$wpdb->esc_like($searchContent).'%', '%'.$wpdb->esc_like($searchContent).'%' ]; } ?>
" method="post">
" method='get'>
prepare($total_query, $whereCond); $whereCond[] = $offset; $whereCond[] = $items_per_page; $query = "SELECT * FROM {$table_name} {$where_search} ORDER BY ID DESC LIMIT %d, %d"; $query = $wpdb->prepare($query, $whereCond); } else { $total_query = "SELECT count(*) FROM {$table_name} ORDER BY ID DESC"; $whereCond = [$offset, $items_per_page]; $query = "SELECT * FROM {$table_name} ORDER BY ID DESC LIMIT %d, %d"; $query = $wpdb->prepare($query, $whereCond); } $total = $wpdb->get_var( $total_query ); $result = $wpdb->get_results( $query ); $total_page = ceil($total / $items_per_page); if($result){ foreach ( $result as $res ) { ?> custom_fields, true ); foreach( $custom_fields as $value ) { ?>
ID);?> widget_element_name);?> contact_name);?> contact_phone);?> contact_email);?> contact_option);?> contact_message));?> consent_checkbox) && $res->consent_checkbox == 1 ) ? "True" : "False");?>
    $index_val ){ if( isset( $custom_field[$value][$key] ) && $custom_field[$value][$key] != '' && ( substr( $custom_field[$value][$key], 0, 7 ) == 'http://' || substr( $custom_field[$value][$key], 0, 7 ) == 'https:/' ) ) { $parts = parse_url($custom_field[$value][$key]); if ( isset($parts['path']) ) { echo "
  • "; $file_name = basename($parts['path']); $file_url = ''.$file_name.''; echo esc_attr(( isset( $custom_field[$value][$key] ) && $custom_field[$value][$key] != '' ) ? $file_url : $custom_field[$value][$key]); echo "
  • "; } else { echo esc_attr($custom_field[$value][$key]); } } else { echo esc_attr(( isset( $custom_field[$value][$key] ) && $custom_field[$value][$key] != '' ) ? wp_kses_post($custom_field[$value][$key]) : ''); } } } ?>
message_date) ? $res->message_date : '-' );?> page_link) :?> ip_address; ?>

1){ ?>
add_query_arg( 'cpage', '%#%' ), 'format' => '', 'current' => $page, 'total' => $total_page ) );?>
__( 'You are not allowed to perform this action.', 'mystickyelements' ) ), 403 ); } check_ajax_referer( 'mystickyelements', 'wpnonce' ); $status = is_plugin_active( 'chatway-live-chat/chatway.php' ) ? 'active' : ''; wp_send_json_success( array( 'status' => $status ) ); } public function mystickyelement_delete_db_record(){ global $wpdb; if ( ! current_user_can( 'manage_options' ) ) { wp_die(0); } check_ajax_referer( 'mystickyelements', 'wpnonce' ); if ( isset($_POST['ID']) && $_POST['ID'] != '' && wp_verify_nonce($_POST['delete_nonce'], "mysticky_elements_delete_nonce") ) { $ID = sanitize_text_field($_POST['ID']); $table = $wpdb->prefix . 'mystickyelement_contact_lists'; $ID = self::sanitize_options($ID, "sql"); $delete_sql = $wpdb->prepare("DELETE FROM {$table} WHERE id = %d",$ID); $delete = $wpdb->query($delete_sql); } if ( isset($_POST['all_leads']) && $_POST['all_leads'] == 1 && wp_verify_nonce($_POST['delete_nonce'], "mysticky_elements_delete_nonce")) { $table = $wpdb->prefix . 'mystickyelement_contact_lists'; $delete = $wpdb->query("TRUNCATE TABLE $table"); } wp_die(); } public function myStickyelements_intro_popup_action() { if ( ! current_user_can( 'manage_options' ) ) { wp_die(0); } if( !empty( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], 'myStickyelements_update_popup_status' ) ) { update_option( "mystickyelements_intro_popup", "hide" ); } echo esc_attr("1"); die; } public function mystickyelements_admin_send_message_to_owner() { if ( ! current_user_can( 'manage_options' ) ) { wp_die(0); } $response = array(); $response['status'] = 0; $response['error'] = 0; $response['errors'] = array(); $response['message'] = ""; $errorArray = []; $errorMessage = esc_html__("%s is required", "mystickyelements"); $postData = $_POST; if(!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") { $error = array( "key" => "textarea_text", "message" => esc_html__("Please enter your message",'mystickyelements') ); $errorArray[] = $error; } if(!isset($postData['user_email']) || trim($postData['user_email']) == "") { $error = array( "key" => "user_email", "message" => sprintf($errorMessage,__("Email",'mystickyelements')) ); $errorArray[] = $error; } else if(!filter_var($postData['user_email'], FILTER_VALIDATE_EMAIL)) { $error = array( 'key' => "user_email", "message" => "Email is not valid" ); $errorArray[] = $error; } if(empty($errorArray)) { if(!isset($_REQUEST['nonce']) || empty($_REQUEST['nonce'])) { $error = array( 'key' => "nonce", "message" => "Your request is not valid" ); $errorArray[] = $error; } else if(!wp_verify_nonce($_REQUEST['nonce'], "mystickyelements_send_message_to_owner")) { $error = array( 'key' => "nonce", "message" => "Your request is not valid" ); $errorArray[] = $error; } } if(empty($errorArray)) { global $current_user; $text_message = $postData['textarea_text']; $email = $postData['user_email']; $domain = site_url(); $user_name = $current_user->first_name." ".$current_user->last_name; $response['status'] = 1; /* sending message to Crisp */ $post_message = array(); $message_data = array(); $message_data['key'] = "Plugin"; $message_data['value'] = "My Sticky Elements"; $post_message[] = $message_data; $message_data = array(); $message_data['key'] = "Domain"; $message_data['value'] = $domain; $post_message[] = $message_data; $message_data = array(); $message_data['key'] = "Email"; $message_data['value'] = $email; $post_message[] = $message_data; $message_data = array(); $message_data['key'] = "Message"; $message_data['value'] = $text_message; $post_message[] = $message_data; $api_params = array( 'domain' => $domain, 'email' => $email, 'url' => site_url(), 'name' => $user_name, 'message' => $post_message, 'plugin' => "MSE", 'type' => "Need Help", ); /* Sending message to Crisp API */ $crisp_response = wp_safe_remote_post("https://premioapps.com/premio/send-message-api.php", array('body' => $api_params, 'timeout' => 15, 'sslverify' => true)); if (is_wp_error($crisp_response)) { wp_safe_remote_post("https://premioapps.com/premio/send-message-api.php", array('body' => $api_params, 'timeout' => 15, 'sslverify' => false)); } } else { $response['error'] = 1; $response['errors'] = $errorArray; } wp_send_json($response); wp_die(); } public function mystickyelement_widget_status() { if ( ! current_user_can( 'manage_options' ) ) { wp_die(0); } check_ajax_referer( 'mystickyelements', 'wpnonce' ); if ( isset($_POST['widget_id']) && $_POST['widget_id'] != '' && isset($_POST['widget_status']) && $_POST['widget_status'] != '' ) { $stickyelements_widgets = get_option('stickyelements_widgets'); $widget_id = $_POST['widget_id']; $widget_status = $_POST['widget_status']; $stickyelements_widgets[$widget_id]['status'] = $widget_status; update_option( 'stickyelements_widgets',$stickyelements_widgets); } wp_die(); } public function my_sticky_elements_bulks(){ global $wpdb; if ( ! current_user_can( 'manage_options' ) ) { wp_die(0); } check_ajax_referer( 'mystickyelements', 'wpnonce' ); if( isset($_POST['wpnonce']) ){ $bulks = isset($_POST['bulks']) ? $_POST['bulks'] : array(); foreach( $bulks as $key => $bulk ){ $ID = sanitize_text_field($bulk); $table = $wpdb->prefix . 'mystickyelement_contact_lists'; $ID = self::sanitize_options($ID, "sql"); $delete_sql = $wpdb->prepare("DELETE FROM {$table} WHERE id = %d",$ID); $delete = $wpdb->query($delete_sql); } } wp_die(); } public function mystickyelement_widget_rename(){ if ( ! current_user_can( 'manage_options' ) ) { wp_die(0); } check_ajax_referer( 'mystickyelements', 'wpnonce' ); if ( isset($_POST['widget_id']) && $_POST['widget_id'] != '' && isset($_POST['widget_rename']) && $_POST['widget_rename'] != '' ) { $stickyelements_widgets = get_option('mystickyelements-widgets'); $widget_id = $_POST['widget_id']; $widget_rename = $_POST['widget_rename']; $stickyelements_widgets[$widget_id] = $widget_rename; update_option( 'mystickyelements-widgets' ,$stickyelements_widgets); } wp_die(); } public function mystickyelement_widget_delete(){ if ( ! current_user_can( 'manage_options' ) ) { wp_die(0); } check_ajax_referer( 'mystickyelements', 'wpnonce' ); if ( isset($_POST['widget_id']) && $_POST['widget_id'] != '' && isset($_POST['widget_delete']) && $_POST['widget_delete'] == 1 ) { $elements_widgets = get_option( 'mystickyelements-widgets' ); $stickyelements_widgets_status = get_option('stickyelements_widgets'); $mystickyelements_widget = self::sanitize_options($_POST['widget_id']); foreach( $elements_widgets as $key => $widget_value ){ $element_widget_no = ''; if ( $key != 0 ) { $element_widget_no = '-' . esc_attr($key); } delete_option( 'mystickyelements-contact-field' . $element_widget_no ); delete_option( 'mystickyelements-contact-form' . $element_widget_no ); delete_option( 'mystickyelements-social-channels' . $element_widget_no ); delete_option( 'mystickyelements-social-channels-tabs' . $element_widget_no ); delete_option( 'mystickyelements-general-settings' . $element_widget_no ); } delete_option( 'mystickyelements-widgets' ); delete_option( 'stickyelements_widgets' ); } wp_die(); } public function mystickyelements_deactivate() { global $pagenow; if ( 'plugins.php' !== $pagenow ) { return; } include MYSTICKYELEMENTS_PATH . 'mystickyelements-deactivate-form.php'; } public function mystickyelements_plugin_deactivate() { global $current_user; if ( ! current_user_can( 'manage_options' ) ) { wp_die(0); } check_ajax_referer( 'mystickyelements_deactivate_nonce', 'nonce' ); $postData = $_POST; $errorCounter = 0; $response = array(); $response['status'] = 0; $response['message'] = ""; $response['valid'] = 1; if(!isset($postData['reason']) || empty($postData['reason'])) { $errorCounter++; $response['message'] = "Please provide reason"; } else if(!isset($postData['reason']) || empty($postData['reason'])) { $errorCounter++; $response['message'] = "Please provide reason"; } else { $nonce = $postData['nonce']; if(!wp_verify_nonce($nonce, 'mystickyelements_deactivate_nonce')) { $response['message'] = esc_html__("Your request is not valid", "mystickyelements"); $errorCounter++; $response['valid'] = 0; } } if($errorCounter == 0) { global $current_user; $plugin_info = get_plugin_data( MYSTICKYELEMENTS_PATH. 'mystickyelements.php'); $postData = $_POST; $email = "none@none.none"; if (isset($postData['email_id']) && !empty($postData['email_id']) && filter_var($postData['email_id'], FILTER_VALIDATE_EMAIL)) { $email = $postData['email_id']; } $domain = site_url(); $user_name = $current_user->first_name . " " . $current_user->last_name; $response['status'] = 1; /* sending message to Crisp */ $post_message = array(); $message_data = array(); $message_data['key'] = "Plugin"; $message_data['value'] = "My Sticky Elements"; $post_message[] = $message_data; $message_data = array(); $message_data['key'] = "Plugin Version"; $message_data['value'] = $plugin_info['Version']; $post_message[] = $message_data; $message_data = array(); $message_data['key'] = "Domain"; $message_data['value'] = $domain; $post_message[] = $message_data; $message_data = array(); $message_data['key'] = "Email"; $message_data['value'] = $email; $post_message[] = $message_data; $message_data = array(); $message_data['key'] = "WordPress Version"; $message_data['value'] = esc_attr(get_bloginfo('version')); $post_message[] = $message_data; $message_data = array(); $message_data['key'] = "PHP Version"; $message_data['value'] = PHP_VERSION; $post_message[] = $message_data; $message_data = array(); $message_data['key'] = "Message"; $message_data['value'] = $postData['reason']; $post_message[] = $message_data; $api_params = array( 'domain' => $domain, 'email' => $email, 'url' => site_url(), 'name' => $user_name, 'message' => $post_message, 'plugin' => "MSE", 'type' => "Uninstall", ); /* Sending message to Crisp API */ $crisp_response = wp_safe_remote_post("https://premioapps.com/premio/send-message-api.php", array('body' => $api_params, 'timeout' => 15, 'sslverify' => true)); if (is_wp_error($crisp_response)) { wp_safe_remote_post("https://premioapps.com/premio/send-message-api.php", array('body' => $api_params, 'timeout' => 15, 'sslverify' => false)); } } echo json_encode($response); wp_die(); } /* * clear cache when any option is updated * */ public function mystickyelements_clear_all_caches(){ try { global $wp_fastest_cache; // if W3 Total Cache is being used, clear the cache if (function_exists('w3tc_flush_all')) { w3tc_flush_all(); } /* if WP Super Cache is being used, clear the cache */ if (function_exists('wp_cache_clean_cache')) { global $file_prefix, $supercachedir; if (empty($supercachedir) && function_exists('get_supercache_dir')) { $supercachedir = get_supercache_dir(); } wp_cache_clean_cache($file_prefix); } if (class_exists('WpeCommon')) { //be extra careful, just in case 3rd party changes things on us if (method_exists('WpeCommon', 'purge_memcached')) { //WpeCommon::purge_memcached(); } if (method_exists('WpeCommon', 'clear_maxcdn_cache')) { //WpeCommon::clear_maxcdn_cache(); } if (method_exists('WpeCommon', 'purge_varnish_cache')) { //WpeCommon::purge_varnish_cache(); } } if (method_exists('WpFastestCache', 'deleteCache') && !empty($wp_fastest_cache)) { $wp_fastest_cache->deleteCache(); } if (function_exists('rocket_clean_domain')) { rocket_clean_domain(); // Preload cache. if (function_exists('run_rocket_sitemap_preload')) { run_rocket_sitemap_preload(); } } if (class_exists("autoptimizeCache") && method_exists("autoptimizeCache", "clearall")) { autoptimizeCache::clearall(); } if (class_exists("LiteSpeed_Cache_API") && method_exists("autoptimizeCache", "purge_all")) { LiteSpeed_Cache_API::purge_all(); } if ( class_exists( '\Hummingbird\Core\Utils' ) ) { $modules = \Hummingbird\Core\Utils::get_active_cache_modules(); foreach ( $modules as $module => $name ) { $mod = \Hummingbird\Core\Utils::get_module( $module ); if ( $mod->is_active() ) { if ( 'minify' === $module ) { $mod->clear_files(); } else { $mod->clear_cache(); } } } } /* Clear nitropack plugin cache */ if ( function_exists( 'nitropack_purge_cache' ) && function_exists( 'nitropack_sdk_purge' ) ) { nitropack_sdk_purge(NULL, NULL, 'Manual purge of all pages'); } } catch (Exception $e) { return 1; } } public function mystickyelements_review_box() { if (current_user_can('manage_options')) { $nonce = filter_input(INPUT_POST, 'nonce'); $days = filter_input(INPUT_POST, 'days'); if (!empty($nonce) && wp_verify_nonce($nonce, 'mystickyelements')) { if ($days == -1) { add_option("mystickyelements_hide_review_box", "1"); update_option("get_mystickyelements_page_views", -1); } else { $date = date("Y-m-d", strtotime("+".$days." days")); update_option("mystickyelements_show_review_box_after", $date); update_option("get_mystickyelements_page_views", 4); } } } wp_die(); } public function mystickyelements_review_box_message (){ if (current_user_can('manage_options')) { $nonce = filter_input(INPUT_POST, 'nonce'); if (!empty($nonce) && wp_verify_nonce($nonce, 'mystickyelements')) { add_option("mystickyelements_hide_review_box", "1"); update_option("get_mystickyelements_page_views", -1); $rating = filter_input(INPUT_POST, 'rating'); $message = filter_input(INPUT_POST, 'message'); if ( $message != '' ) { global $current_user; $postMessage = []; $domain = site_url(); $user_name = $current_user->first_name." ".$current_user->last_name; $email = $current_user->user_email; $messageData = []; $messageData['key'] = "email"; $messageData['value'] = $email; $postMessage[] = $messageData; $messageData = []; $messageData['key'] = "website"; $messageData['value'] = $domain; $postMessage[] = $messageData; $messageData = []; $messageData['key'] = "message"; $messageData['value'] = $message; $postMessage[] = $messageData; $messageData = []; $messageData['key'] = "rating"; $messageData['value'] = $rating; $postMessage[] = $messageData; $apiParams = [ 'title' => 'Review for My Sticky Elements WordPress', 'domain' => $domain, 'email' => "contact@premio.io", 'url' => site_url(), 'name' => $user_name, 'message' => $postMessage, 'plugin' => 'My Sticky Elements', 'type' => "Review", ]; // Sending message to Crisp API $apiResponse = wp_safe_remote_post("https://premioapps.com/premio/send-feedback-api.php", ['body' => $apiParams, 'timeout' => 15, 'sslverify' => true]); if (is_wp_error($apiResponse)) { wp_safe_remote_post("https://premioapps.com/premio/send-feedback-api.php", ['body' => $apiParams, 'timeout' => 15, 'sslverify' => false]); } } } wp_die(); } } } } if( is_admin() ) { $my_settings_page = new MyStickyElementsPage_pro(); //include_once "class-review-box.php"; include_once "class-upgrade-box.php"; }