Changeset 2601509
- Timestamp:
- 09/20/2021 04:58:12 AM (4 years ago)
- Location:
- advance-search/trunk
- Files:
-
- 13 edited
-
advance-search.php (modified) (1 diff)
-
inc/admin/class-admin.php (modified) (22 diffs)
-
inc/admin/css/advance-search-admin.css (modified) (1 diff)
-
inc/admin/js/advance-search-admin.js (modified) (7 diffs)
-
inc/admin/views/help-update.php (modified) (3 diffs)
-
inc/admin/views/html-advance-search-admin-options.php (modified) (31 diffs)
-
inc/admin/views/import-export.php (modified) (2 diffs)
-
inc/admin/views/search-statistics.php (modified) (2 diffs)
-
inc/admin/views/wpas-search.php (modified) (12 diffs)
-
inc/admin/views/wpas_popup.php (modified) (7 diffs)
-
inc/common/class-common.php (modified) (35 diffs)
-
inc/common/js/advance-search.js (modified) (1 diff)
-
inc/core/class-activator.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advance-search/trunk/advance-search.php
r2597560 r2601509 122 122 */ 123 123 function 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); 127 128 } 128 129 -
advance-search/trunk/inc/admin/class-admin.php
r2597560 r2601509 76 76 { 77 77 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' ); 78 79 } 79 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/common.css', array(), $this->version, 'all' );80 81 // include fontawesome82 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' ); 84 85 85 86 } … … 99 100 100 101 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 102 107 )); 103 108 wp_enqueue_script( $this->plugin_name ); … … 266 271 if( isset( $_POST['wpas-search'] ) && wp_verify_nonce( sanitize_text_field($_POST['wpas-search']), $this->plugin_name) ) { 267 272 $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 } 269 277 $data = $this->search_default_settings(); 270 271 278 global $wpdb; 272 279 $search_form_table = $wpdb->prefix."wpas_index"; … … 276 283 $checkName = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) from $search_form_table where name=%s",$search_form_name)); 277 284 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 ) ) ; 280 286 if($wpdb->query($sql)) { 281 287 $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))); 283 289 exit; 284 290 } 285 291 } 286 292 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'))); 288 294 exit; 289 295 } 290 296 } 291 297 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))); 293 299 exit; 294 300 } … … 310 316 311 317 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")); 313 320 die(); 314 321 } … … 322 329 323 330 if(isset($ajax_type) && !empty($ajax_type) ) { 324 325 331 // check if ajax for clone 326 332 … … 328 334 329 335 $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 } 330 343 331 344 global $wpdb; … … 338 351 $checkName = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) from $search_form_table where name=%s", $search_form_name)); 339 352 340 $search_form_setting = $wpdb->get_r esults($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)); 341 354 if ($checkName == 0) { 342 355 if(!empty($search_form_setting)) { 343 $data = $search_form_setting[0]; 344 $form_setting = $data->data; 356 $form_setting = $search_form_setting->data; 345 357 346 358 $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 ) ) ; 350 360 if($wpdb->query($sql)) { 351 361 $lastid = $wpdb->insert_id; 352 362 $responsearray = array('astext' => 'true' ); 353 echo json_encode($responsearray);363 echo wp_json_encode($responsearray); 354 364 exit; 355 365 } … … 357 367 else { 358 368 $responsearray = array('astext' => 'false' ); 359 echo json_encode($responsearray);369 echo wp_json_encode($responsearray); 360 370 exit; 361 371 } 362 372 } 363 373 else{ 364 $responsearray = array('astext' => 'already exists');365 echo json_encode($responsearray);374 $responsearray = array('astext' => 'already-exists'); 375 echo wp_json_encode($responsearray); 366 376 exit; 367 377 } … … 369 379 else{ 370 380 $responsearray = array('astext' => 'empty'); 371 echo json_encode($responsearray);381 echo wp_json_encode($responsearray); 372 382 exit; 373 383 } 374 384 } 375 385 else { 376 echo "limit";386 echo wp_json_encode(array('error' => "limit")); 377 387 exit; 378 388 } … … 387 397 $search_form_table = $wpdb->prefix."wpas_index"; 388 398 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); 390 400 391 401 if($wpdb->query($sql)) { 392 402 $responsearray = array('astext' => 'true'); 393 echo json_encode($responsearray);403 echo wp_json_encode($responsearray); 394 404 exit; 395 405 } 396 406 else { 397 407 $responsearray = array('astext' => 'false'); 398 echo json_encode($responsearray);408 echo wp_json_encode($responsearray); 399 409 exit; 400 410 } … … 425 435 426 436 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' ))); 428 438 exit; 429 439 } … … 438 448 439 449 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 ))); 441 451 exit; 442 452 } 443 453 444 } // end default woo search 445 454 } // end default woo search 446 455 447 456 } 448 449 450 451 } 452 457 } 453 458 } 454 459 … … 470 475 $data = $this->search_default_settings(); 471 476 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); 473 478 474 479 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"); 476 481 wp_redirect($redirect_url); 477 482 exit; 478 483 } 479 484 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"); 481 486 wp_redirect($redirect_url); 482 487 exit; … … 486 491 487 492 // update form settings 488 489 493 if( isset( $_POST['wpas-search_setting'] ) && wp_verify_nonce( sanitize_text_field($_POST['wpas-search_setting']), 'search_form_settings') && current_user_can( 'manage_options' )) { 490 494 491 495 $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']) : [], 494 498 'meta_keys' => array( 495 499 isset($_POST['search_form_setting']['post_types']['meta_keys']) ? sanitize_text_field(htmlentities(stripslashes($_POST['search_form_setting']['post_types']['meta_keys'][0]))) : '', … … 497 501 ); 498 502 503 499 504 $option = array ( 500 505 'post_types' => $post_type_array, 501 506 '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']): [], 504 509 ), 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']) : [], 506 511 'styling' => 507 512 array ( … … 572 577 573 578 ); 574 575 579 576 580 $form_id = intval($_POST['search_form_setting']['form_id']); 577 $data = json_encode($option); 578 579 581 $data = wp_json_encode($option); 580 582 // 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); 582 584 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"); 584 586 wp_redirect($redirect_url); 585 587 exit; 586 588 } 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"); 588 590 wp_redirect($redirect_url); 589 591 exit; … … 595 597 596 598 // default data for new search added 597 598 599 public function search_default_settings() { 599 600 600 $option = array ( 601 601 'post_types' => … … 676 676 ); 677 677 678 $default_options = json_encode($option);678 $default_options = wp_json_encode($option); 679 679 return $default_options; 680 680 … … 738 738 ?> 739 739 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; 746 750 return $settings; 747 751 } … … 790 794 $headers .= 'Content-type:text/html;charset=UTF-8'."\r\n"; 791 795 $headers .= 'From: [email protected]'."\r\n"; 792 $mail = mail($lokhal_email, $subject, $message, $headers);796 $mail = wp_mail($lokhal_email, $subject, $message, $headers); 793 797 $data = $this->verify_on_server($lokhal_email, $lokhal_fname, $lokhal_lname, $engagement, 'verify', '0'); 794 798 if ($mail) { … … 814 818 $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'); 815 819 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); 820 826 } 821 827 die; -
advance-search/trunk/inc/admin/css/advance-search-admin.css
r2500938 r2601509 1988 1988 padding-right: 35px; 1989 1989 } 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 } 1990 2006 /* Responsive Media Querys Here */ 1991 2007 @media (max-width:1280px){ -
advance-search/trunk/inc/admin/js/advance-search-admin.js
r2597560 r2601509 136 136 137 137 // clone / delete setting 138 138 139 139 140 jQuery('.search_imp_ajax').click(function() { … … 147 148 var dataAjax = jQuery(this).attr('data-ajax'); 148 149 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); 150 151 if(del==true){ 151 152 jQuery(".delete_search").attr("data-ajax", "Yes"); … … 176 177 if(data.astext == 'true' ){ 177 178 jQuery('.as-alreadyexists').hide(); 179 jQuery('.as-namelength').hide(); 178 180 jQuery('.as-validname').hide(); 179 181 jQuery('.as-success').show(); … … 184 186 185 187 } 186 else if(data.astext == 'already exists' ){188 else if(data.astext == 'already-exists' ){ 187 189 jQuery('.as-alreadyexists').show(); 188 190 jQuery('.as-validname').hide(); 191 jQuery('.as-namelength').hide(); 189 192 return false; 190 193 }else if(data.astext == 'empty'){ 191 194 jQuery('.as-validname').show(); 192 195 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(); 193 202 jQuery('.as-success').hide(); 194 203 } 204 205 195 206 else{ 196 207 setTimeout(function(){ 197 alert( 'Something went wrong. Please try again.');208 alert(js_params.something_wrong_text); 198 209 location.reload(); 199 210 }, 300); … … 220 231 }); 221 232 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 308 234 309 235 jQuery("input.restricted").keyup(function (e) { … … 315 241 }); 316 242 317 // chart318 319 (function ($) {320 "use strict"; //You will be happier321 322 $.fn.horizBarChart = function( options ) {323 324 var settings = $.extend({325 // default settings326 selector: '.bar',327 speed: 3000328 }, options);329 330 // Cycle through all charts on page331 return this.each(function(){332 // Start highest number variable as 0333 // 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 other338 $(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 widths346 $(this).find($(settings.selector)).each(function() {347 var bar = $(this),348 // get all the numbers349 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 widths353 $(this).animate({ 'width' : percentage }, settings.speed);354 });355 });356 357 }; // horizChart358 359 }(jQuery));360 361 // chart js362 363 jQuery(document).ready(function(){364 jQuery('.chart').horizBarChart({365 selector: '.bar',366 speed: 1000367 });368 });369 370 // loader and magifire icons active371 372 jQuery(document).ready(function() {373 374 // loader icon375 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 icon384 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 });392 243 393 244 /*********** verify email popup *************/ … … 469 320 success: function (response) { 470 321 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); 472 323 } else if (response == '2') { 473 324 } -
advance-search/trunk/inc/admin/views/help-update.php
r2597560 r2601509 14 14 exit; // Exit if accessed directly 15 15 } 16 ?>17 18 <?php19 16 include_once('wpas_popup.php'); 20 17 ?> … … 24 21 <br/> 25 22 <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> 28 25 <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> 29 26 </div> … … 36 33 <div class="column"> 37 34 <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> 39 36 </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 44 38 <div class="column"> 45 39 <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 22 22 global $wpdb; 23 23 $search_form_table = $wpdb->prefix."wpas_index"; 24 $search_form_setting = $wpdb->get_r esults($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)); 25 25 26 26 if($search_form_id == 0 || $wpdb->num_rows == 0) { … … 29 29 } 30 30 31 $form_name = $search_form_setting [0]->name;31 $form_name = $search_form_setting->name; 32 32 33 33 if($wpdb->num_rows > 0) { 34 34 35 $settings = json_decode($search_form_setting [0]->data, true);35 $settings = json_decode($search_form_setting->data, true); 36 36 37 37 $args = array( 38 38 'public' => true, 39 //'_builtin' => false, //exclude attachment, revision etc.39 40 40 ); 41 41 $advance_search_excludeTaxonomy = array('product_shipping_class'); … … 43 43 $taxonomies_args = array( 44 44 'public' => true, 45 //'_builtin' => false45 46 46 ); 47 47 … … 69 69 <input type="hidden" name="action" value="wpas_search_form_settings"> 70 70 <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); ?>"> 72 72 73 73 <div class="heading"> 74 74 <h3><?php echo esc_html( get_admin_page_title() ); ?></h3> 75 75 <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> 78 78 <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> 79 79 </div> … … 90 90 ?> 91 91 <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> 93 93 </div> 94 94 <?php … … 97 97 ?> 98 98 <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> 100 100 </div> 101 101 <?php … … 104 104 ?> 105 105 <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> 107 107 </div> 108 108 <?php … … 113 113 <ul class="accordion"> 114 114 <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> 116 116 <div class="inner shortcode_inputSec"> 117 117 <h4 class="title_heading"> … … 119 119 </h4> 120 120 <?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).'\']"); ?>'; 122 122 ?> 123 123 <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"> 126 126 </div> 127 127 <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"> 130 130 </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> 132 132 <?php highlight_string($simple_shortcode_template); ?> 133 133 </div> … … 245 245 <?php 246 246 247 if( $taxonomies != '') {247 if( !empty($taxonomies) ) { 248 248 249 249 foreach ($taxonomies as $taxonomy) { … … 602 602 <li> 603 603 <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> 605 605 </li> 606 606 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> 608 608 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> 610 610 611 611 </ul> … … 617 617 <li> 618 618 <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> 620 620 </div> 621 621 </li> … … 628 628 <li> 629 629 <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> 631 631 </li> 632 632 … … 638 638 <ul class="searchMBox"> 639 639 <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']); ?>" /> 641 641 </li> 642 642 </ul> … … 654 654 if($value == $settings['styling']['search_box_outer']['border_type']) { 655 655 ?> 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> 657 657 <?php 658 658 } 659 659 else { 660 660 ?> 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> 662 662 <?php 663 663 } … … 671 671 <div class="col_liStle hideBorder"> 672 672 <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> 674 674 </div> 675 675 </li> … … 678 678 <div class="col_liStle hideBorder"> 679 679 <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']); ?>"> 681 681 </div> 682 682 </li> … … 685 685 <ul class="searchMBox newBoxSearch"> 686 686 <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> 688 688 </li> 689 689 <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> 691 691 </li> 692 692 <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> 694 694 </li> 695 695 <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> 697 697 </li> 698 698 </ul> … … 712 712 <div class="col_liStle"> 713 713 <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']); ?>"> 715 715 </div> 716 716 </li> … … 723 723 <li> 724 724 <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> 726 726 </li> 727 727 <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> 729 729 </li> 730 730 <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> 732 732 </li> 733 733 </ul> … … 747 747 if($value == $settings['styling']['search_input']['border_type']) { 748 748 ?> 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> 750 750 <?php 751 751 } 752 752 else { 753 753 ?> 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> 755 755 <?php 756 756 } … … 765 765 <div class="col_liStle hideBorder"> 766 766 <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> 768 768 </div> 769 769 </li> … … 771 771 <li> 772 772 <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']); ?>"> 774 774 </div> 775 775 </li> … … 780 780 <div class="col_liStle"> 781 781 <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> 783 783 </div> 784 784 </li> 785 785 <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> 787 787 </div> 788 788 </li> 789 789 <li> 790 790 <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> 792 792 </div> 793 793 </li> 794 794 <li> 795 795 <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> 797 797 </div> 798 798 </li> … … 820 820 <div class="col_liStle"> 821 821 <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"> 823 823 824 824 </div> … … 827 827 <div class="col_liStle"> 828 828 <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"> 830 830 </div> 831 831 </li> … … 857 857 </ul> 858 858 </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"> 860 860 </div> 861 861 … … 873 873 <fieldset> 874 874 <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'; ?>" /> 876 876 </fieldset> 877 877 </li> 878 878 <li> 879 879 <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'; ?>"> 881 881 </li> 882 882 </ul> … … 908 908 <fieldset> 909 909 <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']); ?>" /> 911 911 <span class="pxValue nwPxValue"> <?php echo esc_attr__('px', $this->plugin_text_domain); ?></span> 912 912 </fieldset> … … 956 956 <div class="wpas_search_right"> 957 957 <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 959 959 </form> 960 960 … … 962 962 <input type="hidden" name="action" value="wpas_search_form_settings"> 963 963 <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); ?>"> 965 965 <button class="button button-secondary" type="submit"><?php echo esc_attr__('Restore defaults', $this->plugin_text_domain); ?></button> 966 966 </form> -
advance-search/trunk/inc/admin/views/import-export.php
r2597560 r2601509 29 29 <br/> 30 30 <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> 33 33 <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> 34 34 </div> … … 42 42 </h4> 43 43 </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"> 45 45 </div> 46 46 </div> -
advance-search/trunk/inc/admin/views/search-statistics.php
r2597560 r2601509 25 25 <h3><?php echo esc_html( get_admin_page_title() ); ?></h3> 26 26 <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> 28 28 <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> 29 29 </div> … … 37 37 <div class="buy_pro_wrapper"> 38 38 <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> 40 40 </h4> 41 41 </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"> 45 43 </div> 46 47 44 </div> 48 45 -
advance-search/trunk/inc/admin/views/wpas-search.php
r2597560 r2601509 19 19 $opt = get_option('wp_advance_search_settings'); 20 20 21 21 wp_register_script( 'advance-search-wpas-js', '',); 22 wp_enqueue_script( 'advance-search-wpas-js' ); 23 wp_add_inline_script( 24 'advance-search-wpas-js', " var vle_nonce = '". wp_create_nonce('verify-wpas-email')."'" 25 ); 22 26 ?> 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 27 28 28 29 <?php … … 43 44 44 45 <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"' ;?>/> 47 48 <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> 48 49 <?php if(count($search_forms) >= 3){ ?> … … 51 52 <?php if(isset($_GET['name-already-exists']) ){ ?> 52 53 <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> 53 58 <?php }?> 54 59 </div> … … 70 75 foreach ($search_forms as $search_form_name) { 71 76 ?> 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> 73 78 <?php 74 79 } … … 83 88 <?php }?> 84 89 </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> 86 91 87 92 </form> … … 108 113 foreach ($search_forms as $search_form_name) { 109 114 ?> 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> 111 116 <?php 112 117 } … … 115 120 </select> 116 121 </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> 118 123 </form> 119 124 </div> … … 138 143 <li> 139 144 <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"> 141 146 <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> 143 148 </span> 144 149 </li> … … 148 153 } 149 154 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); 151 159 } 152 160 ?> … … 176 184 177 185 </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> 201 187 <?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 ?> 276 190 <div class="fm_msg_popup"> 277 191 <div class="fm_msg_popup_tbl"> … … 290 204 <div class="aspopup"> 291 205 <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> 293 207 <a class="close" href="javascript:void(0)">×</a> 294 208 </div> … … 307 221 <div class="aspopup-form-area"> 308 222 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"' ;?>/> 310 224 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) ? '' : ' ';?>/> 312 226 </div> 313 227 314 228 <?php }?> 315 229 <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> 316 231 <p class="pro-info as-validname" style="display:none">* <?php _e('Please enter Shortcode Name.', $this->plugin_text_domain); ?></p> 317 232 <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 6 6 7 7 $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 8 wp_register_script( 'advance-search-inlinepopup-js', '',); 9 wp_enqueue_script( 'advance-search-inlinepopup-js' ); 10 wp_add_inline_script( 11 'advance-search-inlinepopup-js', 'var vle_nonce = "'. wp_create_nonce("verify-wpas-email").'"' 12 ); ?> 17 13 <div class="popup_wrapper"> 18 19 14 <?php 20 15 if (false === get_option('wpas_email_verified_'.$current_user->ID) && (false === (get_transient('wpas_cancel_lk_popup_'.$current_user->ID)))) { … … 25 20 <div class="lokhal_verify_email_popup_cel"> 26 21 <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__))); ?>" 28 23 class="wp_fm_loader" /></a> 29 24 <div class="popup_inner_lokhal"> … … 32 27 </h3> 33 28 <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'); ?> 37 30 </p> 38 31 <form> … … 40 33 <div class="form_twocol"> 41 34 <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"/> 44 37 <span id="fname_error" class="error_msg"> 45 38 <?php _e('Please Enter First Name.', 'advance-search'); ?></span> … … 48 41 <input name="verify_lokhal_lname" id="verify_lokhal_lname" maxlength="20" class="regular-text" 49 42 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'); ?>" /> 52 45 <span id="lname_error" class="error_msg"> 53 46 <?php _e('Please Enter Last Name.', 'advance-search'); ?></span> … … 57 50 <div class="form_onecol"> 58 51 <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'); ?>" /> 61 54 <span id="email_error" class="error_msg"> 62 55 <?php _e('Please Enter Email Address.', 'advance-search'); ?></span> … … 68 61 </span> 69 62 <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__))); ?>" /> 71 64 </span></button> 72 65 <button class="lokhal_cancel button"> -
advance-search/trunk/inc/common/class-common.php
r2597560 r2601509 124 124 $search_form_table = $wpdb->prefix."wpas_index"; 125 125 126 $search_form_settings = $wpdb->get_r esults($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)); 127 127 128 128 if($wpdb->num_rows > 0) { 129 129 130 $search_form_settings = json_decode($search_form_settings [0]->data, true);130 $search_form_settings = json_decode($search_form_settings->data, true); 131 131 $t_data = array(); 132 132 … … 140 140 // check if enable any specific title or content in search areas 141 141 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'])) { 143 143 $search_columns = implode(',', $search_form_settings['post_types']['search_areas']); 144 144 … … 159 159 // check if meta keys added 160 160 $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)) { 164 164 165 165 $post_meta_keys_array = explode(',',$post_meta_keys); … … 169 169 foreach($post_meta_keys_array as $meta_key) { 170 170 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") '; 172 172 $where .= " OR ( m".$m.".meta_key = '$meta_key' AND m".$m.".meta_value like '%$s%') "; 173 173 … … 180 180 // check search type 181 181 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"; 184 184 185 185 } 186 186 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"; 188 188 } 189 189 … … 205 205 // custom taxonomies search 206 206 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'] )) { 209 208 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']) )) { 233 231 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 244 247 $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 258 254 $count = count($terms_result); 259 255 … … 268 264 // attachments search 269 265 270 if(array_key_exists('attachments', $search_form_settings) ) {266 if(array_key_exists('attachments', $search_form_settings) && !empty($search_form_settings['attachments'])) { 271 267 $attachments_mime_type = '"'.implode('","', $search_form_settings['attachments']).'"'; 272 273 $wp_post_attachments_data = array(''); 274 268 $wp_post_attachments_data = array(); 275 269 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'])) { 276 270 277 271 // check search type 278 279 if( $search_type == ''|| $search_type == 'full_word') {272 273 if( empty($search_type) || $search_type == 'full_word') { 280 274 $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"; 281 275 } … … 284 278 } 285 279 286 287 280 $wp_post_attachments_data = $wpdb->get_results($wp_post_attachment_query); 288 281 … … 290 283 291 284 $attachments_data = $wp_post_attachments_data; 292 293 285 if(!empty($attachments_data)) { 294 286 foreach ($attachments_data as $attach_final) { … … 316 308 $final_data['form_id'] = $form_id; 317 309 $final_data['html'] = $html; 318 319 310 // Echo the response to the AJAX request. 320 311 wp_send_json($final_data); 321 // wp_send_json will also die(). 322 312 323 313 } 324 314 } … … 383 373 $custom_title = sanitize_text_field(htmlentities($setting['title'])); 384 374 385 $search_forms = $wpdb->get_r esults($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)); 386 376 387 377 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; 398 381 $loader_icon = 'sbl-circ'; 399 382 $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']); 405 388 $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>'; 411 391 } 412 392 413 393 $magnifire_icon_show = ''; 414 if(isset($show_magnifire_icon) && $show_magnifire_icon != '') {394 if(isset($show_magnifire_icon) && !empty($show_magnifire_icon )) { 415 395 $magnifire_icon_show = '<i class="fa fa-'.$magnifire_icon.'"></i>'; 416 }417 else {418 $magnifire_icon_show = '';419 396 } 420 397 421 398 $title = ''; 422 399 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>'; 425 402 } 426 403 … … 432 409 <div class="input_cont '.$button_icon_position.'"> 433 410 <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.'" /> 435 412 </label> 436 413 <div class="wpas_search_loader_icon" style="display:none;"><div class="'.$loader_icon.'"></div></div> … … 451 428 452 429 }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>"; 454 431 } 455 432 … … 544 521 $search_button_font_color = $search_button_settings['font_color']; 545 522 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).'; 556 534 557 535 } 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; 562 540 overflow:hidden; 563 541 position: relative; 564 542 } 565 .wpas_form_container_ <?php echo $search_form->id; ?>.wpas_wrapper form {543 .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper form { 566 544 margin: 0px; 567 545 height:100%; … … 569 547 display: block; 570 548 } 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 { 572 550 width: 100%; 573 551 display: flex; 574 552 } 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{ 576 554 flex-direction: row-reverse; 577 555 } … … 597 575 text-decoration: none; 598 576 } 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{ 600 578 width:100%; 601 579 float: left; 602 580 position: relative; 603 581 } 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).'; 606 584 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; 613 591 float: left; 614 592 width:100%; … … 617 595 618 596 } 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 { 620 598 outline: none !important; 621 599 } 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; 624 602 } 625 603 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 { 627 605 right: 35px; 628 606 } 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 { 630 608 right: 0px !important; 631 609 } 632 610 633 611 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 { 635 613 width:auto; 636 614 height:100%; 637 615 float: right; 638 616 } 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; 642 620 transform: translate(0px, 0px); 643 line-height: <?php echo $search_box_height; ?>px;621 line-height: '.esc_attr($search_box_height).'px; 644 622 text-align: center; 645 623 padding: 0 12px; … … 650 628 white-space: nowrap; 651 629 } 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{ 653 631 padding-right: 5px; 654 632 } 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{ 656 634 position: absolute; 657 635 top:50%; … … 663 641 padding:0px 10px; 664 642 } 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).'; 668 646 display: inline-block; 669 647 } 670 648 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).'; 674 652 margin-left: 5px; 675 653 display: inline-block; 676 654 line-height: normal; 677 655 } 678 .wpas_form_container_ <?php echo $search_form->id; ?>.wpas_wrapper656 .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper 679 657 .wpas_search_loader_icon { 680 658 float: left; … … 689 667 /*********** loader color and size ***********/ 690 668 691 .wpas_form_container_ <?php echo $search_form->id; ?>.wpas_wrapper669 .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper 692 670 .wpas_search_loader_icon .lds-hourglass { 693 671 display: inline-block; … … 697 675 margin-right: 10px; 698 676 } 699 .wpas_form_container_ <?php echo $search_form->id; ?>.wpas_wrapper677 .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper 700 678 .wpas_search_loader_icon .lds-hourglass:after { 701 679 content: " "; … … 705 683 height: 0; 706 684 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; 709 687 animation: lds-hourglass 1.2s infinite; 710 688 } … … 723 701 } 724 702 725 .wpas_form_container_ <?php echo $search_form->id; ?>.wpas_wrapper703 .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper 726 704 .wpas_search_loader_icon .sbl-circ { 727 705 height: 25px; 728 706 width: 25px; 729 color: <?php echo $loader_icon_color; ?>;707 color: '.esc_attr($loader_icon_color).'; 730 708 position: relative; 731 709 display: inline-block; … … 744 722 /**********************/ 745 723 746 .wpas_form_container_ <?php echo $search_form->id; ?>.wpas_wrapper724 .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper 747 725 .wpas_search_loader_icon .sbl-circ-path { 748 726 height: 30px; … … 753 731 border: 4px solid; 754 732 border-radius: 50%; 755 border-right-color: <?php echo $loader_icon_color; ?>;733 border-right-color: '.esc_attr($loader_icon_color).'; 756 734 animation: rotate 1s linear infinite; } 757 735 … … 765 743 /**************/ 766 744 767 .wpas_form_container_ <?php echo $search_form->id; ?>.wpas_wrapper745 .wpas_form_container_'.esc_attr($search_form->id).' .wpas_wrapper 768 746 .wpas_search_loader_icon .sbl-sticks-spin { 769 747 height: 30px; 770 748 width: 3px; 771 background: <?php echo $loader_icon_color; ?>;749 background: '.esc_attr($loader_icon_color).'; 772 750 position: relative; 773 751 display: inline-block; 774 752 border-radius: 5px; 775 753 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 { 777 755 height: inherit; 778 756 width: inherit; 779 content: '';757 content: ""; 780 758 display: block; 781 759 background: inherit; 782 760 position: absolute; 783 761 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 { 785 763 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 { 788 767 right: 0; 789 768 animation: animateSticks3 1s 1s ease infinite; } … … 821 800 /**********************/ 822 801 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 { 824 803 width: 30px; 825 804 height: 30px; 826 border: 2px solid <?php echo $loader_icon_color; ?>;805 border: 2px solid '.esc_attr($loader_icon_color).'; 827 806 border-radius: 50%; 828 807 position: relative; 829 808 animation: loader-rotate 1s ease-in-out infinite; 830 809 } 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: " "; 833 812 width: 10px; 834 813 height: 10px; 835 814 border-radius: 50%; 836 background: <?php echo $loader_icon_color; ?>;815 background: '.esc_attr($loader_icon_color).'; 837 816 position: absolute; 838 817 top: -6px; … … 846 825 transform: rotate(360deg); } } 847 826 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 { 849 828 width: 35px; 850 829 height: 35px; 851 border: 4px solid <?php echo $loader_icon_color; ?>;830 border: 4px solid '.esc_attr($loader_icon_color).'; 852 831 border-radius: 50%; 853 832 position: relative; … … 876 855 /* Ipad view */ 877 856 @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).'; 881 860 } 882 861 } 883 862 /* Mobile view */ 884 863 @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).'; 888 867 } 889 } 890 891 </style> 892 <?php 868 }' 869 870 ); 893 871 $i++; 894 872 } // end foreach … … 903 881 $woo_form_key = $this->plugin_name.'_default_woo_search'; 904 882 $default_search_form_id = get_option($theme_search_form_key); 905 $default_woo_search_form_id = get_option($woo_form_key);906 907 883 // if default form selected 908 884 … … 921 897 global $wpdb; 922 898 $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() { 929 908 var speechInputWrappers = document.querySelectorAll('form.search-form:not(.wpas_search_form)'); 930 909 … … 956 935 inputEl.classList.add('wpas_search_input'); 957 936 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). "); 959 938 inputEl.setAttribute('style', 'margin-bottom: 0;'); 960 939 inputSubmit.classList.add('wpas_search_submit'); 961 940 inputSubmit.setAttribute('style', 'margin-bottom: 0;pointer-events: none;'); 962 941 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)."'); 964 943 var innerDiv = document.createElement('div'); 965 944 innerDiv.className = 'wpas_search_result'; … … 968 947 }); 969 948 jQuery(window).ready(function() { 970 jQuery( ".search_form_added").on("keypress", function (event) {949 jQuery('.search_form_added').on('keypress', function (event) { 971 950 var keyPressed = event.keyCode || event.which; 972 951 if (keyPressed === 13) { … … 975 954 } 976 955 }); 977 }); 978 </script> 979 980 <?php 956 })" 957 ); 981 958 } 982 959 } … … 988 965 $s_form_key = $this->plugin_name.'_default_search'; 989 966 $default_search_form_id = get_option($s_form_key); 990 967 $default_search_form_id = intval($default_search_form_id); 991 968 if($default_search_form_id > 0 ) { 992 969 $search_form = do_shortcode("[wpas id=".$default_search_form_id."]"); -
advance-search/trunk/inc/common/js/advance-search.js
r2499175 r2601509 47 47 $(searchbox).closest('form').find('.wpas_search_result').html(json['html']); 48 48 $(searchbox).closest('form').find('.wpas_search_close').show().css({'display':'block'}); 49 //console.log(json);49 50 50 }, 51 51 error: function(xhr, ajaxOptions, thrownError) { -
advance-search/trunk/inc/core/class-activator.php
r2499175 r2601509 27 27 28 28 // 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, '<' ) ) { 30 30 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 32 34 } 33 35 … … 40 42 $wpas_post_table = $wpdb->prefix . 'posts'; 41 43 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 47 52 48 53 if($wpdb->get_var("SHOW TABLES LIKE '$wpas_index_table'") != $wpas_index_table) {
Note: See TracChangeset
for help on using the changeset viewer.