Headline
CVE-2023-2452: class-aws-admin-options.php in advanced-woo-search/tags/2.77/includes/admin – WordPress Plugin Repository
The Advanced Woo Search plugin for WordPress is vulnerable to Stored Cross-Site Scripting via admin settings in versions up to, and including, 2.77 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with administrator-level permissions and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page. This only affects multi-site installations and installations where unfiltered_html has been disabled.
1<?php23if ( ! defined( ‘ABSPATH’ ) ) {4 exit;5}678if ( ! class_exists( ‘AWS_Admin_Options’ ) ) :910 /**11 * Class for plugin admin options methods12 */13 class AWS_Admin_Options {1415 /*16 * Get default settings values17 * @param string $tab Tab name18 * @return array19 */20 static public function get_default_settings( $tab = false ) {2122 $options = self::options_array( $tab );23 $default_settings = array();2425 foreach ( $options as $section_name => $section ) {2627 foreach ( $section as $values ) {2829 if ( isset( $values[‘type’] ) && $values[‘type’] === ‘heading’ ) {30 continue;31 }3233 if ( isset( $values[‘type’] ) && $values[‘type’] === ‘html’ ) {34 continue;35 }3637 if ( isset( $values[‘type’] ) && $values[‘type’] === ‘table’ && empty( $values[‘value’] ) ) {38 continue;39 }4041 if ( isset( $values[‘type’] ) && ( $values[‘type’] === ‘checkbox’ || $values[‘type’] === ‘table’ ) ) {42 foreach ( $values[‘choices’] as $key => $val ) {43 $default_settings[ $values[‘id’] ][$key] = sanitize_text_field( $values[‘value’][$key] );44 }45 continue;46 }4748 if ( $values[‘type’] === ‘textarea’ && isset( $values[‘allow_tags’] ) ) {49 $default_settings[$values[‘id’]] = (string) addslashes( wp_kses( stripslashes( $values[‘value’] ), AWS_Helpers::get_kses( $values[‘allow_tags’] ) ) );50 continue;51 }5253 if ( $values[‘type’] === ‘textarea’ ) {54 if ( function_exists(‘sanitize_textarea_field’) ) {55 $default_settings[ $values[‘id’] ] = (string) sanitize_textarea_field( $values[‘value’] );56 } else {57 $default_settings[ $values[‘id’] ] = (string) str_replace( "<\n", "<\n", wp_strip_all_tags( $values[‘value’] ) );58 }59 continue;60 }6162 $default_settings[$values[‘id’]] = (string) sanitize_text_field( $values[‘value’] );6364 if ( isset( $values[‘sub_option’] ) ) {65 $default_settings[$values[‘sub_option’][‘id’]] = (string) sanitize_text_field( $values[‘sub_option’][‘value’] );66 }6768 }6970 }7172 return $default_settings;7374 }7576 /*77 * Update plugin settings78 */79 static public function update_settings() {8081 $options = self::options_array();82 $update_settings = self::get_settings();83 $current_tab = empty( $_GET[‘tab’] ) ? ‘general’ : sanitize_text_field( $_GET[‘tab’] );8485 foreach ( $options[$current_tab] as $values ) {8687 if ( $values[‘type’] === ‘heading’ || $values[‘type’] === ‘table’ || $values[‘type’] === ‘html’ ) {88 continue;89 }9091 if ( $values[‘type’] === ‘checkbox’ ) {9293 $checkbox_array = array();9495 foreach ( $values[‘choices’] as $key => $value ) {96 $new_value = isset( $_POST[ $values[‘id’] ][$key] ) ? ‘1’ : '0’;97 $checkbox_array[$key] = (string) sanitize_text_field( $new_value );98 }99100 $update_settings[ $values[‘id’] ] = $checkbox_array;101102 continue;103 }104105 $new_value = isset( $_POST[ $values[‘id’] ] ) ? $_POST[ $values[‘id’] ] : '’;106107 if ( $values[‘type’] === ‘textarea’ && isset( $values[‘allow_tags’] ) ) {108 $update_settings[ $values[‘id’] ] = (string) addslashes( wp_kses( stripslashes( $new_value ), AWS_Helpers::get_kses( $values[‘allow_tags’] ) ) );109 continue;110 }111112 if ( $values[‘type’] === ‘textarea’ ) {113 if ( function_exists(‘sanitize_textarea_field’) ) {114 $update_settings[ $values[‘id’] ] = (string) sanitize_textarea_field( $new_value );115 } else {116 $update_settings[ $values[‘id’] ] = (string) str_replace( "<\n", "<\n", wp_strip_all_tags( $new_value ) );117 }118 continue;119 }120121 $update_settings[ $values[‘id’] ] = (string) sanitize_text_field( $new_value );122123 if ( isset( $values[‘sub_option’] ) ) {124 $new_value = isset( $_POST[ $values[‘sub_option’][‘id’] ] ) ? $_POST[ $values[‘sub_option’][‘id’] ] : '’;125 $update_settings[ $values[‘sub_option’][‘id’] ] = (string) sanitize_text_field( $new_value );126 }127 }128129 update_option( 'aws_settings’, $update_settings );130131 AWS_Helpers::register_wpml_translations( $update_settings );132133 do_action( ‘aws_settings_saved’ );134135 do_action( ‘aws_cache_clear’ );136137 }138139 /*140 * Get plugin settings141 * @return array142 */143 static public function get_settings() {144 $plugin_options = get_option( ‘aws_settings’ );145 return $plugin_options;146 }147148 /*149 * Options array that generate settings page150 *151 * @param string $tab Tab name152 * @return array153 */154 static public function options_array( $tab = false ) {155156 $options = self::include_options();157 $options_arr = array();158159 foreach ( $options as $tab_name => $tab_options ) {160161 if ( $tab && $tab !== $tab_name ) {162 continue;163 }164165 $options_arr[$tab_name] = $tab_options;166167 }168169 /**170 * Filter admin page options for current page171 * @since 2.23172 * @param array $options_arr Array of options173 * @param bool|string $tab Current settings page tab174 */175 $options_arr = apply_filters( 'aws_admin_page_options_current’, $options_arr, $tab );176177 return $options_arr;178179 }180181 /*182 * Include options array183 * @return array184 */185 static public function include_options() {186187 $show_out_of_stock = ‘yes’ === get_option( ‘woocommerce_hide_out_of_stock_items’ ) ? ‘false’ : 'true’;188189 $options = array();190191 $options[‘general’][] = array(192 “name” => __( "Main Settings", “advanced-woo-search” ),193 “id” => "main",194 “type” => "heading"195 );196197 $options[‘general’][] = array(198 “name” => __( "Seamless integration", “advanced-woo-search” ),199 “desc” => __( "Replace all the standard search forms on your website ( may not work with some themes ).", “advanced-woo-search” ),200 “id” => "seamless",201 “value” => 'false’,202 “type” => "radio",203 ‘choices’ => array(204 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),205 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),206 )207 );208209 $options[‘general’][] = array(210 “name” => __( "Search in", “advanced-woo-search” ),211 “desc” => __( "Click on status icon to enable or disable search source.", “advanced-woo-search” ),212 “table_head” => __( 'Search Source’, ‘advanced-woo-search’ ),213 “id” => "search_in",214 “value” => array(215 ‘title’ => 1,216 ‘content’ => 1,217 ‘sku’ => 1,218 ‘excerpt’ => 1,219 ‘category’ => 0,220 ‘tag’ => 0,221 ‘id’ => 0,222 ),223 “choices” => array(224 “title” => __( "Title", “advanced-woo-search” ),225 “content” => __( "Content", “advanced-woo-search” ),226 “sku” => __( "SKU", “advanced-woo-search” ),227 “excerpt” => __( "Short description", “advanced-woo-search” ),228 “category” => __( "Category", “advanced-woo-search” ),229 “tag” => __( "Tag", “advanced-woo-search” ),230 “id” => __( "ID", “advanced-woo-search” ),231 ),232 “type” => "table"233 );234235 $options[‘general’][] = array(236 “name” => __( "Archive pages", “advanced-woo-search” ),237 “desc” => __( "Search for taxonomies and displayed their archive pages in search results.", “advanced-woo-search” ),238 ‘table_head’ => __( ‘Archive Pages’, ‘advanced-woo-search’ ),239 “id” => "search_archives",240 “value” => array(241 ‘archive_category’ => 0,242 ‘archive_tag’ => 0,243 ),244 “choices” => array(245 “archive_category” => __( "Category", “advanced-woo-search” ),246 “archive_tag” => __( "Tag", “advanced-woo-search” ),247 ),248 “type” => "table"249 );250251 $options[‘general’][] = array(252 “name” => __( "Stop words list", “advanced-woo-search” ),253 “desc” => __( "Comma separated list of words that will be excluded from search.", “advanced-woo-search” ) . ‘<br>’ . __( "Re-index required on change.", “advanced-woo-search” ),254 “id” => "stopwords",255 “value” => "a, also, am, an, and, are, as, at, be, but, by, call, can, co, con, de, do, due, eg, eight, etc, even, ever, every, for, from, full, go, had, has, hasnt, have, he, hence, her, here, his, how, ie, if, in, inc, into, is, it, its, ltd, me, my, no, none, nor, not, now, of, off, on, once, one, only, onto, or, our, ours, out, over, own, part, per, put, re, see, so, some, ten, than, that, the, their, there, these, they, this, three, thru, thus, to, too, top, un, up, us, very, via, was, we, well, were, what, when, where, who, why, will",256 “cols” => "85",257 “rows” => "3",258 “type” => "textarea"259 );260261 $options[‘general’][] = array(262 “name” => __( "Synonyms", “advanced-woo-search” ),263 “desc” => __( "Comma separated list of synonym words. Each group of synonyms must be on separated text line.", “advanced-woo-search” ) . ‘<br>’ . __( "Re-index required on change.", “advanced-woo-search” ),264 “id” => "synonyms",265 “value” => "buy, pay, purchase, acquire box, housing, unit, package",266 “cols” => "85",267 “rows” => "3",268 “type” => "textarea"269 );270271 $options[‘general’][] = array(272 “name” => __( "Use Google Analytics", “advanced-woo-search” ),273 “desc” => __( "Use google analytics to track searches. You need google analytics to be installed on your site.", “advanced-woo-search” ) .274 ‘<br>’ . sprintf( __( “Data will be visible inside Google Analytics ‘Site Search’ report. Need to activate ‘Site Search’ feature inside GA. %s", “advanced-woo-search” ), '<a href="https://advanced-woo-search.com/guide/google-analytics/” target="_blank">’ . __( 'More info’, ‘advanced-woo-search’ ) . ‘</a>’ ) .275 ‘<br>’ . __( "Also will send event with category - 'AWS search’, action - ‘AWS Search Term’ and label of value of search term.", “advanced-woo-search” ),276 “id” => "use_analytics",277 “value” => 'false’,278 “type” => "radio",279 ‘choices’ => array(280 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),281 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),282 )283 );284285 $options[‘general’][] = array(286 “name” => __( "Search results page", “advanced-woo-search” ),287 “type” => "heading"288 );289290 $options[‘general’][] = array(291 “name” => __( "Enable results page", “advanced-woo-search” ),292 “desc” => __( "Show plugin search results on a separated search results page. Will use your current theme products search results page template.", “advanced-woo-search” ),293 “id” => "search_page",294 “value” => 'true’,295 “type” => "radio",296 ‘choices’ => array(297 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),298 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),299 )300 );301302 $options[‘general’][] = array(303 “name” => __( "Max number of results", “advanced-woo-search” ),304 “desc” => __( "Maximal total number of search results. Larger values can lead to slower search speed.", “advanced-woo-search” ),305 “id” => "search_page_res_num",306 “value” => 100,307 “type” => "number"308 );309310 $options[‘general’][] = array(311 “name” => __( "Results per page", “advanced-woo-search” ),312 “desc” => __( "Number of search results per page. Empty or 0 - use theme default value.", “advanced-woo-search” ),313 “id” => "search_page_res_per_page",314 “value” => '’,315 “type” => "number"316 );317318 $options[‘general’][] = array(319 “name” => __( "Change query hook", “advanced-woo-search” ),320 “desc” => __( "If you have any problems with correct products results on the search results page - try to change this option.", “advanced-woo-search” ),321 “id” => "search_page_query",322 “value” => 'default’,323 “type” => "radio",324 ‘choices’ => array(325 ‘default’ => __( 'Default’, ‘advanced-woo-search’ ),326 ‘posts_pre_query’ => __( 'posts_pre_query’, ‘advanced-woo-search’ ),327 )328 );329330 $options[‘performance’][] = array(331 “name” => __( "Search options", “advanced-woo-search” ),332 “type” => "heading"333 );334335 $options[‘performance’][] = array(336 “name” => __( "Search rule", “advanced-woo-search” ),337 “desc” => __( "Search rule that will be used for terms search.", “advanced-woo-search” ),338 “id” => "search_rule",339 “value” => 'contains’,340 “type” => "radio",341 ‘choices’ => array(342 ‘contains’ => '%s% ' . __( "( contains ). Search query can be inside any part of the product words ( beginning, end, middle ). Slow.", “advanced-woo-search” ),343 ‘begins’ => 's% ' . __( "( begins ). Search query can be only at the beginning of the product words. Fast.", “advanced-woo-search” ),344 )345 );346347 $options[‘performance’][] = array(348 “name” => __( "AJAX timeout", “advanced-woo-search” ),349 “desc” => __( "Time after user input that script is waiting before sending a search event to the server, ms.", “advanced-woo-search” ),350 “id” => "search_timeout",351 “value” => 300,352 ‘min’ => 100,353 “type” => "number"354 );355356 $options[‘performance’][] = array(357 “name” => __( "Cache options", “advanced-woo-search” ),358 “type” => "heading"359 );360361 $options[‘performance’][] = array(362 “name” => __( "Cache results", “advanced-woo-search” ),363 “desc” => __( "Cache search results to increase search speed.", “advanced-woo-search” ) . ‘<br>’ .364 __( "Turn off if you have old data in the search results after the content of products was changed.", “advanced-woo-search” ),365 “id” => "cache",366 “value” => 'true’,367 “type” => "radio",368 ‘choices’ => array(369 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),370 ‘false’ => __( ‘Off’, ‘advanced-woo-search’ ),371 )372 );373374 $options[‘performance’][] = array(375 “name” => __( "Clear cache", “advanced-woo-search” ),376 “type” => “html",377 “desc” =>__( “Clear cache for all search results.", “advanced-woo-search” ),378 “html” => '<div id="aws-clear-cache"><input class="button” type="button” value="’ . esc_attr__( 'Clear cache’, ‘advanced-woo-search’ ) . '"><span class="loader"></span></div><br>’,379 );380381 $options[‘performance’][] = array(382 “name” => __( "Index table options", “advanced-woo-search” ),383 “id” => "index_sources",384 “type” => "heading"385 );386387 $options[‘performance’][] = array(388 “name” => __( "Overview", “advanced-woo-search” ),389 ‘heading_type’ => 'text’,390 ‘desc’ => __( 'To perform the search plugin use a special index table. This table contains normalized words of all your products from all available sources.’, “advanced-woo-search” ) . ‘<br>’ .391 __( 'Sometimes when there are too many products in your store index table can be very large and that can reflect on search speed.’, “advanced-woo-search” ) . ‘<br>’ .392 __( 'In this section you can use several options to change the table size by disabling some unused product data.’, “advanced-woo-search” ) . ‘<br>’ .393 ‘<b>’ . __( "Note:", “advanced-woo-search” ) . '</b> ' . __( "Reindex is required after options changes.", “advanced-woo-search” ),394 “type” => "heading"395 );396397 $options[‘performance’][] = array(398 “name” => __( "Data to index", “advanced-woo-search” ),399 “desc” => __( "Choose what products data to add inside the plugin index table.", “advanced-woo-search” ),400 “table_head” => __( 'What to index’, ‘advanced-woo-search’ ),401 “id” => "index_sources",402 “value” => array(403 ‘title’ => 1,404 ‘content’ => 1,405 ‘sku’ => 1,406 ‘excerpt’ => 1,407 ‘category’ => 1,408 ‘tag’ => 1,409 ‘id’ => 1,410 ),411 “choices” => array(412 “title” => __( "Title", “advanced-woo-search” ),413 “content” => __( "Content", “advanced-woo-search” ),414 “sku” => __( "SKU", “advanced-woo-search” ),415 “excerpt” => __( "Short description", “advanced-woo-search” ),416 “category” => __( "Category", “advanced-woo-search” ),417 “tag” => __( "Tag", “advanced-woo-search” ),418 “id” => __( "ID", “advanced-woo-search” ),419 ),420 “type” => "table"421 );422423 $options[‘performance’][] = array(424 “name” => __( "Index variations", “advanced-woo-search” ),425 “desc” => __( "Index or not content of product variations.", “advanced-woo-search” ),426 “id” => "index_variations",427 “value” => 'true’,428 “type” => "radio",429 ‘choices’ => array(430 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),431 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),432 )433 );434435 $options[‘performance’][] = array(436 “name” => __( "Sync index table", “advanced-woo-search” ),437 “desc” => __( "Automatically update plugin index table when product content was changed. This means that in search there will be always latest product data.", “advanced-woo-search” ) . ‘<br>’ .438 __( "Turn this off if you have any problems with performance.", “advanced-woo-search” ),439 “id” => "autoupdates",440 “value” => 'true’,441 “type” => "radio",442 ‘choices’ => array(443 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),444 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),445 )446 );447448 $options[‘performance’][] = array(449 “name” => __( "Run shortcodes", “advanced-woo-search” ),450 “desc” => __( "Execute or not any shortcodes inside product content.", “advanced-woo-search” ),451 “id” => "index_shortcodes",452 “value” => 'true’,453 “inherit” => "true",454 “type” => "radio",455 ‘choices’ => array(456 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),457 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),458 )459 );460461 // Search Form Settings462 $options[‘form’][] = array(463 “name” => __( "Text for search field", “advanced-woo-search” ),464 “desc” => __( "Text for search field placeholder.", “advanced-woo-search” ),465 “id” => "search_field_text",466 “value” => __( "Search", “advanced-woo-search” ),467 “type” => "text"468 );469470 $options[‘form’][] = array(471 “name” => __( "Text for show more button", “advanced-woo-search” ),472 “desc” => __( "Text for link to search results page at the bottom of search results block.", “advanced-woo-search” ),473 “id” => "show_more_text",474 “value” => __( "View all results", “advanced-woo-search” ),475 “type” => "text"476 );477478 $options[‘form’][] = array(479 “name” => __( "Nothing found field", “advanced-woo-search” ),480 “desc” => __( "Text when there is no search results.", “advanced-woo-search” ),481 “id” => "not_found_text",482 “value” => __( "Nothing found", “advanced-woo-search” ),483 “type” => "textarea",484 ‘allow_tags’ => array( 'a’, 'br’, 'em’, 'strong’, 'b’, 'code’, 'blockquote’, 'p’, ‘i’ )485 );486487 $options[‘form’][] = array(488 “name” => __( "Minimum number of characters", “advanced-woo-search” ),489 “desc” => __( "Minimum number of characters required to run ajax search.", “advanced-woo-search” ),490 “id” => "min_chars",491 “value” => 1,492 “type” => "number"493 );494495 $options[‘form’][] = array(496 “name” => __( "AJAX search", “advanced-woo-search” ),497 “desc” => __( "Use or not live search feature.", “advanced-woo-search” ),498 “id” => "enable_ajax",499 “value” => 'true’,500 “type” => "radio",501 ‘choices’ => array(502 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),503 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),504 )505 );506507 $options[‘form’][] = array(508 “name” => __( "Show loader", “advanced-woo-search” ),509 “desc” => __( "Show loader animation while searching.", “advanced-woo-search” ),510 “id” => "show_loader",511 “value” => 'true’,512 “type” => "radio",513 ‘choices’ => array(514 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),515 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),516 )517 );518519 $options[‘form’][] = array(520 “name” => __( "Show clear button", “advanced-woo-search” ),521 “desc” => __( "Show ‘Clear search string’ button for desktop devices ( for mobile it is always visible ).", “advanced-woo-search” ),522 “id” => "show_clear",523 “value” => 'true’,524 “type” => "radio",525 ‘choices’ => array(526 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),527 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),528 )529 );530531 $options[‘form’][] = array(532 “name” => __( "Show 'View All Results’", “advanced-woo-search” ),533 “desc” => __( "Show link to search results page at the bottom of search results block.", “advanced-woo-search” ),534 “id” => "show_more",535 “value” => 'true’,536 “type” => "radio",537 ‘choices’ => array(538 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),539 ‘false’ => __( 'Off’, ‘advanced-woo-search’ )540 )541 );542543 $options[‘form’][] = array(544 “name” => __( "Mobile full screen", “advanced-woo-search” ),545 “desc” => __( "Full screen search on focus. Will not work if the search form is inside the block with position: fixed.", “advanced-woo-search” ),546 “id” => "mobile_overlay",547 “value” => 'false’,548 “type” => "radio",549 ‘choices’ => array(550 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),551 ‘false’ => __( 'Off’, ‘advanced-woo-search’ )552 )553 );554555 $options[‘form’][] = array(556 “name” => __( "Form Styling", “advanced-woo-search” ),557 “desc” => __( "Choose search form layout", “advanced-woo-search” ) . ‘<br>’ . __( "Filter button will be visible only if you have more than one active filter for current search form instance.", “advanced-woo-search” ),558 “id” => "buttons_order",559 “value” => '1’,560 “type” => "radio-image",561 ‘choices’ => array(562 ‘1’ => 'btn-layout1.png’,563 ‘2’ => 'btn-layout2.png’,564 ‘3’ => 'btn-layout3.png’,565 )566 );567568 // Search Results Settings569 $options[‘results’][] = array(570 “name” => __( "Description source", “advanced-woo-search” ),571 “desc” => __( "From where to take product description.<br>If first source is empty data will be taken from other sources.", “advanced-woo-search” ),572 “id” => "desc_source",573 “value” => 'content’,574 “type” => "radio",575 ‘choices’ => array(576 ‘content’ => __( 'Content’, ‘advanced-woo-search’ ),577 ‘excerpt’ => __( 'Short description’, ‘advanced-woo-search’ ),578 )579 );580581 $options[‘results’][] = array(582 “name” => __( "Description content", “advanced-woo-search” ),583 “desc” => __( "What to show in product description?", “advanced-woo-search” ),584 “id” => "mark_words",585 “value” => 'true’,586 “type” => "radio",587 ‘choices’ => array(588 ‘true’ => __( "Smart scraping sentences with searching terms from product description.", “advanced-woo-search” ),589 ‘false’ => __( "First N words of product description ( number of words that you choose below. )", “advanced-woo-search” ),590 )591 );592593 $options[‘results’][] = array(594 “name” => __( "Description length", “advanced-woo-search” ),595 “desc” => __( "Maximal allowed number of words for product description.", “advanced-woo-search” ),596 “id” => "excerpt_length",597 “value” => 20,598 “type” => "number"599 );600601 $options[‘results’][] = array(602 “name” => __( "Products number", “advanced-woo-search” ),603 “desc” => __( "Maximum number of displayed products search results.", “advanced-woo-search” ),604 “id” => "results_num",605 “value” => 10,606 “type” => "number"607 );608609 $options[‘results’][] = array(610 “name” => __( "Archive pages number", “advanced-woo-search” ),611 “desc” => __( "Maximum number of displayed archive pages search results.", “advanced-woo-search” ),612 “id” => "pages_results_num",613 “value” => 10,614 “type” => "number"615 );616617 $options[‘results’][] = array(618 “name” => __( "Show out-of-stock", “advanced-woo-search” ),619 “desc” => __( "Show out-of-stock products in search", “advanced-woo-search” ),620 “id” => "outofstock",621 “value” => $show_out_of_stock,622 “type” => "radio",623 ‘choices’ => array(624 ‘true’ => __( 'Show’, ‘advanced-woo-search’ ),625 ‘false’ => __( 'Hide’, ‘advanced-woo-search’ ),626 )627 );628629 $options[‘results’][] = array(630 “name” => __( "View", “advanced-woo-search” ),631 “type” => "heading"632 );633634 $options[‘results’][] = array(635 “name” => __( "Highlight words", “advanced-woo-search” ),636 “desc” => __( "Highlight search words inside products content.", “advanced-woo-search” ),637 “id” => "highlight",638 “value” => 'true’,639 “type” => "radio",640 ‘choices’ => array(641 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),642 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),643 )644 );645646 $options[‘results’][] = array(647 “name” => __( "Show image", “advanced-woo-search” ),648 “desc” => __( "Show product image for each search result.", “advanced-woo-search” ),649 “id” => "show_image",650 “value” => 'true’,651 “type” => "radio",652 ‘choices’ => array(653 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),654 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),655 )656 );657658 $options[‘results’][] = array(659 “name” => __( "Show description", “advanced-woo-search” ),660 “desc” => __( "Show product description for each search result.", “advanced-woo-search” ),661 “id” => "show_excerpt",662 “value” => 'true’,663 “type” => "radio",664 ‘choices’ => array(665 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),666 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),667 )668 );669670 $options[‘results’][] = array(671 “name” => __( "Show price", “advanced-woo-search” ),672 “desc” => __( "Show product price for each search result.", “advanced-woo-search” ),673 “id” => "show_price",674 “value” => 'true’,675 “type” => "radio",676 ‘choices’ => array(677 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),678 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),679 )680 );681682 $options[‘results’][] = array(683 “name” => __( "Show price for out of stock", “advanced-woo-search” ),684 “desc” => __( "Show product price for out of stock products.", “advanced-woo-search” ),685 “id” => "show_outofstock_price",686 “value” => 'true’,687 “type” => "radio",688 ‘choices’ => array(689 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),690 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),691 )692 );693694 $options[‘results’][] = array(695 “name” => __( "Show sale badge", “advanced-woo-search” ),696 “desc” => __( "Show sale badge for products in search results.", “advanced-woo-search” ),697 “id” => "show_sale",698 “value” => 'true’,699 “type” => "radio",700 ‘choices’ => array(701 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),702 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),703 )704 );705706 $options[‘results’][] = array(707 “name” => __( "Show product SKU", “advanced-woo-search” ),708 “desc” => __( "Show product SKU in search results.", “advanced-woo-search” ),709 “id” => "show_sku",710 “value” => 'false’,711 “type” => "radio",712 ‘choices’ => array(713 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),714 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),715 )716 );717718 $options[‘results’][] = array(719 “name” => __( "Show stock status", “advanced-woo-search” ),720 “desc” => __( "Show stock status for every product in search results.", “advanced-woo-search” ),721 “id” => "show_stock",722 “value” => 'false’,723 “type” => "radio",724 ‘choices’ => array(725 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),726 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),727 )728 );729730 $options[‘results’][] = array(731 “name” => __( "Show featured icon", “advanced-woo-search” ),732 “desc” => __( "Show or not star icon for featured products.", “advanced-woo-search” ),733 “id” => "show_featured",734 “value” => 'false’,735 “type” => "radio",736 ‘choices’ => array(737 ‘true’ => __( 'On’, ‘advanced-woo-search’ ),738 ‘false’ => __( 'Off’, ‘advanced-woo-search’ ),739 )740 );741742 /**743 * Filter admin page options744 * @since 2.15745 * @param array $options Array of options746 */747 $options = apply_filters( 'aws_admin_page_options’, $options );748749 return $options;750751 }752753 }754755endif;