Plugin Directory

Changeset 2601509


Ignore:
Timestamp:
09/20/2021 04:58:12 AM (4 years ago)
Author:
mndpsingh287
Message:

fixed security issues

Location:
advance-search/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • advance-search/trunk/advance-search.php

    r2597560 r2601509  
    122122 */
    123123function upgrade_php_version() {
    124     echo '<div class="error">';
    125     echo '<p>' . __('Advanced Search plugin requires a minmum PHP Version of '.$min_php.'. You have to upgrade your php version to enjoy Advanced Search.', PLUGIN_TEXT_DOMAIN) . '</p>';
    126     echo '</div>';
     124    $html = '<div class="error">';
     125    $html .= '<p>' . __('Advanced Search plugin requires a minmum PHP Version of '.$min_php.'. You have to upgrade your php version to enjoy Advanced Search.', PLUGIN_TEXT_DOMAIN) . '</p>';
     126    $html .= '</div>';
     127    echo apply_filters('the_content',$html);   
    127128}
    128129
  • advance-search/trunk/inc/admin/class-admin.php

    r2597560 r2601509  
    7676            {
    7777                wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/advance-search-admin.css', array(), $this->version, 'all' );
     78                wp_enqueue_style( $this->plugin_name.'_popup-css', plugin_dir_url( __FILE__ ) . 'css/popup.css', array(), $this->version, 'all' );
    7879            }
    79         wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/common.css', array(), $this->version, 'all' );
    80 
    81         // include fontawesome
    82 
    83         wp_enqueue_style( 'wpas-font-awesome',  plugin_dir_url( dirname( __DIR__ ) ) . 'assets/css/font-awesome.min.css', array(), '', 'all' );
     80            wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/common.css', array(), $this->version, 'all' );
     81           
     82            // include fontawesome
     83           
     84            wp_enqueue_style( 'wpas-font-awesome',  plugin_dir_url( dirname( __DIR__ ) ) . 'assets/css/font-awesome.min.css', array(), '', 'all' );
    8485
    8586    }
     
    99100
    100101            wp_localize_script( $this->plugin_name, 'js_params', array(
    101                 'has_msg' => isset($_GET["msg"]) && isset($_GET['wpas_id']) ? 'admin.php?page=advance-search&wpas_id='.intval($_GET['wpas_id']) : ''
     102                'has_msg' => (isset($_GET["msg"]) && isset($_GET['wpas_id'])) ? esc_url_raw('admin.php?page=advance-search&wpas_id='.intval($_GET['wpas_id'])) : '',
     103                'delete_record_text' => __('Are you sure you want to delete this record?'),
     104                'confirmation_text' => __('A confirmation link has been sent to your email address. Please click on the link to verify your email address.'),
     105                'something_wrong_text' => __('Something went wrong. Please try again.'),
     106               
    102107            ));
    103108            wp_enqueue_script( $this->plugin_name );
     
    266271        if( isset( $_POST['wpas-search'] ) && wp_verify_nonce( sanitize_text_field($_POST['wpas-search']), $this->plugin_name) ) {
    267272            $search_form_name=trim(sanitize_text_field(htmlentities( $_POST['wpas']['search_form_name'] )));
    268        
     273            if(strlen($search_form_name) > 20){
     274                wp_redirect(esc_url_raw(admin_url('admin.php?page='. $this->plugin_name.'&name-maxlength')));
     275                exit;
     276            }
    269277            $data = $this->search_default_settings();
    270 
    271278            global $wpdb;
    272279            $search_form_table = $wpdb->prefix."wpas_index";
     
    276283                $checkName = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) from $search_form_table where name=%s",$search_form_name));
    277284                if ($checkName == 0) {
    278                     $sql = "INSERT ignore INTO $search_form_table (name, data) VALUES ('$search_form_name', '$data')";
    279                    
     285                    $sql =  $wpdb->prepare( " INSERT INTO $search_form_table ( name, data ) VALUES ( %s, %s ) ", array( $search_form_name, $data ) ) ;
    280286                    if($wpdb->query($sql)) {
    281287                        $form_id = $wpdb->insert_id;
    282                             wp_redirect(admin_url('admin.php?page='. $this->plugin_name.'&wpas_id='.$form_id));
     288                            wp_redirect(esc_url_raw(admin_url('admin.php?page='. $this->plugin_name.'&wpas_id='.$form_id)));
    283289                            exit;
    284290                    }
    285291                }
    286292                else{   
    287                     wp_redirect(admin_url('admin.php?page='. $this->plugin_name.'&name-already-exists'));
     293                    wp_redirect(esc_url_raw(admin_url('admin.php?page='. $this->plugin_name.'&name-already-exists')));
    288294                    exit;
    289295                }   
    290296            }
    291297            else {
    292                 wp_redirect(admin_url('admin.php?page='. $this->plugin_name));
     298                wp_redirect(esc_url_raw(admin_url('admin.php?page='. $this->plugin_name)));
    293299                exit;
    294300            }
     
    310316
    311317        if ( ! wp_verify_nonce( $nonce, 'extra_ajax_nonce' ) && !current_user_can( 'manage_options' ) ) {
    312             echo "false";
     318       
     319            echo wp_json_encode(array('error' => "false"));
    313320            die();
    314321        }
     
    322329
    323330            if(isset($ajax_type) && !empty($ajax_type) ) {
    324 
    325331                // check if ajax for clone
    326332
     
    328334
    329335                    $search_form_name=trim(sanitize_text_field( htmlentities($_POST['search_form_name'] )));
     336
     337                    // length check for form name
     338                    if(strlen($search_form_name) > 20){
     339                        $responsearray = array('astext' => 'name-length');
     340                        echo wp_json_encode($responsearray);
     341                        exit;
     342                    }
    330343                   
    331344                    global $wpdb;
     
    338351                        $checkName = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) from $search_form_table where name=%s", $search_form_name));
    339352
    340                         $search_form_setting = $wpdb->get_results($wpdb->prepare("SELECT * FROM $search_form_table where id=%d", $form_id));
     353                        $search_form_setting = $wpdb->get_row($wpdb->prepare("SELECT * FROM $search_form_table where id=%d", $form_id));
    341354                        if ($checkName == 0) {
    342355                        if(!empty($search_form_setting)) {
    343                             $data = $search_form_setting[0];
    344                             $form_setting = $data->data;
     356                            $form_setting = $search_form_setting->data;
    345357                           
    346358                            $search_form_table = $wpdb->prefix."wpas_index";
    347                            
    348                             $sql = "INSERT INTO $search_form_table (name, data) VALUES ('$search_form_name', '$form_setting')";
    349                            
     359                            $sql =  $wpdb->prepare( "INSERT INTO $search_form_table ( name, data ) VALUES ( %s, %s ) ", array( $search_form_name, $form_setting ) ) ;
    350360                            if($wpdb->query($sql)) {
    351361                                $lastid = $wpdb->insert_id;
    352362                                $responsearray = array('astext' => 'true' );
    353                                 echo json_encode($responsearray);
     363                                echo wp_json_encode($responsearray);
    354364                                exit;
    355365                            }
     
    357367                        else {
    358368                            $responsearray = array('astext' => 'false' );
    359                             echo json_encode($responsearray);
     369                            echo wp_json_encode($responsearray);
    360370                            exit;
    361371                        }
    362372                      }
    363373                      else{
    364                         $responsearray = array('astext' => 'already exists');
    365                         echo json_encode($responsearray);
     374                        $responsearray = array('astext' => 'already-exists');
     375                        echo wp_json_encode($responsearray);
    366376                        exit;
    367377                    }
     
    369379                    else{
    370380                        $responsearray = array('astext' => 'empty');
    371                         echo json_encode($responsearray);
     381                        echo wp_json_encode($responsearray);
    372382                        exit;
    373383                    }
    374384                }
    375385                    else {
    376                         echo "limit";
     386                        echo wp_json_encode(array('error' => "limit"));
    377387                        exit;
    378388                    }
     
    387397                    $search_form_table = $wpdb->prefix."wpas_index";
    388398                   
    389                     $sql = "DELETE FROM $search_form_table WHERE id='$form_id'";
     399                    $sql = $wpdb->prepare("DELETE FROM $search_form_table WHERE id=%d", $form_id);
    390400
    391401                    if($wpdb->query($sql)) {
    392402                        $responsearray = array('astext' => 'true');
    393                         echo json_encode($responsearray);
     403                        echo wp_json_encode($responsearray);
    394404                        exit;
    395405                    }
    396406                    else {
    397407                        $responsearray = array('astext' => 'false');
    398                         echo json_encode($responsearray);
     408                        echo wp_json_encode($responsearray);
    399409                        exit;
    400410                    }
     
    425435
    426436                    if(isset($update_option)) {
    427                         wp_redirect(admin_url('admin.php?page='. $this->plugin_name.'&theme-search-replaced' ));
     437                        wp_redirect(esc_url_raw(admin_url('admin.php?page='. $this->plugin_name.'&theme-search-replaced' )));
    428438                        exit;
    429439                    }
     
    438448
    439449                    if(isset($update_option)) {
    440                         wp_redirect(admin_url('admin.php?page='. $this->plugin_name ));
     450                        wp_redirect(esc_url_raw(admin_url('admin.php?page='. $this->plugin_name )));
    441451                        exit;
    442452                    }
    443453
    444                 } // end default woo search             
    445 
     454                } // end default woo search
    446455
    447456            }
    448 
    449 
    450 
    451         }
    452 
     457        }
    453458    }
    454459
     
    470475            $data = $this->search_default_settings();
    471476           
    472             $sql = "Update $search_form_table SET data='$data' where id='$form_id'";
     477            $sql = $wpdb->prepare("Update $search_form_table SET data='$data' where id=%d", $form_id);
    473478           
    474479            if($wpdb->query($sql)) {
    475                 $redirect_url = admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$form_id."&msg=2";
     480                $redirect_url = esc_url_raw(admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$form_id."&msg=2");
    476481                wp_redirect($redirect_url);
    477482                exit;
    478483            }
    479484            else{
    480                 $redirect_url = admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$form_id."&msg=2";
     485                $redirect_url = esc_url_raw(admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$form_id."&msg=2");
    481486                wp_redirect($redirect_url);
    482487                exit;
     
    486491
    487492        // update form settings
    488 
    489493        if( isset( $_POST['wpas-search_setting'] ) && wp_verify_nonce( sanitize_text_field($_POST['wpas-search_setting']), 'search_form_settings') && current_user_can( 'manage_options' )) {
    490494           
    491495            $post_type_array = array(
    492                 'post_types' => isset($_POST['search_form_setting']['post_types']['post_types']) ? filter_var_array($_POST['search_form_setting']['post_types']['post_types']) : [],
    493                 'search_areas' => isset($_POST['search_form_setting']['post_types']['search_areas']) ? filter_var_array($_POST['search_form_setting']['post_types']['search_areas']) : [],
     496                'post_types' => isset($_POST['search_form_setting']['post_types']['post_types']) ? array_map('sanitize_text_field',$_POST['search_form_setting']['post_types']['post_types']) : [],
     497                'search_areas' => isset($_POST['search_form_setting']['post_types']['search_areas']) ? array_map('sanitize_text_field',$_POST['search_form_setting']['post_types']['search_areas']) : [],
    494498                'meta_keys' => array(
    495499                    isset($_POST['search_form_setting']['post_types']['meta_keys']) ? sanitize_text_field(htmlentities(stripslashes($_POST['search_form_setting']['post_types']['meta_keys'][0]))) : '',
     
    497501            );
    498502
     503       
    499504            $option =  array (
    500505                    'post_types' => $post_type_array,
    501506                    'taxonomies' =>array(
    502                         'taxonomies' => isset($_POST['search_form_setting']['taxonomies'],$_POST['search_form_setting']['taxonomies']['taxonomies']) ? filter_var_array($_POST['search_form_setting']['taxonomies']['taxonomies']) : [],
    503                         'search_areas' =>  isset($_POST['search_form_setting']['taxonomies'], $_POST['search_form_setting']['taxonomies']['search_areas']) ? filter_var_array($_POST['search_form_setting']['taxonomies']['search_areas']): [],
     507                        'taxonomies' => isset($_POST['search_form_setting']['taxonomies'],$_POST['search_form_setting']['taxonomies']['taxonomies']) ? array_map('sanitize_text_field',$_POST['search_form_setting']['taxonomies']['taxonomies']) : [],
     508                        'search_areas' =>  isset($_POST['search_form_setting']['taxonomies'], $_POST['search_form_setting']['taxonomies']['search_areas']) ? array_map('sanitize_text_field',$_POST['search_form_setting']['taxonomies']['search_areas']): [],
    504509                    ),
    505                     'attachments' => isset($_POST['search_form_setting']['attachments']) ? filter_var_array($_POST['search_form_setting']['attachments']) : [],
     510                    'attachments' => isset($_POST['search_form_setting']['attachments']) ? array_map('sanitize_text_field',$_POST['search_form_setting']['attachments']) : [],
    506511                    'styling' =>
    507512                        array (
     
    572577           
    573578            );
    574        
    575        
     579
    576580            $form_id = intval($_POST['search_form_setting']['form_id']);
    577             $data = json_encode($option);
    578            
    579        
     581            $data = wp_json_encode($option);
    580582            // update index table settings
    581             $sql = "Update $search_form_table SET data='$data' where id='$form_id'";
     583            $sql = $wpdb->prepare("Update $search_form_table SET data='$data' where id=%d", $form_id);
    582584            if($wpdb->query($sql)) {
    583                 $redirect_url = admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$form_id."&msg=1";
     585                $redirect_url = esc_url_raw(admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$form_id."&msg=1");
    584586                wp_redirect($redirect_url);
    585587                exit;
    586588            } else {
    587                 $redirect_url = admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$form_id."&msg=0";
     589                $redirect_url = esc_url_raw(admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$form_id."&msg=0");
    588590                wp_redirect($redirect_url);
    589591                exit;
     
    595597
    596598    // default data for new search added
    597 
    598599    public function search_default_settings() {
    599 
    600600        $option = array (
    601601          'post_types' =>
     
    676676        );
    677677
    678     $default_options = json_encode($option);
     678    $default_options = wp_json_encode($option);
    679679    return $default_options;
    680680
     
    738738        ?>
    739739       
    740         <?php if (count($menu_items)>0): ?>
    741         <?php $menu_items = implode(", ", $menu_items); ?>
    742         <script type="text/javascript">
    743             wpas_mce_button_menu = "<?php echo $menu_items; ?>";
    744         </script>
    745     <?php endif;
     740            <?php if (count($menu_items)>0): ?>
     741                <?php $menu_items = implode(", ", $menu_items);
     742                wp_register_script( 'advance-search-inlineebtn-js', '',);
     743                wp_enqueue_script( 'advance-search-inlineebtn-js' );
     744                wp_add_inline_script(
     745                'advance-search-inlineebtn-js',
     746                    'wpas_mce_button_menu = "'.esc_js($menu_items).'"'
     747                );
     748           
     749            endif;
    746750        return $settings;
    747751    }
     
    790794                $headers .= 'Content-type:text/html;charset=UTF-8'."\r\n";
    791795                $headers .= 'From: [email protected]'."\r\n";
    792                 $mail = mail($lokhal_email, $subject, $message, $headers);
     796                $mail = wp_mail($lokhal_email, $subject, $message, $headers);
    793797                $data = $this->verify_on_server($lokhal_email, $lokhal_fname, $lokhal_lname, $engagement, 'verify', '0');
    794798                if ($mail) {
     
    814818            $this->verify_on_server(get_option('wpas_email_address_'.$current_user->ID), get_option('verify_wpas_fname_'.$current_user->ID), get_option('verify_wpas_lname_'.$current_user->ID), '100', 'verified', '1');
    815819            update_option('wpas_email_verified_'.$current_user->ID, 'yes');
    816             echo '<p>Email Verified Successfully. Redirecting please wait.</p>';
    817             echo '<script>';
    818             echo 'setTimeout(function(){window.location.href="https://searchpro.ai/?utm_redirect=wp" }, 2000);';
    819             echo '</script>';
     820            $html =  '<p>Email Verified Successfully. Redirecting please wait.</p>';
     821            $html .= '<script>';
     822            $html .= 'setTimeout(function(){window.location.href="https://searchpro.ai/?utm_redirect=wp" }, 2000);';
     823            $html .= '</script>';
     824
     825            echo apply_filters('the_content',$html);
    820826        }
    821827        die;
  • advance-search/trunk/inc/admin/css/advance-search-admin.css

    r2500938 r2601509  
    19881988  padding-right: 35px;
    19891989}
     1990.pro_feature .buy_pro a {
     1991  position: absolute;
     1992  top: 50%;
     1993  text-align: center;
     1994  left: 50%;
     1995  background-color: #ff3547 !important;
     1996  color: #fff;
     1997  text-decoration: none;
     1998  padding: 6px 14px !important;
     1999  transform: translate(-50%, -50%);
     2000}
     2001.pro_feature .buy_pro {
     2002  height: 100%;
     2003  top: 0;
     2004  z-index: 99;
     2005}
    19902006/* Responsive Media Querys Here */
    19912007@media (max-width:1280px){
  • advance-search/trunk/inc/admin/js/advance-search-admin.js

    r2597560 r2601509  
    136136
    137137    // clone / delete setting
     138   
    138139
    139140    jQuery('.search_imp_ajax').click(function() {
     
    147148        var dataAjax = jQuery(this).attr('data-ajax');
    148149        if (jQuery(this).hasClass('delete_search')){
    149           var del=confirm("Are you sure you want to delete this record?");
     150          var del=confirm(js_params.delete_record_text);
    150151          if(del==true){
    151152            jQuery(".delete_search").attr("data-ajax", "Yes");
     
    176177                  if(data.astext == 'true' ){
    177178                    jQuery('.as-alreadyexists').hide();
     179                    jQuery('.as-namelength').hide();
    178180                    jQuery('.as-validname').hide();
    179181                     jQuery('.as-success').show();                     
     
    184186                   
    185187                  }
    186                   else if(data.astext == 'already exists' ){
     188                  else if(data.astext == 'already-exists' ){
    187189                    jQuery('.as-alreadyexists').show();
    188190                    jQuery('.as-validname').hide();
     191                    jQuery('.as-namelength').hide();
    189192                    return false;
    190193                   }else if(data.astext == 'empty'){
    191194                    jQuery('.as-validname').show();
    192195                      jQuery('.as-alreadyexists').hide();
     196                      jQuery('.as-namelength').hide();
     197                      jQuery('.as-success').hide();
     198                   }else if(data.astext == 'name-length'){
     199                    jQuery('.as-validname').hide();
     200                      jQuery('.as-alreadyexists').hide();
     201                      jQuery('.as-namelength').show();
    193202                      jQuery('.as-success').hide();
    194203                   }
     204
     205                 
    195206                   else{
    196207                    setTimeout(function(){
    197                     alert('Something went wrong. Please try again.');
     208                    alert(js_params.something_wrong_text);
    198209                        location.reload();
    199210                      }, 300);
     
    220231    });
    221232   
    222     // export / import ajax
    223 
    224     jQuery('#export_search').click(function() {
    225         var export_list = document.getElementsByName('wpas_export_form_list')[0];
    226         var export_forms_id = [];
    227         for(i=0; i < export_list.length; i++){
    228             if(export_list.options[i].selected){
    229                 export_forms_id.push(export_list.options[i].value);
    230             }
    231         }
    232 
    233         if(export_forms_id.length > 0) {
    234           var nonce = jQuery("#export_form_hidden").val();
    235           jQuery(".export_loader").css({'display':'inline-block'});
    236             jQuery.ajax({
    237                 url: ajaxurl, // domain/wp-admin/admin-ajax.php
    238                 type: "POST",
    239                 dataType: "json",
    240                 data: {
    241                     action: "WPAS_Advanced_Search_export",
    242                     security : nonce,
    243                     form_ids : export_forms_id
    244                 },
    245                 success: function(data) {
    246                     if(data.result == true) {
    247                         jQuery(".export_loader").css({'display':'none'});
    248                         jQuery("#export_data").html('').html(data.string);
    249                     }
    250                     if(data.result == false) {
    251                         jQuery(".export_loader").css({'display':'none'});
    252                         setTimeout(function(){
    253                             alert('Something went wrong. Please try again.');
    254                         location.reload();
    255                       }, 300);
    256                        
    257                     }
    258                 }
    259             });
    260 
    261         }
    262         else {
    263             alert('Please select form from export List !');
    264         }
    265 
    266     });
    267 
    268     // import form
    269 
    270     jQuery('#import_search').click(function() {
    271 
    272         var import_data = jQuery("#import_data").val();
    273 
    274         if(import_data == '') {
    275           alert('Please enter import data !');
    276           jQuery("#import_data").focus();
    277         }
    278         else {
    279         var nonce = jQuery("#import_form_hidden").val();
    280         jQuery(".import_loader").css({'display':'inline-block'});
    281         jQuery.ajax({
    282             url: ajaxurl, // domain/wp-admin/admin-ajax.php
    283             type: "POST",
    284             dataType: "json",
    285             data: {
    286                 action: "WPAS_Advanced_Search_import",
    287                 security : nonce,
    288                 import_data : import_data
    289             },
    290             success: function(data) {
    291                 if(data.result == 'true') {
    292                     jQuery(".import_loader").css({'display':'none'});
    293                     alert('Data Import successfully.');
    294                     location.reload(true);
    295                 }
    296                 if(data.result == 'false') {
    297                     setTimeout(function(){
    298                     alert('Something went wrong. Please try again.');
    299                     jQuery(".import_loader").css({'display':'none'});
    300                         location.reload();
    301                       }, 300);
    302                 }
    303             }
    304         });
    305       }
    306 
    307     });
     233 
    308234   
    309235    jQuery("input.restricted").keyup(function (e) {
     
    315241});
    316242
    317     // chart
    318 
    319 (function ($) {
    320   "use strict"; //You will be happier
    321 
    322   $.fn.horizBarChart = function( options ) {
    323 
    324     var settings = $.extend({
    325       // default settings
    326       selector: '.bar',
    327       speed: 3000
    328     }, options);
    329 
    330     // Cycle through all charts on page
    331       return this.each(function(){
    332         // Start highest number variable as 0
    333         // Nowhere to go but up!
    334       var highestNumber = 0;
    335 
    336       // Set highest number and use that as 100%
    337       // This will always make sure the graph is a decent size and all numbers are relative to each other
    338         $(this).find($(settings.selector)).each(function() {
    339           var num = $(this).data('number');
    340         if (num > highestNumber) {
    341           highestNumber = num;
    342         }
    343         });
    344 
    345       // Time to set the widths
    346         $(this).find($(settings.selector)).each(function() {
    347             var bar = $(this),
    348                 // get all the numbers
    349                 num = bar.data('number'),
    350                 // math to convert numbers to percentage and round to closest number (no decimal)
    351                 percentage = Math.round((num / highestNumber) * 100) + '%';
    352             // Time to assign and animate the bar widths
    353             $(this).animate({ 'width' : percentage }, settings.speed);
    354         });
    355       });
    356 
    357   }; // horizChart
    358 
    359 }(jQuery));
    360 
    361   // chart js
    362 
    363 jQuery(document).ready(function(){
    364   jQuery('.chart').horizBarChart({
    365     selector: '.bar',
    366     speed: 1000
    367   });
    368 });
    369 
    370 // loader and magifire icons active
    371 
    372 jQuery(document).ready(function() {
    373 
    374   // loader icon
    375 
    376   jQuery('.loader_lists li').click(function() {
    377     jQuery('.loader_lists li').removeClass('active');
    378     jQuery(this).addClass('active');
    379     var icon = jQuery(this).attr('data-icon');
    380     jQuery("#loader_icon").val(icon);
    381   });
    382 
    383   // maginfire icon
    384 
    385   jQuery('.magnifier_icon_design li').click(function() {
    386     jQuery('.magnifier_icon_design li').removeClass('active');
    387     jQuery(this).addClass('active');
    388     var icon = jQuery(this).attr('data-icon');
    389     jQuery("#magnifire_icon").val(icon);
    390   });
    391 });
    392243
    393244/*********** verify email popup *************/
     
    469320    success: function (response) {
    470321      if (response == '1') {
    471         alert('A confirmation link has been sent to your email address. Please click on the link to verify your email address.');
     322        alert(js_params.confirmation_text);
    472323      } else if (response == '2') {
    473324      }
  • advance-search/trunk/inc/admin/views/help-update.php

    r2597560 r2601509  
    1414  exit; // Exit if accessed directly
    1515}
    16 ?>
    17 
    18 <?php
    1916    include_once('wpas_popup.php');
    2017?>
     
    2421    <br/>
    2522    <div class="imp_link">
    26       <a class="back" href="<?php echo admin_url().'admin.php?page='.$this->plugin_name; ?>"><?php echo esc_attr__('Search list', $this->plugin_text_domain); ?></a>
    27       <a class="statistics" href="<?php echo admin_url().'admin.php?page=wpas-statistics' ?>"><?php echo esc_attr__('Search Statistics', $this->plugin_text_domain); ?></a>
     23      <a class="back" href="<?php echo esc_url( admin_url().'admin.php?page='.$this->plugin_name) ; ?>"><?php echo esc_attr__('Search list', $this->plugin_text_domain); ?></a>
     24      <a class="statistics" href="<?php echo esc_url(admin_url().'admin.php?page=wpas-statistics'); ?>"><?php echo esc_attr__('Search Statistics', $this->plugin_text_domain); ?></a>
    2825      <a class="go_pro_button" href="https://searchpro.ai/" target="_blank"><?php echo esc_attr__('Go Pro', $this->plugin_text_domain);?> <i class="fa fa-diamond" aria-hidden="true"></i></a>
    2926    </div>
     
    3633        <div class="column">
    3734    <h4><?php echo esc_attr__('Support', $this->plugin_text_domain);?></h4>
    38     <p><?php echo esc_attr__('If you didn\'t find the answer from the FAQ, or if you are having other issues, feel free to ', $this->plugin_text_domain); ?><a href="https://wordpress.org/support/plugin/advance-search/">open a support ticket.</a></p>
     35    <p><?php echo esc_attr__('If you didn\'t find the answer from the FAQ, or if you are having other issues, feel free to ', $this->plugin_text_domain); ?><a href="https://wordpress.org/support/plugin/advance-search/"><?php echo esc_attr__('open a support ticket.', $this->plugin_text_domain); ?></a></p>
    3936    </div>
    40     <!-- <div class="column">
    41     <h4><?php echo esc_attr__('Documentation', $this->plugin_text_domain);?></h4>
    42     <p><?php echo esc_attr__('Please check online ', $this->plugin_text_domain);?><a href="#"><?php echo esc_attr__('documentation', $this->plugin_text_domain);?></a>.</p>
    43    </div> -->
     37   
    4438    <div class="column">
    4539    <h4><?php echo esc_attr__('FAQ', $this->plugin_text_domain); ?></h4>
  • advance-search/trunk/inc/admin/views/html-advance-search-admin-options.php

    r2597560 r2601509  
    2222global $wpdb;
    2323$search_form_table = $wpdb->prefix."wpas_index";
    24 $search_form_setting = $wpdb->get_results($wpdb->prepare("SELECT * FROM $search_form_table where id=%d", $search_form_id));
     24$search_form_setting = $wpdb->get_row($wpdb->prepare("SELECT * FROM $search_form_table where id=%d", $search_form_id));
    2525
    2626if($search_form_id == 0 || $wpdb->num_rows == 0) {
     
    2929}
    3030
    31 $form_name = $search_form_setting[0]->name;
     31$form_name = $search_form_setting->name;
    3232
    3333if($wpdb->num_rows > 0) {
    3434
    35 $settings = json_decode($search_form_setting[0]->data, true);
     35$settings = json_decode($search_form_setting->data, true);
    3636
    3737$args = array(
    3838    'public' => true,
    39     //'_builtin' => false, //exclude attachment, revision etc.
     39   
    4040);
    4141$advance_search_excludeTaxonomy = array('product_shipping_class');
     
    4343$taxonomies_args = array(
    4444  'public'   => true,
    45   //'_builtin' => false
     45 
    4646);
    4747
     
    6969        <input type="hidden" name="action" value="wpas_search_form_settings">
    7070        <input type="hidden" name="wpas-search_setting" value="<?php echo wp_create_nonce('search_form_settings'); ?>" />
    71         <input type="hidden" name="search_form_setting[form_id]" value="<?php echo $search_form_id; ?>">
     71        <input type="hidden" name="search_form_setting[form_id]" value="<?php echo intval($search_form_id); ?>">
    7272
    7373    <div class="heading">
    7474        <h3><?php echo esc_html( get_admin_page_title() ); ?></h3>
    7575        <div class="imp_link">
    76             <a class="back" href="<?php echo admin_url().'admin.php?page='.$this->plugin_name; ?>"><?php echo esc_attr__('Back to the search list', $this->plugin_text_domain); ?></a>
    77             <a class="statistics" href="<?php echo admin_url().'admin.php?page=wpas-statistics' ?>"><?php echo esc_attr__('Search Statistics', $this->plugin_text_domain); ?></a>
     76            <a class="back" href="<?php echo esc_url(admin_url().'admin.php?page='.$this->plugin_name); ?>"><?php echo esc_attr__('Back to the search list', $this->plugin_text_domain); ?></a>
     77            <a class="statistics" href="<?php echo esc_url(admin_url().'admin.php?page=wpas-statistics'); ?>"><?php echo esc_attr__('Search Statistics', $this->plugin_text_domain); ?></a>
    7878            <a class="go_pro_button" href="https://searchpro.ai/" target="_blank"><?php echo esc_attr__('Go Pro ', $this->plugin_text_domain); ?> <i class="fa fa-diamond" aria-hidden="true"></i></a>
    7979        </div>
     
    9090                ?>
    9191                <div class="error notice is-dismissible">
    92                     <p><?php echo esc_attr__( 'You haven\'t made any changes in settings to be saved.', $this->plugin_text_domain ); ?><button type="button" id="ad_dismiss" class="notice-dismiss" data_url="<?php echo admin_url('admin.php?page=advance-search')."&wpas_id=".$wpas_id;?>"><span class="screen-reader-text"><?php echo esc_attr__( 'Dismiss this notice.', $this->plugin_text_domain ); ?></span></button></p>
     92                    <p><?php echo esc_attr__( 'You haven\'t made any changes in settings to be saved.', $this->plugin_text_domain ); ?><button type="button" id="ad_dismiss" class="notice-dismiss" data_url="<?php echo esc_url(admin_url('admin.php?page=advance-search')."&wpas_id=".$wpas_id);?>"><span class="screen-reader-text"><?php echo esc_attr__( 'Dismiss this notice.', $this->plugin_text_domain ); ?></span></button></p>
    9393                </div>
    9494                <?php
     
    9797                ?>
    9898                <div class="updated notice is-dismissible">
    99                     <p><?php echo esc_attr__( 'Settings updated successfully.', $this->plugin_text_domain ); ?><button type="button" id="ad_dismiss" class="notice-dismiss" data_url="<?php echo admin_url('admin.php?page=advance-search')."&wpas_id=".$wpas_id;?>"><span class="screen-reader-text"><?php echo esc_attr__( 'Dismiss this notice.', $this->plugin_text_domain ); ?></span></button></p>
     99                    <p><?php echo esc_attr__( 'Settings updated successfully.', $this->plugin_text_domain ); ?><button type="button" id="ad_dismiss" class="notice-dismiss" data_url="<?php echo esc_url(admin_url('admin.php?page=advance-search')."&wpas_id=".$wpas_id);?>"><span class="screen-reader-text"><?php echo esc_attr__( 'Dismiss this notice.', $this->plugin_text_domain ); ?></span></button></p>
    100100                </div>
    101101                <?php
     
    104104                ?>
    105105                <div class="updated notice is-dismissible">
    106                     <p><?php echo esc_attr__( 'Settings has been restored successfully.', $this->plugin_text_domain ); ?><button type="button" id="ad_dismiss" class="notice-dismiss" data_url="<?php echo admin_url('admin.php?page=advance-search')."&wpas_id=".$wpas_id;?>"><span class="screen-reader-text"><?php echo esc_attr__( 'Dismiss this notice.', $this->plugin_text_domain ); ?></span></button></p>
     106                    <p><?php echo esc_attr__( 'Settings has been restored successfully.', $this->plugin_text_domain ); ?><button type="button" id="ad_dismiss" class="notice-dismiss" data_url="<?php echo esc_url(admin_url('admin.php?page=advance-search')."&wpas_id=".$wpas_id);?>"><span class="screen-reader-text"><?php echo esc_attr__( 'Dismiss this notice.', $this->plugin_text_domain ); ?></span></button></p>
    107107                </div>
    108108                <?php
     
    113113        <ul class="accordion">
    114114          <li>
    115             <a class="toggle" href="#"><i class="fa fa-cogs" aria-hidden="true"></i> <?php echo esc_attr__('Shortcode for ', $this->plugin_text_domain); ?><b><?php echo $form_name; ?></b></a>
     115            <a class="toggle" href="#"><i class="fa fa-cogs" aria-hidden="true"></i> <?php echo esc_attr__('Shortcode for ', $this->plugin_text_domain); ?><b><?php echo esc_attr($form_name); ?></b></a>
    116116            <div class="inner shortcode_inputSec">
    117117                <h4 class="title_heading">
     
    119119                </h4>
    120120                <?php
    121                     $simple_shortcode_template = '<?php echo do_shortcode("[wpas id='.$search_form_id.' title=\''.$form_name.'\']"); ?>';
     121                    $simple_shortcode_template = '<?php echo do_shortcode("[wpas id='.intval($search_form_id).' title=\''.esc_attr($form_name).'\']"); ?>';
    122122                ?>
    123123              <div class="shortCol">
    124                 <label>Search Shortcode:</label>
    125                 <input type="text" value="[wpas id=<?php echo $search_form_id; ?>]" readonly="readonly">
     124                <label><?php echo esc_attr__( 'Search Shortcode:', $this->plugin_text_domain ); ?></label>
     125                <input type="text" value="[wpas id=<?php echo intval($search_form_id); ?>]" readonly="readonly">
    126126                </div>
    127127                 <div class="shortCol">
    128                 <label>Add title for Search:</label><br/>
    129                 <input type="text" value="[wpas id=<?php echo $search_form_id; ?> title='<?php echo $form_name; ?>']" readonly="readonly">
     128                <label><?php echo esc_attr__( 'Add title for Search:', $this->plugin_text_domain ); ?></label><br/>
     129                <input type="text" value="[wpas id=<?php echo intval($search_form_id); ?> title='<?php echo esc_attr($form_name); ?>']" readonly="readonly">
    130130                </div> 
    131                 <h4>Extra for php template use</h4>
     131                <h4><?php echo esc_attr__( 'Extra for php template use', $this->plugin_text_domain ); ?></h4>
    132132                <?php highlight_string($simple_shortcode_template); ?>
    133133            </div>
     
    245245            <?php
    246246
    247             if($taxonomies != '') {
     247            if( !empty($taxonomies) ) {
    248248
    249249                foreach ($taxonomies as $taxonomy) {
     
    602602                    <li>
    603603                    <div class="col_liStle"><span class="tooltip" title="Desktop"><i class="fa fa-desktop" aria-hidden="true"></i></span>
    604                     <input type="text" name="search_form_setting[styling][search_box_outer][width][desktop]" value="<?php echo $settings['styling']['search_box_outer']['width']['desktop']; ?>" class="restricted"/></div>
     604                    <input type="text" name="search_form_setting[styling][search_box_outer][width][desktop]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['width']['desktop']); ?>" class="restricted"/></div>
    605605                    </li>
    606606                   
    607                     <li><div class="col_liStle"><span class="tooltip" title="Tablet"><i class="fa fa-tablet" aria-hidden="true"></i></span><input type="text" name="search_form_setting[styling][search_box_outer][width][tablet]" value="<?php echo $settings['styling']['search_box_outer']['width']['tablet']; ?>" class="restricted"/></div></li>
     607                    <li><div class="col_liStle"><span class="tooltip" title="Tablet"><i class="fa fa-tablet" aria-hidden="true"></i></span><input type="text" name="search_form_setting[styling][search_box_outer][width][tablet]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['width']['tablet']); ?>" class="restricted"/></div></li>
    608608                   
    609                     <li><div class="col_liStle"><span class="tooltip" title="Mobile"><i class="fa fa-mobile" aria-hidden="true"></i></span><input type="text" name="search_form_setting[styling][search_box_outer][width][mobile]" value="<?php echo $settings['styling']['search_box_outer']['width']['mobile']; ?>" class="restricted"/></div></li>
     609                    <li><div class="col_liStle"><span class="tooltip" title="Mobile"><i class="fa fa-mobile" aria-hidden="true"></i></span><input type="text" name="search_form_setting[styling][search_box_outer][width][mobile]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['width']['mobile']); ?>" class="restricted"/></div></li>
    610610                   
    611611                    </ul>
     
    617617                        <li> 
    618618                            <div class="col_liStle">
    619                             <input type="text" minlength="2" name="search_form_setting[styling][search_box_outer][height]" value="<?php echo $settings['styling']['search_box_outer']['height']; ?>" class="restricted"/><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span>
     619                            <input type="text" minlength="2" name="search_form_setting[styling][search_box_outer][height]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['height']); ?>" class="restricted"/><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span>
    620620                            </div>
    621621                        </li>   
     
    628628                    <li>
    629629                        <div class="col_liStle"><i class="fa fa-arrow-up" aria-hidden="true" title="Top"></i>
    630                             <input type="number" name="search_form_setting[styling][search_box_outer][margin][top]" value="<?php echo $settings['styling']['search_box_outer']['margin']['top']; ?>" /><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
     630                            <input type="number" name="search_form_setting[styling][search_box_outer][margin][top]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['margin']['top']); ?>" /><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
    631631                    </li>
    632632                   
     
    638638                    <ul class="searchMBox">
    639639                        <li> 
    640                             <input type="text" class="wpas_color_field" name="search_form_setting[styling][search_box_outer][bg_color]" value="<?php echo $settings['styling']['search_box_outer']['bg_color']; ?>" />
     640                            <input type="text" class="wpas_color_field" name="search_form_setting[styling][search_box_outer][bg_color]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['bg_color']); ?>" />
    641641                        </li>
    642642                    </ul>
     
    654654                                if($value == $settings['styling']['search_box_outer']['border_type']) {
    655655                            ?>
    656                                 <option value="<?php echo $value; ?>" selected="selected"><?php echo esc_attr__($value, $this->plugin_text_domain); ?></option>
     656                                <option value="<?php echo esc_attr($value); ?>" selected="selected"><?php echo esc_attr__($value, $this->plugin_text_domain); ?></option>
    657657                            <?php
    658658                                }
    659659                                else {
    660660                                    ?>
    661                                 <option value="<?php echo $value; ?>"><?php echo esc_attr__($value, $this->plugin_text_domain); ?></option>
     661                                <option value="<?php echo esc_attr($value); ?>"><?php echo esc_attr__($value, $this->plugin_text_domain); ?></option>   
    662662                                    <?php
    663663                                }
     
    671671                    <div class="col_liStle hideBorder">
    672672                    <label><?php echo esc_attr__( 'Width:', $this->plugin_text_domain ); ?></label>
    673                      <input class="input_style" type="number" name="search_form_setting[styling][search_box_outer][border_px]" value="<?php echo $settings['styling']['search_box_outer']['border_px']; ?>"><span class="pxValue nwPxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span>
     673                     <input class="input_style" type="number" name="search_form_setting[styling][search_box_outer][border_px]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['border_px']); ?>"><span class="pxValue nwPxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span>
    674674                </div>
    675675                </li>
     
    678678                    <div class="col_liStle hideBorder">
    679679                    <label><?php echo esc_attr__( 'Border Color:', $this->plugin_text_domain ); ?></label>
    680                         <input type="text" name="search_form_setting[styling][search_box_outer][border_color]" class="wpas_color_field" value="<?php echo $settings['styling']['search_box_outer']['border_color']; ?>">
     680                        <input type="text" name="search_form_setting[styling][search_box_outer][border_color]" class="wpas_color_field" value="<?php echo esc_attr($settings['styling']['search_box_outer']['border_color']); ?>">
    681681                    </div>
    682682                      </li>
     
    685685                     <ul class="searchMBox newBoxSearch">
    686686                        <li>
    687                         <div class="col_liStle"><i class="fa fa-arrow-up" title="Top" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_box_outer][border_radius][top]" value="<?php echo $settings['styling']['search_box_outer']['border_radius']['top']; ?>" class="restricted"><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
     687                        <div class="col_liStle"><i class="fa fa-arrow-up" title="Top" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_box_outer][border_radius][top]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['border_radius']['top']); ?>" class="restricted"><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
    688688                    </li>
    689689                    <li>
    690                         <div  class="col_liStle"><i class="fa fa-arrow-right" title="Right" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_box_outer][border_radius][right]" value="<?php echo $settings['styling']['search_box_outer']['border_radius']['right']; ?>" class="restricted"><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
     690                        <div  class="col_liStle"><i class="fa fa-arrow-right" title="Right" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_box_outer][border_radius][right]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['border_radius']['right']); ?>" class="restricted"><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
    691691                    </li>
    692692                    <li>
    693                         <div  class="col_liStle"><i class="fa fa-arrow-down" title="Bottom" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_box_outer][border_radius][bottom]" value="<?php echo $settings['styling']['search_box_outer']['border_radius']['bottom']; ?>" class="restricted"><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
     693                        <div  class="col_liStle"><i class="fa fa-arrow-down" title="Bottom" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_box_outer][border_radius][bottom]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['border_radius']['bottom']); ?>" class="restricted"><span class="pxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
    694694                    </li>
    695695                    <li>
    696                     <div class="col_liStle"><i class="fa fa-arrow-left" title="Left" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_box_outer][border_radius][left]" value="<?php echo $settings['styling']['search_box_outer']['border_radius']['left']; ?>" class="restricted"><span class="pxValue">px</span></div>
     696                    <div class="col_liStle"><i class="fa fa-arrow-left" title="Left" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_box_outer][border_radius][left]" value="<?php echo esc_attr($settings['styling']['search_box_outer']['border_radius']['left']); ?>" class="restricted"><span class="pxValue">px</span></div>
    697697                    </li>
    698698                    </ul>
     
    712712              <div class="col_liStle">
    713713                <label><?php echo esc_attr__( 'Search Input Background Color:', $this->plugin_text_domain ); ?></label>
    714                 <input type="text" name="search_form_setting[styling][search_input][bg_color]" class="wpas_color_field" value="<?php echo $settings['styling']['search_input']['bg_color']; ?>">
     714                <input type="text" name="search_form_setting[styling][search_input][bg_color]" class="wpas_color_field" value="<?php echo esc_attr($settings['styling']['search_input']['bg_color']); ?>">
    715715              </div>
    716716            </li>
     
    723723              <li>
    724724              <div  class="col_liStle"><label><?php echo esc_attr__( 'Search Input Font Color :', $this->plugin_text_domain ); ?></label>
    725                 <input type="text" name="search_form_setting[styling][search_input][font_color]" class="wpas_color_field" value="<?php echo $settings['styling']['search_input']['font_color']; ?>"></div>
     725                <input type="text" name="search_form_setting[styling][search_input][font_color]" class="wpas_color_field" value="<?php echo esc_attr($settings['styling']['search_input']['font_color']); ?>"></div>
    726726              </li>
    727727              <li>
    728               <div  class="col_liStle"><label><?php echo esc_attr__( 'Font size:', $this->plugin_text_domain ); ?></label> <input class="restricted input_style" type="text" name="search_form_setting[styling][search_input][font_size]" value="<?php echo $settings['styling']['search_input']['font_size']; ?>" min="0"><span class="pxValue nwPxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
     728              <div  class="col_liStle"><label><?php echo esc_attr__( 'Font size:', $this->plugin_text_domain ); ?></label> <input class="restricted input_style" type="text" name="search_form_setting[styling][search_input][font_size]" value="<?php echo esc_attr($settings['styling']['search_input']['font_size']); ?>" min="0"><span class="pxValue nwPxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
    729729             </li>
    730730             <li>
    731               <div class="col_liStle"><label><?php echo esc_attr__( 'Line Height:', $this->plugin_text_domain ); ?></label> <input class="restricted input_style" type="text" name="search_form_setting[styling][search_input][line_height]" value="<?php echo $settings['styling']['search_input']['line_height']; ?>" min="0" ><span class="pxValue nwPxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
     731              <div class="col_liStle"><label><?php echo esc_attr__( 'Line Height:', $this->plugin_text_domain ); ?></label> <input class="restricted input_style" type="text" name="search_form_setting[styling][search_input][line_height]" value="<?php echo esc_attr($settings['styling']['search_input']['line_height']); ?>" min="0" ><span class="pxValue nwPxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span></div>
    732732            </li>
    733733             </ul>
     
    747747                                if($value == $settings['styling']['search_input']['border_type']) {
    748748                            ?>
    749                                 <option value="<?php echo $value; ?>" selected="selected"><?php echo esc_attr__($value, $this->plugin_text_domain); ?></option>
     749                                <option value="<?php echo esc_attr($value); ?>" selected="selected"><?php echo esc_attr__($value, $this->plugin_text_domain); ?></option>
    750750                            <?php
    751751                                }
    752752                                else {
    753753                                    ?>
    754                                 <option value="<?php echo $value; ?>"><?php echo esc_attr__($value, $this->plugin_text_domain); ?></option>
     754                                <option value="<?php echo esc_attr($value); ?>"><?php echo esc_attr__($value, $this->plugin_text_domain); ?></option>   
    755755                                    <?php
    756756                                }
     
    765765                    <div class="col_liStle hideBorder">
    766766                    <label><?php echo esc_attr__( 'Width: ', $this->plugin_text_domain ); ?></label>
    767                         <input type="number" class="input_style" name="search_form_setting[styling][search_input][border_px]" value="<?php echo $settings['styling']['search_input']['border_px']; ?>"><span class="pxValue nwPxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span>
     767                        <input type="number" class="input_style" name="search_form_setting[styling][search_input][border_px]" value="<?php echo esc_attr($settings['styling']['search_input']['border_px']); ?>"><span class="pxValue nwPxValue"><?php echo esc_attr__('px', $this->plugin_text_domain); ?></span>
    768768                    </div>
    769769                    </li>
     
    771771                    <li>
    772772                    <div class="col_liStle hideBorder">
    773                     <label><?php echo esc_attr__( 'Border Color:', $this->plugin_text_domain ); ?></label><input type="text" name="search_form_setting[styling][search_input][border_color]" class="wpas_color_field" value="<?php echo $settings['styling']['search_input']['border_color']; ?>">
     773                    <label><?php echo esc_attr__( 'Border Color:', $this->plugin_text_domain ); ?></label><input type="text" name="search_form_setting[styling][search_input][border_color]" class="wpas_color_field" value="<?php echo esc_attr($settings['styling']['search_input']['border_color']); ?>">
    774774                     </div>
    775775                    </li>
     
    780780                    <div class="col_liStle">
    781781                    <label><?php echo esc_attr__( 'Border Radius:', $this->plugin_text_domain ); ?></label>
    782                     <i class="fa fa-arrow-up" title="Top" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_input][border_radius][top]" value="<?php echo $settings['styling']['search_input']['border_radius']['top']; ?>" class="restricted"><span class="pxValue">px</span>
     782                    <i class="fa fa-arrow-up" title="Top" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_input][border_radius][top]" value="<?php echo esc_attr($settings['styling']['search_input']['border_radius']['top']); ?>" class="restricted"><span class="pxValue">px</span>
    783783                    </div>
    784784                    </li>
    785785                    <li>
    786                     <div class="col_liStle"><i class="fa fa-arrow-right" title="Right" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_input][border_radius][right]" value="<?php echo $settings['styling']['search_input']['border_radius']['right']; ?>" class="restricted"><span class="pxValue">px</span>
     786                    <div class="col_liStle"><i class="fa fa-arrow-right" title="Right" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_input][border_radius][right]" value="<?php echo esc_attr($settings['styling']['search_input']['border_radius']['right']); ?>" class="restricted"><span class="pxValue">px</span>
    787787                    </div>
    788788                    </li>
    789789                    <li>
    790790                    <div class="col_liStle">
    791                         <i class="fa fa-arrow-down" title="Bottom" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_input][border_radius][bottom]" value="<?php echo $settings['styling']['search_input']['border_radius']['bottom']; ?>" class="restricted"><span class="pxValue">px</span>
     791                        <i class="fa fa-arrow-down" title="Bottom" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_input][border_radius][bottom]" value="<?php echo esc_attr($settings['styling']['search_input']['border_radius']['bottom']); ?>" class="restricted"><span class="pxValue">px</span>
    792792                    </div>
    793793                    </li>
    794794                    <li>
    795795                    <div class="col_liStle">
    796                     <i class="fa fa-arrow-left" title="Left" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_input][border_radius][left]" value="<?php echo $settings['styling']['search_input']['border_radius']['left']; ?>" class="restricted"><span class="pxValue">px</span>
     796                    <i class="fa fa-arrow-left" title="Left" aria-hidden="true"></i><input type="text" name="search_form_setting[styling][search_input][border_radius][left]" value="<?php echo esc_attr($settings['styling']['search_input']['border_radius']['left']); ?>" class="restricted"><span class="pxValue">px</span>
    797797                    </div>
    798798                    </li>
     
    820820              <div class="col_liStle">
    821821                <label><?php echo esc_attr__( 'Magnifier Icon Color:', $this->plugin_text_domain ); ?></label>
    822                 <input type="text" name="search_form_setting[styling][magnifire][color]" value="<?php echo ($settings['styling']['magnifire']['color']) ? $settings['styling']['magnifire']['color'] : '#ffffff'; ?>" class="wpas_color_field">
     822                <input type="text" name="search_form_setting[styling][magnifire][color]" value="<?php echo ($settings['styling']['magnifire']['color']) ? esc_attr($settings['styling']['magnifire']['color']) : '#ffffff'; ?>" class="wpas_color_field">
    823823               
    824824               </div>
     
    827827                <div class="col_liStle">
    828828                    <label><?php echo esc_attr__( 'Magnifier Background Color:', $this->plugin_text_domain ); ?></label>
    829                     <input type="text" name="search_form_setting[styling][magnifire][bg_color]" value="<?php echo ($settings['styling']['magnifire']['bg_color']) ? $settings['styling']['magnifire']['bg_color'] : '#cccccc'; ?>" class="wpas_color_field">
     829                    <input type="text" name="search_form_setting[styling][magnifire][bg_color]" value="<?php echo ($settings['styling']['magnifire']['bg_color']) ? esc_attr($settings['styling']['magnifire']['bg_color'] ): '#cccccc'; ?>" class="wpas_color_field">
    830830               </div>
    831831             </li>
     
    857857</ul>
    858858</div>
    859 <label><?php echo esc_attr__( 'Loading Icon Color:', $this->plugin_text_domain ); ?></label> <input type="text" name="search_form_setting[styling][loader][color]" value="<?php echo ($settings['styling']['loader']['color']) ? $settings['styling']['loader']['color'] : '#ffffff'; ?>" class="wpas_color_field">
     859<label><?php echo esc_attr__( 'Loading Icon Color:', $this->plugin_text_domain ); ?></label> <input type="text" name="search_form_setting[styling][loader][color]" value="<?php echo ($settings['styling']['loader']['color']) ? esc_attr($settings['styling']['loader']['color']) : '#ffffff'; ?>" class="wpas_color_field">
    860860</div>
    861861
     
    873873                <fieldset>
    874874                <label><?php echo esc_attr__( 'Search Button Text:', $this->plugin_text_domain ); ?></label>
    875                  <input class="serach_input_style" type="text" name="search_form_setting[styling][search_button][text]" value="<?php echo ($settings['styling']['search_button']['text']) ? $settings['styling']['search_button']['text'] : 'Search'; ?>" />
     875                 <input class="serach_input_style" type="text" name="search_form_setting[styling][search_button][text]" value="<?php echo ($settings['styling']['search_button']['text']) ? esc_attr($settings['styling']['search_button']['text']) : 'Search'; ?>" />
    876876                </fieldset>
    877877                </li>
    878878                <li>
    879879                <label><?php echo esc_attr__( 'Search Text Color:', $this->plugin_text_domain ); ?></label>
    880                 <input type="text" name="search_form_setting[styling][search_button][font_color]" class="wpas_color_field" value="<?php echo ($settings['styling']['search_button']['font_color']) ? $settings['styling']['search_button']['font_color'] : '#000000'; ?>">
     880                <input type="text" name="search_form_setting[styling][search_button][font_color]" class="wpas_color_field" value="<?php echo ($settings['styling']['search_button']['font_color']) ? esc_attr($settings['styling']['search_button']['font_color']) : '#000000'; ?>">
    881881                 </li>
    882882                 </ul>
     
    908908                <fieldset>
    909909                <label><?php echo esc_attr__( 'Search Text Font Size:', $this->plugin_text_domain ); ?></label>
    910                 <input class="restricted input_style" type="text" name="search_form_setting[styling][search_button][font_size]" value="<?php echo $settings['styling']['search_button']['font_size']?>" />
     910                <input class="restricted input_style" type="text" name="search_form_setting[styling][search_button][font_size]" value="<?php echo esc_attr( $settings['styling']['search_button']['font_size']); ?>" />
    911911                <span class="pxValue nwPxValue"> <?php echo esc_attr__('px', $this->plugin_text_domain); ?></span>
    912912                </fieldset>
     
    956956    <div class="wpas_search_right">
    957957        <button class="button button-primary" type="submit"><?php echo esc_attr__('Save all changes', $this->plugin_text_domain); ?></button>
    958         <?php //submit_button( 'Save all changes', 'primary','submit', true ); ?>
     958       
    959959        </form>
    960960
     
    962962            <input type="hidden" name="action" value="wpas_search_form_settings">
    963963            <input type="hidden" name="search_setting_reset" value="<?php echo wp_create_nonce('reset_form_settings'); ?>" />
    964             <input type="hidden" name="search_form_id" value="<?php echo $search_form_id; ?>">
     964            <input type="hidden" name="search_form_id" value="<?php echo intval($search_form_id); ?>">
    965965            <button class="button button-secondary" type="submit"><?php echo esc_attr__('Restore defaults', $this->plugin_text_domain); ?></button>
    966966        </form>
  • advance-search/trunk/inc/admin/views/import-export.php

    r2597560 r2601509  
    2929    <br/>
    3030    <div class="imp_link">
    31       <a class="back" href="<?php echo admin_url().'admin.php?page='.$this->plugin_name; ?>"><?php echo esc_attr__('Search list', $this->plugin_text_domain); ?></a>
    32       <a class="statistics" href="<?php echo admin_url().'admin.php?page=wpas-statistics' ?>"><?php echo esc_attr__('Search Statistics', $this->plugin_text_domain); ?></a>
     31      <a class="back" href="<?php echo esc_url(admin_url().'admin.php?page='.$this->plugin_name); ?>"><?php echo esc_attr__('Search list', $this->plugin_text_domain); ?></a>
     32      <a class="statistics" href="<?php echo esc_url(admin_url().'admin.php?page=wpas-statistics');?>"><?php echo esc_attr__('Search Statistics', $this->plugin_text_domain); ?></a>
    3333      <a class="go_pro_button" href="https://searchpro.ai/" target="_blank"><?php echo esc_attr__('Go Pro', $this->plugin_text_domain); ?> <i class="fa fa-diamond" aria-hidden="true"></i></a>
    3434    </div>
     
    4242            </h4>
    4343        </div>
    44             <img class="import_export_demo" src="<?php echo plugins_url().'/'.$this->plugin_name; ?>/inc/admin/images/import-export.png">
     44            <img class="import_export_demo" src="<?php echo esc_url(plugins_url().'/'.$this->plugin_name); ?>/inc/admin/images/import-export.png">
    4545         </div>
    4646      </div>
  • advance-search/trunk/inc/admin/views/search-statistics.php

    r2597560 r2601509  
    2525    <h3><?php echo esc_html( get_admin_page_title() ); ?></h3>
    2626    <div class="imp_link">
    27       <a class="back" href="<?php echo admin_url().'admin.php?page='.$this->plugin_name; ?>"><?php echo esc_attr__('Search list', $this->plugin_text_domain); ?></a>
     27      <a class="back" href="<?php echo esc_url(admin_url().'admin.php?page='.$this->plugin_name); ?>"><?php echo esc_attr__('Search list', $this->plugin_text_domain); ?></a>
    2828      <a class="go_pro_button" href="https://searchpro.ai/" target="_blank"><?php echo esc_attr__('Go Pro', $this->plugin_text_domain); ?> <i class="fa fa-diamond" aria-hidden="true"></i></a>
    2929    </div>
     
    3737  <div class="buy_pro_wrapper">
    3838      <h4 class="title_heading">
    39         <?php echo esc_attr__('* This feature only for pro version', $this->plugin_text_domain ); ?><a href="https://searchpro.ai/" target="_blank">Buy Now</a>
     39        <?php echo esc_attr__('* This feature only for pro version', $this->plugin_text_domain ); ?><a href="https://searchpro.ai/" target="_blank"><?php echo esc_attr__('Buy Now', $this->plugin_text_domain ); ?></a>
    4040      </h4>
    4141  </div>
    42 
    43   <img class="statistics_demo" src="<?php echo plugins_url().'/'.$this->plugin_name; ?>/inc/admin/images/statistics.png">
    44 
     42  <img class="statistics_demo" src="<?php echo esc_url(plugins_url().'/'.$this->plugin_name); ?>/inc/admin/images/statistics.png">
    4543</div>
    46 
    4744</div>
    4845
  • advance-search/trunk/inc/admin/views/wpas-search.php

    r2597560 r2601509  
    1919$opt = get_option('wp_advance_search_settings');
    2020
    21 
     21wp_register_script( 'advance-search-wpas-js', '',);
     22wp_enqueue_script( 'advance-search-wpas-js' );
     23wp_add_inline_script(
     24    'advance-search-wpas-js', " var vle_nonce = '". wp_create_nonce('verify-wpas-email')."'"
     25);
    2226?>
    23 <script>
    24 var vle_nonce = "<?php echo wp_create_nonce('verify-wpas-email');?>";
    25 </script>
    26 <link rel='stylesheet' href="<?php echo plugins_url().'/'.$this->plugin_name; ?>/inc/admin/css/popup.css" type='text/css' media='all' />
     27
    2728
    2829<?php
     
    4344       
    4445        <div>
    45             <label for="<?php echo $this->plugin_text_domain; ?>-search_form"> <?php _e('Shortcode Name:', $this->plugin_text_domain); ?> </label>
    46             <input required maxlength="20" id="<?php echo $this->plugin_text_domain; ?>-search_form" type="text" name="<?php echo "wpas"; ?>[search_form_name]" value="" placeholder="<?php _e('Enter Shortcode Name', $this->plugin_text_domain);?>"<?php echo (count($search_forms) < 3) ? '' : ' readonly="readonly"' ;?>/>
     46            <label for="<?php echo esc_attr($this->plugin_text_domain); ?>-search_form"> <?php _e('Shortcode Name:', $this->plugin_text_domain); ?> </label>
     47            <input required maxlength="20" id="<?php echo  esc_attr($this->plugin_text_domain); ?>-search_form" type="text" name="<?php echo "wpas"; ?>[search_form_name]" value="" placeholder="<?php _e('Enter Shortcode Name', $this->plugin_text_domain);?>"<?php echo (count($search_forms) < 3) ? '' : ' readonly="readonly"' ;?>/>
    4748            <div class="submit"><input type="submit" name="submit" id="submit" class="<?php echo (count($search_forms) == 3) ? 'pointer-event-none' : '';?> btn-submit button button-primary" value="<?php _e('Create', $this->plugin_text_domain); ?>" <?php echo (count($search_forms) < 3) ? '' : ' ';?>/></div>
    4849            <?php if(count($search_forms) >= 3){ ?>
     
    5152            <?php if(isset($_GET['name-already-exists']) ){ ?>
    5253            <p class="pro-info">* <?php _e('This name is already exists.', $this->plugin_text_domain); ?></p>
     54            <?php }?>
     55
     56            <?php if(isset($_GET['name-maxlength']) ){ ?>
     57            <p class="pro-info">* <?php _e('Shortcode name length must not exceed 20 character.', $this->plugin_text_domain); ?></p>
    5358            <?php }?>
    5459        </div>
     
    7075                foreach ($search_forms as $search_form_name) {
    7176                    ?>
    72                     <option value="<?php echo $search_form_name->id; ?>" <?php if($default_search_form_id == $search_form_name->id) {echo 'selected="selected"'; } ?>><?php echo $search_form_name->name; ?></option>
     77                    <option value="<?php echo $search_form_name->id; ?>" <?php if($default_search_form_id == $search_form_name->id) {echo 'selected="selected"'; } ?>><?php echo esc_attr($search_form_name->name); ?></option>
    7378                    <?php
    7479                }
     
    8388            <?php }?>
    8489    </div>
    85         <p class="submit"><input type="submit" name="submit" id="replacesubmit" class="button button-primary" value="Save"></p>
     90        <p class="submit"><input type="submit" name="submit" id="replacesubmit" class="button button-primary" value="<?php _e('Save', $this->plugin_text_domain); ?>"></p>
    8691       
    8792    </form>
     
    108113                foreach ($search_forms as $search_form_name) {
    109114                    ?>
    110                     <option value="<?php echo $search_form_name->id; ?>" <?php if($default_woo_search_form_id == $search_form_name->id) {echo 'selected="selected"'; } ?>><?php echo $search_form_name->name; ?></option>
     115                    <option value="<?php echo intval($search_form_name->id); ?>" <?php if($default_woo_search_form_id == $search_form_name->id) {echo 'selected="selected"'; } ?>><?php echo esc_attr($search_form_name->name); ?></option>
    111116                    <?php
    112117                }
     
    115120        </select>
    116121    </div>
    117         <p class="submit"><input type="submit" name="submit" id="prosubmit" class="btn-submit button button-primary" value="Save"></p>
     122        <p class="submit"><input type="submit" name="submit" id="prosubmit" class="btn-submit button button-primary" value="<?php _e('Save', $this->plugin_text_domain); ?>"></p>
    118123    </form>
    119124</div>
     
    138143            <li>
    139144                <span class="num_style"><?php echo $i;?>.</span> <span class="content_style">
    140                 <?php echo $search_form_name->name;?></span><input type="text" class="quick_shortcode" value="[wpas id=<?php echo $search_form_name->id; ?>]" readonly="readonly">
     145                <?php echo esc_attr($search_form_name->name);?></span><input type="text" class="quick_shortcode" value="[wpas id=<?php echo intval($search_form_name->id); ?>]" readonly="readonly">
    141146                <span class="icons_sec">
    142                    <a href="<?php echo admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$search_form_name->id; ?>" title="Edit Settings"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a> | <a href="javascript:void(0)" data-targent="ClonePopup" data-id="<?php echo $search_form_name->id; ?>" data-scname="<?php echo $search_form_name->name; ?>" data-type="clone_search" class="asearch_imp_ajax aclone_search" id="aclonesearch" data-ajax='Yes' title="Clone Settings" data_url="<?php echo admin_url('admin.php?page=advance-search')?>"><i class="fa fa-clone" aria-hidden="true"></i></a>| <a href="javascript:void(0)" data-id="<?php echo $search_form_name->id; ?>" data-type="delete_search" data-ajax='No' class="search_imp_ajax delete_search" title="Delete Search"><i class="fa fa-trash" aria-hidden="true"></i></a>
     147                   <a href="<?php echo esc_url(admin_url().'admin.php?page='.$this->plugin_name.'&wpas_id='.$search_form_name->id); ?>" title="Edit Settings"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a> | <a href="javascript:void(0)" data-targent="ClonePopup" data-id="<?php echo intval($search_form_name->id); ?>" data-scname="<?php echo esc_attr($search_form_name->name); ?>" data-type="clone_search" class="asearch_imp_ajax aclone_search" id="aclonesearch" data-ajax='Yes' title="Clone Settings" data_url="<?php echo esc_url(admin_url('admin.php?page=advance-search'))?>"><i class="fa fa-clone" aria-hidden="true"></i></a>| <a href="javascript:void(0)" data-id="<?php echo intval($search_form_name->id); ?>" data-type="delete_search" data-ajax='No' class="search_imp_ajax delete_search" title="Delete Search"><i class="fa fa-trash" aria-hidden="true"></i></a>
    143148               </span>
    144149           </li>
     
    148153        }
    149154        else {
    150             echo "<p class='pl-10'>Oops! Shortcode(s) not found.<p>";
     155            $html = "<p class='pl-10'>";
     156            $html .= esc_attr__('Oops! Shortcode(s) not found.', $this->plugin_text_domain);
     157            $html .= "</p>";
     158            echo apply_filters('the_content',$html);
    151159        }
    152160    ?>
     
    176184
    177185</div>
    178 <div class="wpas_loader"><img src="<?php echo plugins_url().'/'.$this->plugin_name; ?>/inc/admin/images/loader3.gif" /></div>
    179 
    180 <style type="text/css">
    181 .pro_feature .buy_pro a {
    182     position: absolute;
    183     top: 50%;
    184     text-align: center;
    185     left: 50%;
    186     background-color: #ff3547 !important;
    187     color: #fff;
    188     text-decoration: none;
    189     padding: 6px 14px !important;
    190     transform: translate(-50%, -50%);
    191 }
    192 .pro_feature .buy_pro {
    193     height: 100%;
    194     top: 0;
    195     z-index: 99;
    196 }
    197 </style>
    198 
    199 <div class="popup_wrapper">
    200 
     186<div class="wpas_loader"><img src="<?php echo esc_url(plugins_url().'/'.$this->plugin_name); ?>/inc/admin/images/loader3.gif" /></div>
    201187<?php
    202         if (false === get_option('wpas_email_verified_'.$current_user->ID) && (false === (get_transient('wpas_cancel_lk_popup_'.$current_user->ID)))) {
    203         ?>
    204         <div id="lokhal_verify_email_popup" class="lokhal_verify_email_popup">
    205             <div class="lokhal_verify_email_popup_overlay"></div>
    206             <div class="lokhal_verify_email_popup_tbl">
    207                 <div class="lokhal_verify_email_popup_cel">
    208                     <div class="lokhal_verify_email_popup_content">
    209                         <a href="javascript:void(0)" class="lokhal_cancel"> <img src="<?php echo plugins_url('images/fm_close_icon.png', dirname(__FILE__)); ?>"
    210                                 class="wp_fm_loader" /></a>
    211                         <div class="popup_inner_lokhal">
    212                             <h3>
    213                                 <?php _e('Welcome to Advanced Search', 'advance-search'); ?>
    214                             </h3>
    215                             <p class="lokhal_desc">
    216                                 <?php _e('We love making new friends! Subscribe below and we promise to
    217     keep you up-to-date with our latest new plugins, updates,
    218     awesome deals and a few special offers.', 'advance-search'); ?>
    219                             </p>
    220                             <form>
    221                                 <div class="form_grp">
    222                                     <div class="form_twocol">
    223                                         <input name="verify_lokhal_fname" id="verify_lokhal_fname" class="regular-text"
    224                                             type="text" value="<?php echo (null == get_option('verify_wpas_fname_'.$current_user->ID)) ? $current_user->user_firstname : get_option('verify_wpas_fname_'.$current_user->ID); ?>"
    225                                             placeholder="First Name" maxlength="20"/>
    226                                         <span id="fname_error" class="error_msg">
    227                                             <?php _e('Please Enter First Name.', 'advance-search'); ?></span>
    228                                     </div>
    229                                     <div class="form_twocol">
    230                                         <input name="verify_lokhal_lname" id="verify_lokhal_lname" maxlength="20" class="regular-text"
    231                                             type="text" value="<?php echo (null ==
    232             get_option('verify_wpas_lname_'.$current_user->ID)) ? $current_user->user_lastname : get_option('verify_wpas_lname_'.$current_user->ID); ?>"
    233                                             placeholder="Last Name" />
    234                                         <span id="lname_error" class="error_msg">
    235                                             <?php _e('Please Enter Last Name.', 'advance-search'); ?></span>
    236                                     </div>
    237                                 </div>
    238                                 <div class="form_grp">
    239                                     <div class="form_onecol">
    240                                         <input name="verify_lokhal_email" id="verify_lokhal_email" class="regular-text"
    241                                             type="email" value="<?php echo (null == get_option('wpas_email_address_'.$current_user->ID)) ? $current_user->user_email : get_option('wpas_email_address_'.$current_user->ID); ?>"
    242                                             placeholder="Email Address" />
    243                                         <span id="email_error" class="error_msg">
    244                                             <?php _e('Please Enter Email Address.', 'advance-search'); ?></span>
    245                                             <span id="email_error_valid" class="error_msg"><?php _e('Please Enter Valid Email Address.', 'advance-search'); ?></span>
    246                                     </div>
    247                                 </div>
    248                                 <div class="btn_dv">
    249                                     <button class="verify verify_local_email button button-primary "><span class="btn-text"><?php _e('Verify', 'advance-search'); ?>
    250                                         </span>
    251                                         <span class="btn-text-icon">
    252                                             <img src="<?php echo plugins_url('images/btn-arrow-icon.png', dirname(__FILE__)); ?>" />
    253                                         </span></button>
    254                                     <button class="lokhal_cancel button">
    255                                         <?php _e('No Thanks', 'advance-search'); ?></button>
    256                                 </div>
    257                             </form>
    258                         </div>
    259                         <div class="fm_bot_links">
    260                             <a href="https://searchpro.ai/terms-condition/" target="_blank">
    261                                 <?php _e('Terms of Service', 'advance-search'); ?></a> <a href="https://searchpro.ai/privacy-policy/"
    262                                 target="_blank">
    263                                 <?php _e('Privacy Policy', 'advance-search'); ?></a>
    264                         </div>
    265 
    266                     </div>
    267                 </div>
    268             </div>
    269         </div>
    270 
    271         <?php
    272    } ///***** Verify Lokhal Popup End *****///?>
    273 
    274 </div>
    275 
     188    include_once('wpas_popup.php');
     189?>
    276190<div class="fm_msg_popup">
    277191    <div class="fm_msg_popup_tbl">
     
    290204    <div class="aspopup">
    291205        <div class="aspopup-header">
    292             <h2>Clone Shortcode: <span class="csname-heading"></span></h2>
     206            <h2><?php _e( 'Clone Shortcode:', $this->plugin_text_domain); ?> <span class="csname-heading"></span></h2>
    293207            <a class="close" href="javascript:void(0)">&times;</a>
    294208        </div>
     
    307221                 <div class="aspopup-form-area">
    308222               
    309                 <input required maxlength="20" id="<?php echo $this->plugin_text_domain; ?>-ajaxsearch_form" type="text" name="<?php echo "wpas"; ?>[search_form_name]" value="" placeholder="<?php _e('Enter Shortcode Name', $this->plugin_text_domain);?>"<?php echo (count($search_forms) < 3) ? '' : ' readonly="readonly"' ;?>/>
     223                <input required maxlength="20" id="<?php echo esc_attr($this->plugin_text_domain); ?>-ajaxsearch_form" type="text" name="<?php echo "wpas"; ?>[search_form_name]" value="" placeholder="<?php _e('Enter Shortcode Name', $this->plugin_text_domain);?>"<?php echo (count($search_forms) < 3) ? '' : ' readonly="readonly"' ;?>/>
    310224               
    311                 <input type="button" name="submit" id="clone_search" data-ajax='Yes' title="Clone Settings" data_url="<?php echo admin_url('admin.php?page=advance-search')?>" data-id="" data-type="clone_search" class="search_imp_ajax clone_search" value="<?php _e('Clone', $this->plugin_text_domain); ?>" <?php echo (count($search_forms) < 3) ? '' : ' ';?>/>
     225                <input type="button" name="submit" id="clone_search" data-ajax='Yes' title="<?php _e('Clone Settings', $this->plugin_text_domain); ?>" data_url="<?php echo esc_url(admin_url('admin.php?page=advance-search'))?>" data-id="" data-type="clone_search" class="search_imp_ajax clone_search" value="<?php _e('Clone', $this->plugin_text_domain); ?>" <?php echo (count($search_forms) < 3) ? '' : ' ';?>/>
    312226                </div>
    313227
    314228               <?php }?>
    315229                <p class="pro-info as-alreadyexists" style="display:none">* <?php _e('This name is already exists.', $this->plugin_text_domain); ?></p>
     230                <p class="pro-info as-namelength" style="display:none">* <?php _e('Name must not exceed 20 character..', $this->plugin_text_domain); ?></p>
    316231                <p class="pro-info as-validname" style="display:none">* <?php _e('Please enter Shortcode Name.', $this->plugin_text_domain); ?></p>
    317232                <p class="pro-infoq as-success" style="display:none"><?php _e('Shortcode Successfully created.', $this->plugin_text_domain); ?></p>
  • advance-search/trunk/inc/admin/views/wpas_popup.php

    r2597560 r2601509  
    66
    77$current_user = wp_get_current_user();
    8 
    9 ?>
    10 
    11 <script>
    12 var vle_nonce = "<?php echo wp_create_nonce('verify-wpas-email');?>";
    13 </script>
    14 <link rel='stylesheet' href="<?php echo plugins_url().'/'.$this->plugin_name; ?>/inc/admin/css/popup.css" type='text/css' media='all' />
    15 
    16 
     8wp_register_script( 'advance-search-inlinepopup-js', '',);
     9wp_enqueue_script( 'advance-search-inlinepopup-js' );
     10wp_add_inline_script(
     11    'advance-search-inlinepopup-js', 'var vle_nonce = "'. wp_create_nonce("verify-wpas-email").'"'
     12); ?>
    1713<div class="popup_wrapper">
    18 
    1914<?php
    2015    if (false === get_option('wpas_email_verified_'.$current_user->ID) && (false === (get_transient('wpas_cancel_lk_popup_'.$current_user->ID)))) {
     
    2520                <div class="lokhal_verify_email_popup_cel">
    2621                    <div class="lokhal_verify_email_popup_content">
    27                         <a href="javascript:void(0)" class="lokhal_cancel"> <img src="<?php echo plugins_url('images/fm_close_icon.png', dirname(__FILE__)); ?>"
     22                        <a href="javascript:void(0)" class="lokhal_cancel"> <img src="<?php echo esc_url(plugins_url('images/fm_close_icon.png', dirname(__FILE__))); ?>"
    2823                                class="wp_fm_loader" /></a>
    2924                        <div class="popup_inner_lokhal">
     
    3227                            </h3>
    3328                            <p class="lokhal_desc">
    34                                 <?php _e('We love making new friends! Subscribe below and we promise to
    35     keep you up-to-date with our latest new plugins, updates,
    36     awesome deals and a few special offers.', 'advance-search'); ?>
     29                                <?php _e('We love making new friends! Subscribe below and we promise to keep you up-to-date with our latest new plugins, updates, awesome deals and a few special offers.', 'advance-search'); ?>
    3730                            </p>
    3831                            <form>
     
    4033                                    <div class="form_twocol">
    4134                                        <input name="verify_lokhal_fname" id="verify_lokhal_fname" class="regular-text"
    42                                             type="text" value="<?php echo (null == get_option('verify_wpas_fname_'.$current_user->ID)) ? $current_user->user_firstname : get_option('verify_wpas_fname_'.$current_user->ID); ?>"
    43                                             placeholder="First Name" maxlength="20"/>
     35                                            type="text" value="<?php echo (null == get_option('verify_wpas_fname_'.$current_user->ID)) ? esc_attr($current_user->user_firstname) : get_option('verify_wpas_fname_'.$current_user->ID); ?>"
     36                                            placeholder="<?php _e('First Name', 'advance-search'); ?> " maxlength="20"/>
    4437                                        <span id="fname_error" class="error_msg">
    4538                                            <?php _e('Please Enter First Name.', 'advance-search'); ?></span>
     
    4841                                        <input name="verify_lokhal_lname" id="verify_lokhal_lname" maxlength="20" class="regular-text"
    4942                                            type="text" value="<?php echo (null ==
    50             get_option('verify_wpas_lname_'.$current_user->ID)) ? $current_user->user_lastname : get_option('verify_wpas_lname_'.$current_user->ID); ?>"
    51                                             placeholder="Last Name" />
     43            get_option('verify_wpas_lname_'.$current_user->ID)) ? esc_attr($current_user->user_lastname) : get_option('verify_wpas_lname_'.$current_user->ID); ?>"
     44                                            placeholder="<?php _e('Last Name', 'advance-search'); ?>" />
    5245                                        <span id="lname_error" class="error_msg">
    5346                                            <?php _e('Please Enter Last Name.', 'advance-search'); ?></span>
     
    5750                                    <div class="form_onecol">
    5851                                        <input name="verify_lokhal_email" id="verify_lokhal_email" class="regular-text"
    59                                             type="email" value="<?php echo (null == get_option('wpas_email_address_'.$current_user->ID)) ? $current_user->user_email : get_option('wpas_email_address_'.$current_user->ID); ?>"
    60                                             placeholder="Email Address" />
     52                                            type="email" value="<?php echo (null == get_option('wpas_email_address_'.$current_user->ID)) ? esc_attr($current_user->user_email) : get_option('wpas_email_address_'.$current_user->ID); ?>"
     53                                            placeholder="<?php _e('Email Address', 'advance-search'); ?>" />
    6154                                        <span id="email_error" class="error_msg">
    6255                                            <?php _e('Please Enter Email Address.', 'advance-search'); ?></span>
     
    6861                                        </span>
    6962                                        <span class="btn-text-icon">
    70                                             <img src="<?php echo plugins_url('images/btn-arrow-icon.png', dirname(__FILE__)); ?>" />
     63                                            <img src="<?php echo esc_attr(plugins_url('images/btn-arrow-icon.png', dirname(__FILE__))); ?>" />
    7164                                        </span></button>
    7265                                    <button class="lokhal_cancel button">
  • advance-search/trunk/inc/common/class-common.php

    r2597560 r2601509  
    124124            $search_form_table = $wpdb->prefix."wpas_index";
    125125
    126             $search_form_settings = $wpdb->get_results($wpdb->prepare("SELECT data FROM $search_form_table where id=%d", $form_id));
     126            $search_form_settings = $wpdb->get_row($wpdb->prepare("SELECT data FROM $search_form_table where id=%d", $form_id));
    127127           
    128128            if($wpdb->num_rows > 0) {
    129129
    130                 $search_form_settings = json_decode($search_form_settings[0]->data, true);
     130                $search_form_settings = json_decode($search_form_settings->data, true);
    131131                $t_data = array();
    132132
     
    140140                    // check if enable any specific title or content in search areas
    141141
    142                     if(array_key_exists('search_areas', $search_form_settings['post_types'])) {
     142                    if(array_key_exists('search_areas', $search_form_settings['post_types']) && !empty($search_form_settings['post_types']['search_areas'])) {
    143143                        $search_columns = implode(',', $search_form_settings['post_types']['search_areas']);
    144144
     
    159159                    // check if meta keys added
    160160                    $join = '';
    161                     $where = '';
    162                     $post_meta_keys = $search_form_settings['post_types']['meta_keys']['0'];
    163                     if($post_meta_keys != '') {
     161                    $where = "AND post_status='publish'";
     162                    $post_meta_keys = isset($search_form_settings['post_types']['meta_keys']['0']) ? $search_form_settings['post_types']['meta_keys']['0'] : '';
     163                    if(!empty($post_meta_keys)) {
    164164                       
    165165                        $post_meta_keys_array = explode(',',$post_meta_keys);
     
    169169                            foreach($post_meta_keys_array as $meta_key) {
    170170
    171                                 $join .= 'INNER JOIN '.$postmeta_table.' m'.$m.' ON ('.$wp_posts_table.'.ID = m'.$m.'.post_id) ';
     171                                $join .= 'INNER JOIN '.$postmeta_table.' m'.$m.' ON ('.$wp_posts_table.'.ID = m'.$m.'.post_id AND '.$wp_posts_table.'.post_status="publish") ';
    172172                                $where .= " OR ( m".$m.".meta_key = '$meta_key' AND m".$m.".meta_value like '%$s%') ";
    173173
     
    180180                    // check search type
    181181                   
    182                     if($search_type == 'full_word' || $search_type == '') {
    183                         $post_page_query = "SELECT ID, post_title, post_type, post_content, post_status FROM $wp_posts_table $join WHERE post_type IN($post_types) AND MATCH ($search_columns) AGAINST ('$s' IN BOOLEAN MODE) $where AND post_status='publish' GROUP BY ID";
     182                    if($search_type == 'full_word' || empty($search_type) ) {
     183                        $post_page_query = "SELECT ID, post_title, post_type, post_content, post_status FROM $wp_posts_table $join WHERE post_type IN($post_types) AND MATCH ($search_columns) AGAINST ('$s' IN BOOLEAN MODE) $where GROUP BY ID";
    184184                   
    185185                    }
    186186                    else {
    187                         $post_page_query = "SELECT ID, post_title, post_type, post_content, post_status FROM $wp_posts_table $join WHERE post_type IN($post_types) AND ($like) $where AND post_status = 'publish' GROUP By ID";
     187                        $post_page_query = "SELECT ID, post_title, post_type, post_content, post_status FROM $wp_posts_table $join WHERE post_type IN($post_types) AND ($like) $where GROUP By ID";   
    188188                    }
    189189
     
    205205                // custom taxonomies search
    206206
    207                 if(isset($search_form_settings['taxonomies']) && array_key_exists('taxonomies', $search_form_settings['taxonomies'])) {
    208 
     207                if(isset($search_form_settings['taxonomies']) && array_key_exists('taxonomies', $search_form_settings['taxonomies']) && !empty($search_form_settings['taxonomies']['taxonomies']  )) {
    209208               
    210                 $args = array(
    211                     'taxonomy'      => $search_form_settings['taxonomies']['taxonomies'], // taxonomy name
    212                     'orderby'       => 'id',
    213                     'order'         => 'ASC',
    214                     'fields'        => 'all',
    215                     'name__like'    => $s
    216                 );
    217 
    218                 // description search
    219 
    220                 $args_description = array(
    221                     'taxonomy'      => $search_form_settings['taxonomies']['taxonomies'], // taxonomy name
    222                     'orderby'       => 'id',
    223                     'order'         => 'ASC',
    224                     'fields'        => 'all',
    225                     'description__like' => $s
    226                 );
    227 
    228                 $terms_result = array();
    229 
    230                 // check if enable any specific title or content in search areas
    231 
    232                 if(array_key_exists('search_areas', $search_form_settings['taxonomies'])) {
     209                    $args = array(
     210                        'taxonomy'      => $search_form_settings['taxonomies']['taxonomies'], // taxonomy name
     211                        'orderby'       => 'id',
     212                        'order'         => 'ASC',
     213                        'fields'        => 'all',
     214                        'name__like'    => $s
     215                    );
     216
     217                    // description search
     218                    $args_description = array(
     219                        'taxonomy'      => $search_form_settings['taxonomies']['taxonomies'], // taxonomy name
     220                        'orderby'       => 'id',
     221                        'order'         => 'ASC',
     222                        'fields'        => 'all',
     223                        'description__like' => $s
     224                    );
     225
     226                    $terms_result = array();
     227
     228                    // check if enable any specific title or content in search areas
     229
     230                    if(array_key_exists('search_areas', $search_form_settings['taxonomies']) && (isset($search_form_settings['taxonomies']['search_areas']['content']) || isset($search_form_settings['taxonomies']['search_areas']['title']) )) {
    233231                   
    234                     if(array_key_exists('title', $search_form_settings['taxonomies']['search_areas']) && !isset($search_form_settings['taxonomies']['search_areas']['content'])) {
    235 
    236                         $terms_result = get_terms( $args );
    237 
    238                     } if(array_key_exists('content', $search_form_settings['taxonomies']['search_areas']) && !isset($search_form_settings['taxonomies']['search_areas']['title'])) {
    239 
    240                         $terms_result = get_terms( $args_description );
    241 
    242                     } if(isset($search_form_settings['taxonomies']['search_areas']['title']) && isset($search_form_settings['taxonomies']['search_areas']['content'])) {
    243 
     232                        if(array_key_exists('title', $search_form_settings['taxonomies']['search_areas']) && !isset($search_form_settings['taxonomies']['search_areas']['content'])) {
     233                            $terms_result = get_terms( $args );
     234
     235                        } if(array_key_exists('content', $search_form_settings['taxonomies']['search_areas']) && !isset($search_form_settings['taxonomies']['search_areas']['title'])) {
     236                            $terms_result = get_terms( $args_description );
     237
     238                        } if(isset($search_form_settings['taxonomies']['search_areas']['title']) && isset($search_form_settings['taxonomies']['search_areas']['content'])) {
     239                            $terms = get_terms( $args );
     240                            $terms1 = get_terms( $args_description );
     241                            $terms_m = array_merge($terms, $terms1);
     242                            $terms_result = array_unique($terms_m, SORT_REGULAR);
     243                        }
     244
     245                    } else {
     246                   
    244247                        $terms = get_terms( $args );
    245                         $terms1 = get_terms( $args_description );
    246                         $terms_m = array_merge($terms, $terms1);
    247                         $terms_result = array_unique($terms_m, SORT_REGULAR);
    248                     }
    249 
    250                 } else {
    251 
    252                     $terms = get_terms( $args );
    253                     $terms1 = get_terms( $args_description);
    254                     $terms_merge = array_merge($terms, $terms1);
    255                     $terms_result = array_unique($terms_merge, SORT_REGULAR);
    256 
    257                 }
     248                        $terms1 = get_terms( $args_description);
     249                        $terms_merge = array_merge($terms, $terms1);
     250                        $terms_result = array_unique($terms_merge, SORT_REGULAR);
     251
     252                    }
     253               
    258254                    $count = count($terms_result);
    259255           
     
    268264                // attachments search
    269265
    270                 if(array_key_exists('attachments', $search_form_settings)) {
     266                if(array_key_exists('attachments', $search_form_settings) && !empty($search_form_settings['attachments'])) {
    271267                    $attachments_mime_type = '"'.implode('","', $search_form_settings['attachments']).'"';
    272 
    273                     $wp_post_attachments_data = array('');
    274 
     268                    $wp_post_attachments_data = array();
    275269                    if(in_array('image/jpeg', $search_form_settings['attachments']) || in_array('image/gif', $search_form_settings['attachments']) || in_array('image/png', $search_form_settings['attachments'])) {
    276270
    277271                    // check search type
    278 
    279                     if($search_type == '' || $search_type == 'full_word') {
     272                   
     273                    if( empty($search_type) || $search_type == 'full_word') {
    280274                        $wp_post_attachment_query = "SELECT ID, post_title, post_content, post_type, guid, post_mime_type FROM $wp_posts_table WHERE post_mime_type IN ($attachments_mime_type) AND MATCH (post_title, post_content) AGAINST ('$s' IN NATURAL LANGUAGE MODE) GROUP BY ID";
    281275                    }
     
    284278                    }
    285279
    286                
    287280                    $wp_post_attachments_data = $wpdb->get_results($wp_post_attachment_query);
    288281
     
    290283
    291284                    $attachments_data = $wp_post_attachments_data;
    292 
    293285                    if(!empty($attachments_data)) {
    294286                        foreach ($attachments_data as $attach_final) {
     
    316308                $final_data['form_id'] = $form_id;
    317309                $final_data['html'] = $html;
    318 
    319310                // Echo the response to the AJAX request.
    320311                wp_send_json($final_data);
    321                 // wp_send_json will also die().
    322 
     312               
    323313            }
    324314        }
     
    383373        $custom_title = sanitize_text_field(htmlentities($setting['title']));
    384374       
    385         $search_forms = $wpdb->get_results($wpdb->prepare("SELECT id, name, data FROM $search_form_table where id=%d",$form_id));
     375        $search_forms = $wpdb->get_row($wpdb->prepare("SELECT id, name, data FROM $search_form_table where id=%d",$form_id));
    386376
    387377        if($wpdb->num_rows > 0) {
    388             $form_title = $search_forms[0]->name;
    389             $form_setting = json_decode($search_forms[0]->data, true);
    390 
    391             if(array_key_exists('voice_search', $form_setting) && strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false) {
    392                 $in_name = esc_attr( $this->plugin_name ).'_voice';
    393             }
    394             else {
    395                 $in_name = esc_attr( $this->plugin_name ).'_'.$form_id;
    396             }
    397 
     378            $form_title = $search_forms->name;
     379            $form_setting = json_decode($search_forms->data, true);
     380            $in_name = esc_attr( $this->plugin_name ).'_'.$form_id;
    398381            $loader_icon = 'sbl-circ';
    399382            $magnifire_icon = 'search';
    400             $button_icon_position = $form_setting['styling']['magnifire']['position'];
    401             $button_text = $form_setting['styling']['search_button']['text'];
    402 
    403             $show_submit_button_text = $form_setting['styling']['search_button']['show_search_text'];
    404             $show_magnifire_icon = $form_setting['styling']['search_button']['show_maginfier_icon'];
     383            $button_icon_position = sanitize_text_field($form_setting['styling']['magnifire']['position']);
     384            $button_text = sanitize_text_field($form_setting['styling']['search_button']['text']);
     385
     386            $show_submit_button_text = sanitize_text_field($form_setting['styling']['search_button']['show_search_text']);
     387            $show_magnifire_icon = sanitize_text_field($form_setting['styling']['search_button']['show_maginfier_icon']);
    405388            $submit_button_text = '';
    406             if(isset($show_submit_button_text) && $show_submit_button_text != '') {
    407                 $submit_button_text = '<div class="button_text_holder">'.esc_attr__($button_text, $this->plugin_text_domain).'</div>';
    408             }
    409             else {
    410                 $submit_button_text = '';
     389            if(isset($show_submit_button_text) && !empty($show_submit_button_text) ) {
     390                $submit_button_text = '<div class="button_text_holder">'.esc_attr($button_text).'</div>';
    411391            }
    412392
    413393            $magnifire_icon_show = '';
    414             if(isset($show_magnifire_icon) && $show_magnifire_icon != '') {
     394            if(isset($show_magnifire_icon) && !empty($show_magnifire_icon )) {
    415395                $magnifire_icon_show = '<i class="fa fa-'.$magnifire_icon.'"></i>';
    416             }
    417             else {
    418                 $magnifire_icon_show = '';
    419396            }
    420397           
    421398            $title = '';
    422399
    423             if($custom_title != '') {
    424                 $title = '<h3>'.esc_attr__($custom_title, $this->plugin_text_domain).'</h3>';
     400            if( !empty($custom_title )) {
     401                $title = '<h3>'.esc_attr($custom_title).'</h3>';
    425402            }
    426403
     
    432409        <div class="input_cont '.$button_icon_position.'">
    433410            <div class="wpas_input_container" id="wpas_input_container_'.$form_id.'">
    434                 <div class="input_box"><input required class="wpas_search_input" id="wpas_search_input_'.$form_id.'" type="search" placeholder="Search here..." name="'.$in_name.'" data-formid="'.$form_id.'" />
     411                <div class="input_box"><input required class="wpas_search_input" id="wpas_search_input_'.$form_id.'" type="search" placeholder="'. __("Search here...", $this->plugin_text_domain ).'" name="'.$in_name.'" data-formid="'.$form_id.'" />
    435412                </label>
    436413                <div class="wpas_search_loader_icon" style="display:none;"><div class="'.$loader_icon.'"></div></div>
     
    451428
    452429        }else {
    453             $form .= "<p class='alert alert-danger'>Search form not found !</p>";
     430            $form .= "<p class='alert alert-danger'>". esc_attr__('Search form not found !', $this->plugin_text_domain)."</p>";
    454431        }
    455432
     
    544521                $search_button_font_color = $search_button_settings['font_color'];
    545522               
    546     ?>
    547         <style>
    548        
    549            .wpas_form_container_<?php echo $search_form->id; ?> {
    550                 width: <?php echo $desktop_box_width; ?>;
    551                 max-width: <?php echo $desktop_box_width; ?>;
    552                 background-color: <?php echo $search_box_bg_color; ?>;
    553                 padding: <?php echo $search_box_padding; ?>;
    554                 border: <?php echo $search_box_border; ?>;
    555                 border-radius: <?php echo $search_box_border_radius; ?>;
     523            wp_register_style( 'advance-search-commonform-css', false );
     524            wp_enqueue_style( 'advance-search-commonform-css' );
     525            wp_add_inline_style(
     526                'advance-search-commonform-css',
     527           '.wpas_form_container_'.esc_attr($search_form->id).' {
     528                width: '.esc_attr($desktop_box_width).';
     529                max-width: '.esc_attr($desktop_box_width).';
     530                background-color: '.esc_attr($search_box_bg_color).';
     531                padding: '.esc_attr($search_box_padding).';
     532                border: '. esc_attr($search_box_border).';
     533                border-radius: '.esc_attr($search_box_border_radius).';
    556534               
    557535           }
    558            .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_input_container{
    559                 width: <?php echo $desktop_box_width; ?>;
    560                 max-width: <?php echo $desktop_box_width; ?>;
    561                 height: <?php echo $search_box_height; ?>px;
     536           .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_input_container{
     537                width: '.esc_attr($desktop_box_width).';
     538                max-width: '. esc_attr($desktop_box_width).';
     539                height: '.esc_attr( $search_box_height).'px;
    562540                overflow:hidden;
    563541                position: relative;
    564542           }
    565            .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper form {
     543           .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper form {
    566544            margin: 0px;
    567545            height:100%;
     
    569547            display: block;
    570548           }
    571            .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper form .input_cont {
     549           .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper form .input_cont {
    572550              width: 100%;
    573551              display: flex;
    574552           }
    575            .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper form .input_cont.left{
     553           .wpas_form_container_'. esc_attr($search_form->id).' .wpas_wrapper form .input_cont.left{
    576554            flex-direction: row-reverse;
    577555           }
     
    597575                text-decoration: none;
    598576            }
    599             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .input_box{
     577            .wpas_form_container_'.esc_attr( $search_form->id).' .wpas_wrapper .input_box{
    600578                width:100%;
    601579                float: left;
    602580                position: relative;
    603581            }
    604            .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper input[type=search] {
    605             font-size:<?php echo $search_input_font_size; ?>;
     582           .wpas_form_container_'.esc_attr( $search_form->id).' .wpas_wrapper input[type=search] {
     583            font-size:'.esc_attr($search_input_font_size).';
    606584            padding: 5px;
    607             height: <?php echo $search_box_height; ?>px;
    608             border: <?php echo $search_input_border; ?>;
    609             border-radius: <?php echo $search_input_border_radius; ?>;
    610             line-height: <?php echo $search_input_line_height; ?>;
    611             background-color: <?php echo $search_input_bg_color; ?>;
    612             color: <?php echo $search_input_font_color; ?> !important;
     585            height: '.esc_attr($search_box_height).'px;
     586            border: '.esc_attr($search_input_border).';
     587            border-radius: '.esc_attr($search_input_border_radius).';
     588            line-height: '.esc_attr($search_input_line_height).';
     589            background-color: '.esc_attr($search_input_bg_color).';
     590            color: '.esc_attr($search_input_font_color).' !important;
    613591            float: left;
    614592            width:100%;
     
    617595           
    618596           }
    619            .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper input[type=search]:focus {
     597           .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper input[type=search]:focus {
    620598                outline: none !important;
    621599            }
    622            .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper input[type=search]::-webkit-input-placeholder {
    623             color: <?php echo $search_input_font_color; ?> !important;
     600           .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper input[type=search]::-webkit-input-placeholder {
     601            color: '.esc_attr($search_input_font_color).' !important;
    624602           }
    625603
    626             .wpas_form_container_<?php echo $search_form->id; ?> .voice-search-wrapper.wpas_voice_search .wpas_search_loader_icon, .wpas_form_container_<?php echo $search_form->id; ?> .voice-search-wrapper.wpas_voice_search .wpas_search_close {
     604            .wpas_form_container_'.esc_attr($search_form->id).' .voice-search-wrapper.wpas_voice_search .wpas_search_loader_icon, .wpas_form_container_'. esc_attr($search_form->id).' .voice-search-wrapper.wpas_voice_search .wpas_search_close {
    627605                right: 35px;
    628606            }
    629             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_input_container .input_box .voice-search-button {
     607            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_input_container .input_box .voice-search-button {
    630608                right: 0px !important;
    631609            }
    632610
    633611         
    634             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_submit_wrapper {
     612            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_submit_wrapper {
    635613                width:auto;
    636614                height:100%;
    637615                float: right;
    638616            }
    639             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_submit_wrapper .wpas_margnifire_icon{
    640                 background:<?php echo $magnifire_icon_bg_color; ?>;
    641                 height: <?php echo $search_box_height; ?>px;
     617            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_submit_wrapper .wpas_margnifire_icon{
     618                background:'.esc_attr($magnifire_icon_bg_color).';
     619                height: '.esc_attr($search_box_height).'px;
    642620                transform: translate(0px, 0px);
    643                 line-height: <?php echo $search_box_height; ?>px;
     621                line-height: '.esc_attr($search_box_height).'px;
    644622                text-align: center;
    645623                padding: 0 12px;
     
    650628                white-space: nowrap;
    651629            }
    652             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_submit_wrapper .wpas_margnifire_icon span.text_search{
     630            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_submit_wrapper .wpas_margnifire_icon span.text_search{
    653631                padding-right: 5px;
    654632            }
    655             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_submit_wrapper .wpas_margnifire_icon .new_icon_div{
     633            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_submit_wrapper .wpas_margnifire_icon .new_icon_div{
    656634                 position: absolute;
    657635                 top:50%;
     
    663641                  padding:0px 10px;
    664642            }
    665             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_submit_wrapper .wpas_margnifire_icon i.fa {
    666                 color: <?php echo $magnifire_icon_color; ?>;
    667                 font-size:<?php echo $search_button_font_size; ?>;
     643            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_submit_wrapper .wpas_margnifire_icon i.fa {
     644                color: '.esc_attr($magnifire_icon_color).';
     645                font-size:'.esc_attr($search_button_font_size).';
    668646                display: inline-block;
    669647            }
    670648
    671             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_submit_wrapper .button_text_holder {
    672                 color:<?php echo $search_button_font_color; ?>;
    673                 font-size:<?php echo $search_button_font_size; ?>;
     649            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_submit_wrapper .button_text_holder {
     650                color:'.esc_attr($search_button_font_color).';
     651                font-size:'.esc_attr($search_button_font_size).';
    674652                margin-left: 5px;
    675653                display: inline-block;
    676654                line-height: normal;
    677655            }
    678             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper
     656            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper
    679657            .wpas_search_loader_icon {
    680658                float: left;
     
    689667            /*********** loader color and size ***********/
    690668
    691             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper
     669            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper
    692670            .wpas_search_loader_icon .lds-hourglass {
    693671              display: inline-block;
     
    697675              margin-right: 10px;
    698676            }
    699             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper
     677            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper
    700678            .wpas_search_loader_icon .lds-hourglass:after {
    701679              content: " ";
     
    705683              height: 0;
    706684              box-sizing: border-box;
    707               border: 18px solid <?php echo $loader_icon_color; ?>;
    708               border-color: <?php echo $loader_icon_color; ?> transparent <?php echo $loader_icon_color; ?> transparent;
     685              border: 18px solid '.esc_attr($loader_icon_color).';
     686              border-color: '.esc_attr($loader_icon_color).' transparent '.esc_attr($loader_icon_color).' transparent;
    709687              animation: lds-hourglass 1.2s infinite;
    710688            }
     
    723701            }
    724702
    725             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper
     703            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper
    726704            .wpas_search_loader_icon .sbl-circ {
    727705              height: 25px;
    728706              width: 25px;
    729               color: <?php echo $loader_icon_color; ?>;
     707              color: '.esc_attr($loader_icon_color).';
    730708              position: relative;
    731709              display: inline-block;
     
    744722            /**********************/
    745723
    746             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper
     724            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper
    747725            .wpas_search_loader_icon .sbl-circ-path {
    748726              height: 30px;
     
    753731              border: 4px solid;
    754732              border-radius: 50%;
    755               border-right-color: <?php echo $loader_icon_color; ?>;
     733              border-right-color: '.esc_attr($loader_icon_color).';
    756734              animation: rotate 1s linear infinite; }
    757735
     
    765743            /**************/
    766744
    767             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper
     745            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper
    768746            .wpas_search_loader_icon .sbl-sticks-spin {
    769747              height: 30px;
    770748              width: 3px;
    771               background: <?php echo $loader_icon_color; ?>;
     749              background: '.esc_attr($loader_icon_color).';
    772750              position: relative;
    773751              display: inline-block;
    774752              border-radius: 5px;
    775753              animation: animateSticks1 3s ease infinite; }
    776               .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_search_loader_icon .sbl-sticks-spin::before, .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_search_loader_icon .sbl-sticks-spin::after {
     754              .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_search_loader_icon .sbl-sticks-spin::before, .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_search_loader_icon .sbl-sticks-spin::after {
    777755                height: inherit;
    778756                width: inherit;
    779                 content: '';
     757                content: "";
    780758                display: block;
    781759                background: inherit;
    782760                position: absolute;
    783761                border-radius: 4px; }
    784               .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_search_loader_icon .sbl-sticks-spin::before {
     762              .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_search_loader_icon .sbl-sticks-spin::before {
    785763                left: 0;
    786                 animation: animateSticks2 1s .5s ease infinite; }
    787               .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_search_loader_icon .sbl-sticks-spin::after {
     764                animation: animateSticks2 1s .5s ease infinite;
     765             }
     766              .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_search_loader_icon .sbl-sticks-spin::after {
    788767                right: 0;
    789768                animation: animateSticks3 1s 1s ease infinite; }
     
    821800            /**********************/
    822801
    823             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_search_loader_icon .loader04 {
     802            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_search_loader_icon .loader04 {
    824803              width: 30px;
    825804              height: 30px;
    826               border: 2px solid <?php echo $loader_icon_color; ?>;
     805              border: 2px solid '.esc_attr($loader_icon_color).';
    827806              border-radius: 50%;
    828807              position: relative;
    829808              animation: loader-rotate 1s ease-in-out infinite;
    830809             }
    831             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_search_loader_icon .loader04::after {
    832                 content: '';
     810            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_search_loader_icon .loader04::after {
     811                content: " ";
    833812                width: 10px;
    834813                height: 10px;
    835814                border-radius: 50%;
    836                 background: <?php echo $loader_icon_color; ?>;
     815                background: '.esc_attr($loader_icon_color).';
    837816                position: absolute;
    838817                top: -6px;
     
    846825                transform: rotate(360deg); } }
    847826
    848             .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_search_loader_icon .loader05 {
     827            .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_search_loader_icon .loader05 {
    849828              width: 35px;
    850829              height: 35px;
    851               border: 4px solid <?php echo $loader_icon_color; ?>;
     830              border: 4px solid '.esc_attr($loader_icon_color).';
    852831              border-radius: 50%;
    853832              position: relative;
     
    876855            /* Ipad view  */
    877856            @media(min-width:768px) and (max-width:1024px){
    878                 .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_input_container{
    879                     width: <?php echo $tablet_box_width; ?>;
    880                     max-width: <?php echo $tablet_box_width; ?>;
     857                .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_input_container{
     858                    width: '.esc_attr($tablet_box_width).';
     859                    max-width: '.esc_attr($tablet_box_width).';
    881860                }
    882861            }
    883862            /* Mobile view  */
    884863            @media(max-width:767px){
    885                 .wpas_form_container_<?php echo $search_form->id; ?> .wpas_wrapper .wpas_input_container{
    886                     width: <?php echo $mobile_box_width; ?>;
    887                     max-width: <?php echo $mobile_box_width; ?>;
     864                .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper .wpas_input_container{
     865                    width: '.esc_attr($mobile_box_width).';
     866                    max-width: '.esc_attr($mobile_box_width).';
    888867                }
    889             }
    890 
    891         </style>
    892         <?php
     868            }'
     869
     870        );
    893871        $i++;
    894872        } // end foreach
     
    903881        $woo_form_key = $this->plugin_name.'_default_woo_search';
    904882        $default_search_form_id = get_option($theme_search_form_key);
    905         $default_woo_search_form_id = get_option($woo_form_key);
    906 
    907883        // if default form selected
    908884
     
    921897        global $wpdb;
    922898        $search_form_table = $wpdb->prefix."wpas_index";
    923         $search_form_setting = $wpdb->get_results($wpdb->prepare("SELECT * FROM $search_form_table where id=%d",$default_search_form_id));
    924         $settings = json_decode($search_form_setting[0]->data, true);
    925 
    926         ?>
    927         <script type="text/javascript">
    928             jQuery(document).ready(function() {
     899        $search_form_setting = $wpdb->get_row($wpdb->prepare("SELECT * FROM $search_form_table where id=%d",$default_search_form_id));
     900        $settings = json_decode($search_form_setting->data, true);
     901
     902        wp_register_script( 'advance-search-formcommon-js', '',);
     903        wp_enqueue_script( 'advance-search-formcommon-js' );
     904        wp_add_inline_script(
     905            'advance-search-formcommon-js',
     906   
     907            "jQuery(document).ready(function() {
    929908                var speechInputWrappers = document.querySelectorAll('form.search-form:not(.wpas_search_form)');
    930909               
     
    956935                    inputEl.classList.add('wpas_search_input');
    957936                    inputEl.classList.add('search_form_added');
    958                     inputEl.setAttribute('data-formid', '<?php echo $default_search_form_id; ?>');
     937                    inputEl.setAttribute('data-formid', ". intval($default_search_form_id). ");
    959938                    inputEl.setAttribute('style', 'margin-bottom: 0;');
    960939                    inputSubmit.classList.add('wpas_search_submit');
    961940                    inputSubmit.setAttribute('style', 'margin-bottom: 0;pointer-events: none;');
    962941                    var classes = speechInputWrapper.getAttribute('class');                 
    963                     speechInputWrapper.classList.add('search_form_<?php echo $default_search_form_id; ?>');
     942                    speechInputWrapper.classList.add('search_form_". intval($default_search_form_id)."');
    964943                    var innerDiv = document.createElement('div');
    965944                    innerDiv.className = 'wpas_search_result';
     
    968947            });
    969948            jQuery(window).ready(function() {
    970               jQuery(".search_form_added").on("keypress", function (event) {
     949              jQuery('.search_form_added').on('keypress', function (event) {
    971950                  var keyPressed = event.keyCode || event.which;
    972951                  if (keyPressed === 13) {
     
    975954                  }
    976955                });
    977               });
    978         </script>
    979 
    980         <?php
     956              })"
     957            );
    981958        }
    982959    }
     
    988965        $s_form_key = $this->plugin_name.'_default_search';
    989966        $default_search_form_id = get_option($s_form_key);
    990 
     967        $default_search_form_id = intval($default_search_form_id);
    991968        if($default_search_form_id > 0 ) {
    992969            $search_form = do_shortcode("[wpas id=".$default_search_form_id."]");
  • advance-search/trunk/inc/common/js/advance-search.js

    r2499175 r2601509  
    4747                        $(searchbox).closest('form').find('.wpas_search_result').html(json['html']);
    4848                        $(searchbox).closest('form').find('.wpas_search_close').show().css({'display':'block'});
    49                         //console.log(json);
     49                       
    5050                    },
    5151                    error: function(xhr, ajaxOptions, thrownError) {
  • advance-search/trunk/inc/core/class-activator.php

    r2499175 r2601509  
    2727
    2828        // Check PHP Version and deactivate & die if it doesn't meet minimum requirements.
    29         if ( version_compare( PHP_VERSION, $min_php, '<' ) ) {
     29        if ( version_compare(PHP_VERSION, $min_php, '<' ) ) {
    3030            deactivate_plugins( plugin_basename( __FILE__ ) );
    31             wp_die( 'This plugin requires a minmum PHP Version of ' . $min_php );
     31           
     32            wp_die('<p><strong>' . __('Advanced Search', $plugin_name).'</strong> '.  __('plugin requires a minmum PHP Version of ', $plugin_name).$min_php.'. '.__('You have to upgrade your php version to enjoy Advanced Search.', $plugin_name) . '</p>','Plugin Activation Error',  array( 'response'=>200, 'back_link'=>TRUE ) );
     33       
    3234        }
    3335
     
    4042        $wpas_post_table = $wpdb->prefix . 'posts';
    4143
    42         // change post table
    43        
    44         $wpdb->query("ALTER TABLE ".$wpas_post_table." ADD FULLTEXT wpas_index_post_table (post_title, post_content)");
    45         $wpdb->query("ALTER TABLE ".$wpas_post_table." ADD FULLTEXT wpas_index_post_table_title (post_title)");
    46         $wpdb->query("ALTER TABLE ".$wpas_post_table." ADD FULLTEXT wpas_index_post_table_content (post_content)");
     44        $count_indexes  = $wpdb->query("SHOW KEYS FROM $wpas_post_table WHERE Key_name = 'wpas_index_post_table' OR Key_name = 'wpas_index_post_table_title' OR Key_name = 'wpas_index_post_table_content' ");
     45        if($count_indexes == 0){
     46            // change post table
     47            $wpdb->query("ALTER TABLE ".$wpas_post_table." ADD FULLTEXT wpas_index_post_table (post_title, post_content)");
     48            $wpdb->query("ALTER TABLE ".$wpas_post_table." ADD FULLTEXT wpas_index_post_table_title (post_title)");
     49            $wpdb->query("ALTER TABLE ".$wpas_post_table." ADD FULLTEXT wpas_index_post_table_content (post_content)");
     50        }
     51   
    4752
    4853        if($wpdb->get_var("SHOW TABLES LIKE '$wpas_index_table'") != $wpas_index_table) {
Note: See TracChangeset for help on using the changeset viewer.