Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2023-2201: search_forms_manager.php in web-directory-free/tags/1.6.6/search/plugin/classes/search – WordPress Plugin Repository

The Web Directory Free for WordPress is vulnerable to SQL Injection via the ‘post_id’ parameter in versions up to, and including, 1.6.7 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for authenticated attackers with contributor-level privileges to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.

CVE
#sql#web#ios#js#wordpress#php#auth

1<?php 23global $wcsearch_model_options;4$wcsearch_model_options = array(5 ‘keywords’ => array(6 array(7 “type” => "string",8 “name” => "title",9 “title” => esc_html__("Title", “WCSEARCH”),10 “value” => esc_html__("Keywords", “WCSEARCH”),11 ),12 array(13 “type” => "string",14 “name” => "placeholder",15 “title” => esc_html__("Placeholder", “WCSEARCH”),16 “value” => esc_html__("Enter keywords", “WCSEARCH”),17 ),18 array(19 “type” => "select",20 “name” => "visible_status",21 “title” => esc_html__("Visible", “WCSEARCH”),22 “options” => array(23 “always_opened” => esc_html__("Always opened", “WCSEARCH”),24 “opened” => esc_html__("Opened", “WCSEARCH”),25 “closed” => esc_html__("Closed", “WCSEARCH”),26 “always_closed” => esc_html__("Always closed", “WCSEARCH”),27 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),28 ),29 “value” => "always_opened",30 ),31 array(32 “type” => "string",33 “name” => "try_to_search_text",34 “title” => esc_html__("Try to search text", “WCSEARCH”),35 “value” => esc_html__("Try to search", “WCSEARCH”),36 ),37 array(38 “type” => "string",39 “name” => "keywords_suggestions",40 “title” => esc_html__("Try to search", “WCSEARCH”),41 “description” => esc_html__("Comma-separated list of suggestions to try to search", “WCSEARCH”),42 “value” => "sport,business,event",43 ),44 array(45 “type” => "select",46 “name” => "autocomplete",47 “title” => esc_html__("Autocomplete field", “WCSEARCH”),48 “options” => array(49 “0” => esc_html__("No", “WCSEARCH”),50 “1” => esc_html__("Yes", “WCSEARCH”),51 ),52 “value” => "1",53 ),54 array(55 “type” => "select",56 “name” => "orderby",57 “title” => esc_html__("Order items", “WCSEARCH”),58 “options” => array(59 “relevance” => esc_html__("By relevance", “WCSEARCH”),60 “price” => esc_html__("By price", “WCSEARCH”),61 ),62 “value” => "relevance",63 “dependency” => array(‘autocomplete’ => 1),64 ),65 array(66 “type” => "select",67 “name” => "order",68 “title” => esc_html__("Order direction", “WCSEARCH”),69 “options” => array(70 “ASC” => esc_html__("ASC", “WCSEARCH”),71 “DESC” => esc_html__("DESC", “WCSEARCH”),72 ),73 “value” => "ASC",74 “dependency” => array(75 ‘autocomplete’ => 1,76 ‘orderby’ => 'price’77 ),78 ),79 array(80 “type” => "select",81 “name” => "do_links",82 “title” => esc_html__("Links to products in autocomplete suggestion", “WCSEARCH”),83 “options” => array(84 “0” => esc_html__("No", “WCSEARCH”),85 “1” => esc_html__("Yes", “WCSEARCH”),86 ),87 “value” => "1",88 “dependency” => array(‘autocomplete’ => 1),89 ),90 array(91 “type” => "select",92 “name” => "do_links_blank",93 “title” => esc_html__("How to open links", “WCSEARCH”),94 “options” => array(95 “blank” => esc_html__("Open in new window", “WCSEARCH”),96 “self” => esc_html__("Open in same window", “WCSEARCH”),97 ),98 “value” => "blank",99 “dependency” => array(‘autocomplete’ => 1, ‘do_links’ => ‘1’),100 ),101 ),102 ‘string’ => array(103 array(104 “type” => "string",105 “name” => "title",106 “title” => esc_html__("Title", “WCSEARCH”),107 “value” => "",108 ),109 array(110 “type” => "string",111 “name” => "placeholder",112 “title” => esc_html__("Placeholder", “WCSEARCH”),113 “value” => esc_html__("Enter keywords", “WCSEARCH”),114 ),115 array(116 “type” => "select",117 “name” => "visible_status",118 “title” => esc_html__("Visible", “WCSEARCH”),119 “options” => array(120 “always_opened” => esc_html__("Always opened", “WCSEARCH”),121 “opened” => esc_html__("Opened", “WCSEARCH”),122 “closed” => esc_html__("Closed", “WCSEARCH”),123 “always_closed” => esc_html__("Always closed", “WCSEARCH”),124 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),125 ),126 “value” => "always_opened",127 ),128 array(129 “type” => "string",130 “name” => "try_to_search_text",131 “title” => esc_html__("Try to search text", “WCSEARCH”),132 “value” => esc_html__("Try to search", “WCSEARCH”),133 ),134 array(135 “type” => "string",136 “name” => "keywords_suggestions",137 “title” => esc_html__("Try to search", “WCSEARCH”),138 “description” => esc_html__("Comma-separated list of suggestions to try to search", “WCSEARCH”),139 “value” => "sport,business,event",140 ),141 ),142 ‘address’ => array(143 array(144 “type” => "string",145 “name” => "title",146 “title” => esc_html__("Title", “WCSEARCH”),147 “value” => "",148 ),149 array(150 “type” => "string",151 “name” => "placeholder",152 “title” => esc_html__("Placeholder", “WCSEARCH”),153 “value” => esc_html__("Enter address", “WCSEARCH”),154 ),155 array(156 “type” => "select",157 “name” => "visible_status",158 “title” => esc_html__("Visible", “WCSEARCH”),159 “options” => array(160 “always_opened” => esc_html__("Always opened", “WCSEARCH”),161 “opened” => esc_html__("Opened", “WCSEARCH”),162 “closed” => esc_html__("Closed", “WCSEARCH”),163 “always_closed” => esc_html__("Always closed", “WCSEARCH”),164 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),165 ),166 “value” => "always_opened",167 ),168 array(169 “type” => "string",170 “name” => "try_to_search_text",171 “title” => esc_html__("Try to search text", “WCSEARCH”),172 “value” => esc_html__("Try to search", “WCSEARCH”),173 ),174 array(175 “type” => "string",176 “name” => "address_suggestions",177 “title” => esc_html__("Try to search", “WCSEARCH”),178 “description” => esc_html__("Comma-separated list of suggestions to try to search", “WCSEARCH”),179 “value” => "Los Angeles, US Capitol, Central Park NY",180 ),181 ),182 “price” => array(183 array(184 “type” => "string",185 “name” => "title",186 “title” => esc_html__("Title", “WCSEARCH”),187 “value” => "Price",188 ),189 array(190 “type” => "select",191 “name” => "visible_status",192 “title” => esc_html__("Visible", “WCSEARCH”),193 “options” => array(194 “always_opened” => esc_html__("Always opened", “WCSEARCH”),195 “opened” => esc_html__("Opened", “WCSEARCH”),196 “closed” => esc_html__("Closed", “WCSEARCH”),197 “always_closed” => esc_html__("Always closed", “WCSEARCH”),198 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),199 ),200 “value” => "always_opened",201 ),202 array(203 “type” => "select",204 “name” => "mode",205 “title” => esc_html__("Search mode", “WCSEARCH”),206 “options” => array(207 “range” => esc_html__("Range slider", “WCSEARCH”),208 “single_slider” => esc_html__("Single slider", “WCSEARCH”),209 “min_max_one_dropdown” => esc_html__("Min-max options in one dropdown", “WCSEARCH”),210 “min_max_two_dropdowns” => esc_html__("Min-max options in two dropdowns", “WCSEARCH”),211 “radios” => esc_html__("Min-max options in radios", “WCSEARCH”),212 “inputs” => esc_html__("Two inputs", “WCSEARCH”),213 ),214 “value” => "range",215 ),216 array(217 “type” => "string",218 “name” => "placeholder_single_dropdown",219 “title” => esc_html__("Placeholder min", “WCSEARCH”),220 “value” => esc_html__("Select price range", “WCSEARCH”),221 “dependency” => array(‘mode’ => ‘min_max_one_dropdown’),222 ),223 array(224 “type” => "string",225 “name” => "placeholder_min",226 “title” => esc_html__("Placeholder min", “WCSEARCH”),227 “value” => esc_html__("Select min price", “WCSEARCH”),228 “dependency” => array(‘mode’ => ‘min_max_two_dropdowns,inputs’),229 ),230 array(231 “type” => "string",232 “name” => "placeholder_max",233 “title” => esc_html__("Placeholder max", “WCSEARCH”),234 “value” => esc_html__("Select max price", “WCSEARCH”),235 “dependency” => array(‘mode’ => ‘min_max_two_dropdowns,inputs’),236 ),237 array(238 “type” => "select",239 “name” => "show_scale",240 “title” => esc_html__("Show scale", “WCSEARCH”),241 “options” => array(242 “scale” => esc_html__("Show scale", “WCSEARCH”),243 “string” => esc_html__("Show as string", “WCSEARCH”),244 ),245 “value” => "string",246 “dependency” => array(‘mode’ => ‘range,single_slider’),247 ),248 array(249 “type” => "select",250 “name” => "odd_even_labels",251 “title” => esc_html__("Scale labels", “WCSEARCH”),252 “options” => array(253 “odd_even” => esc_html__("Odd and even labels", “WCSEARCH”),254 “odd” => esc_html__("Only odd labels", “WCSEARCH”),255 ),256 “value” => "odd",257 “dependency” => array(‘show_scale’ => ‘scale’),258 ),259 array(260 “type” => "select",261 “name” => "columns",262 “title” => esc_html__("Radios columns", “WCSEARCH”),263 “description” => esc_html__("When radio buttons is used in search mode", “WCSEARCH”),264 “options” => array(265 1 => 1,266 2 => 2,267 3 => 3,268 4 => 4,269 5 => 5,270 ),271 “value” => 2,272 “dependency” => array(‘mode’ => ‘radios’),273 ),274 array(275 “type” => "select",276 “name” => "counter",277 “title” => esc_html__("Show counter", “WCSEARCH”),278 “options” => array(279 “0” => esc_html__("No", “WCSEARCH”),280 “1” => esc_html__("Yes", “WCSEARCH”),281 ),282 “value” => "1",283 “dependency” => array(‘mode’ => ‘radios’),284 ),285 array(286 “type” => "string",287 “name” => "min_max_options",288 “title” => esc_html__("Min-Max options", “WCSEARCH”),289 “description” => "Example: 1,5,10,15,20 or 1-20",290 “value” => “",291 //"value” => "min, 1, 10, 50, 100, 500, 1000, max",292 “dependency” => array(‘mode’ => ‘range,single_slider,min_max_one_dropdown,min_max_two_dropdowns,radios’),293 ),294 array(295 “type” => "dependency",296 “name” => "dependency_tax",297 “title” => esc_html__("Dependency", “WCSEARCH”),298 “description” => esc_html__("The field will be dependent from selected tax", “WCSEARCH”),299 “options” => array(300 0 => esc_html__("No dependency", “WCSEARCH”),301 ),302 ),303 array(304 “type” => "select",305 “name” => "dependency_visibility",306 “title” => esc_html__("Dependency visibility", “WCSEARCH”),307 “options” => array(308 “0” => esc_html__("Hidden", “WCSEARCH”),309 “1” => esc_html__("Shaded", “WCSEARCH”),310 ),311 “value” => "1",312 “dependency” => array(“dependency_tax” => “”),313 ),314 ),315 “number” => array(316 array(317 “type” => "string",318 “name” => "title",319 “title” => esc_html__("Title", “WCSEARCH”),320 “value” => "Number",321 ),322 array(323 “type” => "select",324 “name” => "visible_status",325 “title” => esc_html__("Visible", “WCSEARCH”),326 “options” => array(327 “always_opened” => esc_html__("Always opened", “WCSEARCH”),328 “opened” => esc_html__("Opened", “WCSEARCH”),329 “closed” => esc_html__("Closed", “WCSEARCH”),330 “always_closed” => esc_html__("Always closed", “WCSEARCH”),331 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),332 ),333 “value” => "always_opened",334 ),335 array(336 “type” => "select",337 “name” => "mode",338 “title” => esc_html__("Search mode", “WCSEARCH”),339 “options” => array(340 “range” => esc_html__("Range slider", “WCSEARCH”),341 “single_slider” => esc_html__("Single slider", “WCSEARCH”),342 “min_max_one_dropdown” => esc_html__("Min-max options in one dropdown", “WCSEARCH”),343 “min_max_two_dropdowns” => esc_html__("Min-max options in two dropdowns", “WCSEARCH”),344 “radios” => esc_html__("Min-max options in radios", “WCSEARCH”),345 “inputs” => esc_html__("Two inputs", “WCSEARCH”),346 ),347 “value” => "range",348 ),349 array(350 “type” => "string",351 “name” => "placeholder_single_dropdown",352 “title” => esc_html__("Placeholder min", “WCSEARCH”),353 “value” => esc_html__("Select range", “WCSEARCH”),354 “dependency” => array(‘mode’ => ‘min_max_one_dropdown’),355 ),356 array(357 “type” => "string",358 “name” => "placeholder_min",359 “title” => esc_html__("Placeholder min", “WCSEARCH”),360 “value” => esc_html__("Select min", “WCSEARCH”),361 “dependency” => array(‘mode’ => ‘min_max_two_dropdowns,inputs’),362 ),363 array(364 “type” => "string",365 “name” => "placeholder_max",366 “title” => esc_html__("Placeholder max", “WCSEARCH”),367 “value” => esc_html__("Select max", “WCSEARCH”),368 “dependency” => array(‘mode’ => ‘min_max_two_dropdowns,inputs’),369 ),370 array(371 “type” => "select",372 “name” => "show_scale",373 “title” => esc_html__("Show scale", “WCSEARCH”),374 “options” => array(375 “scale” => esc_html__("Show scale", “WCSEARCH”),376 “string” => esc_html__("Show as string", “WCSEARCH”),377 ),378 “value” => "string",379 “dependency” => array(‘mode’ => ‘range’),380 ),381 array(382 “type” => "select",383 “name” => "odd_even_labels",384 “title” => esc_html__("Scale labels", “WCSEARCH”),385 “options” => array(386 “odd_even” => esc_html__("Odd and even labels", “WCSEARCH”),387 “odd” => esc_html__("Only odd labels", “WCSEARCH”),388 ),389 “value” => "odd",390 “dependency” => array(‘show_scale’ => ‘scale’),391 ),392 array(393 “type” => "select",394 “name” => "columns",395 “title” => esc_html__("Radios columns", “WCSEARCH”),396 “description” => esc_html__("When radio buttons is used in search mode", “WCSEARCH”),397 “options” => array(398 1 => 1,399 2 => 2,400 3 => 3,401 4 => 4,402 5 => 5,403 ),404 “value” => 2,405 “dependency” => array(‘mode’ => ‘radios’),406 ),407 array(408 “type” => "select",409 “name” => "counter",410 “title” => esc_html__("Show counter", “WCSEARCH”),411 “options” => array(412 “0” => esc_html__("No", “WCSEARCH”),413 “1” => esc_html__("Yes", “WCSEARCH”),414 ),415 “value” => "1",416 “dependency” => array(‘mode’ => ‘radios’),417 ),418 array(419 “type” => "string",420 “name” => "min_max_options",421 “title” => esc_html__("Min-Max options", “WCSEARCH”),422 “description” => "Example: 1,5,10,15,20 or 1-20",423 “value” => “",424 //"value” => "min, 1, 10, 50, 100, 500, 1000, max",425 ),426 array(427 “type” => "dependency",428 “name” => "dependency_tax",429 “title” => esc_html__("Dependency", “WCSEARCH”),430 “description” => esc_html__("The field will be dependent from selected tax", “WCSEARCH”),431 “options” => array(432 0 => esc_html__("No dependency", “WCSEARCH”),433 ),434 ),435 array(436 “type” => "select",437 “name” => "dependency_visibility",438 “title” => esc_html__("Dependency visibility", “WCSEARCH”),439 “options” => array(440 “0” => esc_html__("Hidden", “WCSEARCH”),441 “1” => esc_html__("Shaded", “WCSEARCH”),442 ),443 “value” => "1",444 “dependency” => array(“dependency_tax” => “”),445 ),446 ),447 “date” => array(448 array(449 “type” => "string",450 “name” => "title",451 “title” => esc_html__("Title", “WCSEARCH”),452 “value” => "Date",453 ),454 array(455 “type” => "select",456 “name” => "visible_status",457 “title” => esc_html__("Visible", “WCSEARCH”),458 “options” => array(459 “always_opened” => esc_html__("Always opened", “WCSEARCH”),460 “opened” => esc_html__("Opened", “WCSEARCH”),461 “closed” => esc_html__("Closed", “WCSEARCH”),462 “always_closed” => esc_html__("Always closed", “WCSEARCH”),463 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),464 ),465 “value” => "always_opened",466 ),467 array(468 “type” => "string",469 “name” => "placeholder_start",470 “title” => esc_html__("Placeholder start", “WCSEARCH”),471 “value” => esc_html__("Select start date", “WCSEARCH”),472 ),473 array(474 “type” => "string",475 “name” => "placeholder_end",476 “title” => esc_html__("Placeholder end", “WCSEARCH”),477 “value” => esc_html__("Select end date", “WCSEARCH”),478 ),479 array(480 “type” => "string",481 “name” => "reset_label_text",482 “title” => esc_html__("Reset text", “WCSEARCH”),483 “value” => esc_html__("reset", “WCSEARCH”),484 ),485 array(486 “type” => "select",487 “name” => "view",488 “title” => esc_html__("Show fields", “WCSEARCH”),489 “options” => array(490 “vertically” => esc_html__("Vertically", “WCSEARCH”),491 “horizontally” => esc_html__("Horizontally", “WCSEARCH”),492 ),493 “value” => "vertically",494 ),495 array(496 “type” => "dependency",497 “name” => "dependency_tax",498 “title” => esc_html__("Dependency", “WCSEARCH”),499 “description” => esc_html__("The field will be dependent from selected tax", “WCSEARCH”),500 “options” => array(501 0 => esc_html__("No dependency", “WCSEARCH”),502 ),503 ),504 array(505 “type” => "select",506 “name” => "dependency_visibility",507 “title” => esc_html__("Dependency visibility", “WCSEARCH”),508 “options” => array(509 “0” => esc_html__("Hidden", “WCSEARCH”),510 “1” => esc_html__("Shaded", “WCSEARCH”),511 ),512 “value” => "1",513 “dependency” => array(“dependency_tax” => “”),514 ),515 ),516 “radius” => array(517 array(518 “type” => "string",519 “name” => "title",520 “title” => esc_html__("Title", “WCSEARCH”),521 “value” => "Radius",522 ),523 array(524 “type” => "select",525 “name” => "visible_status",526 “title” => esc_html__("Visible", “WCSEARCH”),527 “options” => array(528 “always_opened” => esc_html__("Always opened", “WCSEARCH”),529 “opened” => esc_html__("Opened", “WCSEARCH”),530 “closed” => esc_html__("Closed", “WCSEARCH”),531 “always_closed” => esc_html__("Always closed", “WCSEARCH”),532 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),533 ),534 “value” => "always_opened",535 ),536 array(537 “type” => "select",538 “name” => "show_scale",539 “title” => esc_html__("Show scale", “WCSEARCH”),540 “options” => array(541 “scale” => esc_html__("Show scale", “WCSEARCH”),542 “string” => esc_html__("Show as string", “WCSEARCH”),543 ),544 “value” => "string",545 ),546 array(547 “type” => "select",548 “name” => "odd_even_labels",549 “title” => esc_html__("Scale labels", “WCSEARCH”),550 “options” => array(551 “odd_even” => esc_html__("Odd and even labels", “WCSEARCH”),552 “odd” => esc_html__("Only odd labels", “WCSEARCH”),553 ),554 “value” => "odd",555 “dependency” => array(‘show_scale’ => ‘scale’),556 ),557 array(558 “type” => "string",559 “name” => "string_label",560 “title” => esc_html__("Label", “WCSEARCH”),561 “description” => "Example: Search in radius",562 “value” => "Search in radius",563 ),564 array(565 “type” => "string",566 “name” => "min_max_options",567 “title” => esc_html__("Min-Max options", “WCSEARCH”),568 “description” => "Example: 1,5,10,15,20 or 0-20",569 “value” => "0-30",570 ),571 array(572 “type” => "dependency",573 “name” => "dependency_tax",574 “title” => esc_html__("Dependency", “WCSEARCH”),575 “description” => esc_html__("The field will be dependent from selected tax", “WCSEARCH”),576 “options” => array(577 0 => esc_html__("No dependency", “WCSEARCH”),578 ),579 ),580 array(581 “type” => "select",582 “name” => "dependency_visibility",583 “title” => esc_html__("Dependency visibility", “WCSEARCH”),584 “options” => array(585 “0” => esc_html__("Hidden", “WCSEARCH”),586 “1” => esc_html__("Shaded", “WCSEARCH”),587 ),588 “value” => "1",589 “dependency” => array(“dependency_tax” => “”),590 ),591 ),592 “button” => array(593 array(594 “type” => "string",595 “name” => "text",596 “title” => esc_html__("Button text", “WCSEARCH”),597 “value” => esc_html__("Search", “WCSEARCH”),598 ),599 ),600 “reset” => array(601 array(602 “type” => "string",603 “name” => "text",604 “title” => esc_html__("Reset text", “WCSEARCH”),605 “value” => esc_html__("Reset", “WCSEARCH”),606 ),607 ),608 “more_filters” => array(609 array(610 “type” => "string",611 “name” => "text",612 “title” => esc_html__("Text", “WCSEARCH”),613 “value” => esc_html__("More filters", “WCSEARCH”),614 ),615 array(616 “type” => "select",617 “name” => "open_by_default",618 “title” => esc_html__("Opened by default", “WCSEARCH”),619 “options” => array(620 “0” => esc_html__("No", “WCSEARCH”),621 “1” => esc_html__("Yes", “WCSEARCH”),622 ),623 “value” => "0",624 ),625 ),626 “tax” => array(627 array(628 “type” => "string",629 “name” => "title",630 “title” => esc_html__("Title", “WCSEARCH”),631 “value” => esc_html__("Title", “WCSEARCH”),632 ),633 array(634 “type” => "select",635 “name” => "visible_status",636 “title” => esc_html__("Visible", “WCSEARCH”),637 “options” => array(638 “always_opened” => esc_html__("Always opened", “WCSEARCH”),639 “opened” => esc_html__("Opened", “WCSEARCH”),640 “closed” => esc_html__("Closed", “WCSEARCH”),641 “always_closed” => esc_html__("Always closed", “WCSEARCH”),642 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),643 ),644 “value” => "always_opened",645 ),646 array(647 “type” => "select",648 “name” => "mode",649 “title” => esc_html__("Search mode", “WCSEARCH”),650 “options” => array(651 “dropdown” => esc_html__("Single dropdown", “WCSEARCH”),652 “dropdown_keywords” => esc_html__("Single dropdown + keywords", “WCSEARCH”),653 “hierarhical_dropdown” => esc_html__("Heirarhical dropdown", “WCSEARCH”),654 “multi_dropdown” => esc_html__("Multi dropdown", “WCSEARCH”),655 “radios” => esc_html__("Radios", “WCSEARCH”),656 “radios_buttons” => esc_html__("Radio buttons", “WCSEARCH”),657 “checkboxes” => esc_html__("Checkboxes", “WCSEARCH”),658 “checkboxes_buttons” => esc_html__("Checkboxes buttons", “WCSEARCH”),659 “range” => esc_html__("Range slider", “WCSEARCH”),660 “single_slider” => esc_html__("Single slider", “WCSEARCH”),661 ),662 “value” => "dropdown",663 ),664 array(665 “type” => "string",666 “name” => "placeholder",667 “title” => esc_html__("Placeholder", “WCSEARCH”),668 “value” => "",669 “dependency” => array(‘mode’ => ‘dropdown,dropdown_keywords,dropdown_address,multi_dropdown’),670 ),671 array(672 “type” => "string",673 “name” => “placeholders",674 “title” => esc_html__(“Placeholder", “WCSEARCH”),675 //"value” => array(“”),676 //"multi” => 1,677 “dependency” => array(‘mode’ => ‘hierarhical_dropdown’),678 ),679 array(680 “type” => "string",681 “name” => "try_to_search_text",682 “title” => esc_html__("Try to search text", “WCSEARCH”),683 “value” => esc_html__("Try to search", “WCSEARCH”),684 “dependency” => array(‘mode’ => ‘dropdown_address,dropdown_keywords’),685 ),686 array(687 “type” => "string",688 “name” => "address_suggestions",689 “title” => esc_html__("Try to search", “WCSEARCH”),690 “description” => esc_html__("Comma-separated list of suggestions to try to search", “WCSEARCH”),691 “value” => "Los Angeles, US Capitol, Central Park NY",692 “dependency” => array(‘mode’ => ‘dropdown_address’),693 ),694 array(695 “type” => "string",696 “name” => "keywords_suggestions",697 “title” => esc_html__("Try to search", “WCSEARCH”),698 “description” => esc_html__("Comma-separated list of suggestions to try to search", “WCSEARCH”),699 “value” => "sport,business,event",700 “dependency” => array(‘mode’ => ‘dropdown_keywords’),701 ),702 array(703 “type” => "select",704 “name” => "do_links",705 “title” => esc_html__("Links to products in autocomplete suggestion", “WCSEARCH”),706 “options” => array(707 “0” => esc_html__("No", “WCSEARCH”),708 “1” => esc_html__("Yes", “WCSEARCH”),709 ),710 “value” => "1",711 “dependency” => array(‘mode’ => ‘dropdown_keywords’),712 ),713 array(714 “type” => "select",715 “name” => "do_links_blank",716 “title” => esc_html__("How to open links", “WCSEARCH”),717 “options” => array(718 “blank” => esc_html__("Open in new window", “WCSEARCH”),719 “self” => esc_html__("Open in same window", “WCSEARCH”),720 ),721 “value” => "blank",722 “dependency” => array(‘mode’ => 'dropdown_keywords’, ‘do_links’ => ‘1’),723 ),724 array(725 “type” => "select",726 “name” => "relation",727 “title” => esc_html__("Relation", “WCSEARCH”),728 “options” => array(729 “OR” => "OR",730 “AND” => "AND",731 ),732 “value” => "OR",733 “dependency” => array(‘mode’ => ‘multi_dropdown,checkboxes,checkboxes_buttons’),734 ),735 array(736 “type” => "select",737 “name” => "depth",738 “title” => esc_html__("Max depth level", “WCSEARCH”),739 “options” => array(740 “1” => "1",741 “2” => "2",742 “3” => "3",743 ),744 “value” => 1,745 “dependency” => array(‘mode’ => ‘dropdown,dropdown_address,dropdown_keywords,multi_dropdown,radios,radios_buttons,checkboxes,checkboxes_buttons’),746 ),747 array(748 “type” => "select",749 “name” => "open_on_click",750 “title” => esc_html__("Open on click", “WCSEARCH”),751 “options” => array(752 “0” => esc_html__("No", “WCSEARCH”),753 “1” => esc_html__("Yes", “WCSEARCH”),754 ),755 “value” => 1,756 “dependency” => array(‘mode’ => ‘dropdown,dropdown_address,dropdown_keywords’),757 ),758 array(759 “type” => "select",760 “name” => "columns",761 “title” => esc_html__("Columns", “WCSEARCH”),762 “options” => array(763 1 => 1,764 2 => 2,765 3 => 3,766 4 => 4,767 5 => 5,768 ),769 “value” => 2,770 “dependency” => array(‘mode’ => ‘radios,radios_buttons,checkboxes,checkboxes_buttons’),771 ),772 array(773 “type” => "string",774 “name” => "height_limit",775 “title” => esc_html__("Cut long-list items by height (in pixels)", “WCSEARCH”),776 “value” => 280,777 “dependency” => array(‘mode’ => ‘radios,radios_buttons,checkboxes,checkboxes_buttons’),778 ),779 array(780 “type” => "select",781 “name” => "how_to_limit",782 “title” => esc_html__("How to cut long-list items", “WCSEARCH”),783 “options” => array(784 “show_more_less” => esc_html__("Show all/hide and scroll", “WCSEARCH”),785 “use_scroll” => esc_html__("Use only scroll", “WCSEARCH”),786 ),787 “value” => "show_more_less",788 “dependency” => array(‘mode’ => ‘radios,radios_buttons,checkboxes,checkboxes_buttons’),789 ),790 array(791 “type” => "string",792 “name” => "text_open",793 “title” => esc_html__("Text to open new items", “WCSEARCH”),794 “value” => esc_html__(“show all”),795 “dependency” => array(‘mode’ => 'radios,radios_buttons,checkboxes,checkboxes_buttons’, ‘how_to_limit’ => ‘show_more_less’),796 ),797 array(798 “type” => "string",799 “name” => "text_close",800 “title” => esc_html__("Text to hide", “WCSEARCH”),801 “value” => esc_html__(“hide”),802 “dependency” => array(‘mode’ => 'radios,radios_buttons,checkboxes,checkboxes_buttons’, ‘how_to_limit’ => ‘show_more_less’),803 ),804 array(805 “type” => "select",806 “name” => "use_pointer",807 “title” => esc_html__("Use floating pointer", “WCSEARCH”),808 “options” => array(809 “0” => esc_html__("No", “WCSEARCH”),810 “1” => esc_html__("Yes", “WCSEARCH”),811 ),812 “value” => "0",813 “dependency” => array(‘mode’ => ‘radios,radios_buttons,checkboxes,checkboxes_buttons’),814 ),815 array(816 “type” => "select",817 “name” => "orderby",818 “title” => esc_html__("Order terms", “WCSEARCH”),819 “options” => array(820 “menu_order” => esc_html__("By default", “WCSEARCH”),821 “name” => esc_html__("By name", “WCSEARCH”),822 “count” => esc_html__("By count", “WCSEARCH”),823 ),824 “value” => "menu_order",825 “dependency” => array(‘mode’ => ‘dropdown,dropdown_address,dropdown_keywords,hierarhical_dropdown,multi_dropdown,radios,radios_buttons,checkboxes,checkboxes_buttons,range,single_slider’),826 ),827 array(828 “type” => "select",829 “name” => "order",830 “title” => esc_html__("Order direction", “WCSEARCH”),831 “options” => array(832 “ASC” => esc_html__("ASC", “WCSEARCH”),833 “DESC” => esc_html__("DESC", “WCSEARCH”),834 ),835 “value” => "ASC",836 “dependency” => array(837 ‘mode’ => 'dropdown,dropdown_address,dropdown_keywords,hierarhical_dropdown,multi_dropdown,radios,radios_buttons,checkboxes,checkboxes_buttons,range,single_slider’,838 ‘orderby’ => 'name,count’,839 ),840 ),841 array(842 “type” => "select",843 “name” => "hide_empty",844 “title” => esc_html__("Hide empty", “WCSEARCH”),845 “options” => array(846 “0” => esc_html__("No", “WCSEARCH”),847 “1” => esc_html__("Yes", “WCSEARCH”),848 ),849 “value” => "0",850 ),851 array(852 “type” => "select",853 “name” => "counter",854 “title” => esc_html__("Show counter", “WCSEARCH”),855 “options” => array(856 “0” => esc_html__("No", “WCSEARCH”),857 “1” => esc_html__("Yes", “WCSEARCH”),858 ),859 “value” => "1",860 “dependency” => array(‘mode’ => ‘dropdown,dropdown_address,dropdown_keywords,hierarhical_dropdown,multi_dropdown,radios,radios_buttons,checkboxes,checkboxes_buttons’),861 ),862 array(863 “type” => "exact_terms",864 “name” => "is_exact_terms",865 “title” => esc_html__("Set specific terms", “WCSEARCH”),866 “description” => esc_html__("Show all terms or select specific (dependent on max depth level)", “WCSEARCH”),867 “options” => array(868 0 => esc_html__("All terms", “WCSEARCH”),869 1 => esc_html__("Specific terms", “WCSEARCH”),870 ),871 ),872 array(873 “type” => "dependency",874 “name” => "dependency_tax",875 “title” => esc_html__("Dependency", “WCSEARCH”),876 “description” => esc_html__("The field will be dependent from selected tax", “WCSEARCH”),877 “options” => array(878 0 => esc_html__("No dependency", “WCSEARCH”),879 ),880 ),881 array(882 “type” => "select",883 “name” => "dependency_visibility",884 “title” => esc_html__("Dependency visibility", “WCSEARCH”),885 “options” => array(886 “0” => esc_html__("Hidden", “WCSEARCH”),887 “1” => esc_html__("Shaded", “WCSEARCH”),888 ),889 “value” => "1",890 “dependency” => array(“dependency_tax” => “”),891 ),892 array(893 “type” => "hidden",894 “name” => "terms_options",895 “value” => "",896 ),897 ),898 “select” => array(899 array(900 “type” => "string",901 “name” => "title",902 “title” => esc_html__("Title", “WCSEARCH”),903 “value” => esc_html__("Title", “WCSEARCH”),904 ),905 array(906 “type” => "select",907 “name” => "visible_status",908 “title” => esc_html__("Visible", “WCSEARCH”),909 “options” => array(910 “always_opened” => esc_html__("Always opened", “WCSEARCH”),911 “opened” => esc_html__("Opened", “WCSEARCH”),912 “closed” => esc_html__("Closed", “WCSEARCH”),913 “always_closed” => esc_html__("Always closed", “WCSEARCH”),914 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),915 ),916 “value” => "always_opened",917 ),918 array(919 “type” => "select",920 “name” => "mode",921 “title” => esc_html__("Search mode", “WCSEARCH”),922 “options” => array(923 “dropdown” => esc_html__("Single dropdown", “WCSEARCH”),924 “dropdown_keywords” => esc_html__("Single dropdown + keywords", “WCSEARCH”),925 “multi_dropdown” => esc_html__("Multi dropdown", “WCSEARCH”),926 “radios” => esc_html__("Radios", “WCSEARCH”),927 “radios_buttons” => esc_html__("Radio buttons", “WCSEARCH”),928 “checkboxes” => esc_html__("Checkboxes", “WCSEARCH”),929 “checkboxes_buttons” => esc_html__("Checkboxes buttons", “WCSEARCH”),930 “range” => esc_html__("Range slider", “WCSEARCH”),931 “single_slider” => esc_html__("Single slider", “WCSEARCH”),932 ),933 “value” => "dropdown",934 ),935 array(936 “type” => "string",937 “name” => "try_to_search_text",938 “title” => esc_html__("Try to search text", “WCSEARCH”),939 “value” => esc_html__("Try to search", “WCSEARCH”),940 ),941 array(942 “type” => "string",943 “name” => "placeholder",944 “title” => esc_html__("Placeholder", “WCSEARCH”),945 “value” => "",946 “dependency” => array(‘mode’ => ‘dropdown,dropdown_keywords,dropdown_address,hierarhical_dropdown,multi_dropdown’),947 ),948 array(949 “type” => "string",950 “name” => "address_suggestions",951 “title” => esc_html__("Try to search", “WCSEARCH”),952 “description” => esc_html__("Comma-separated list of suggestions to try to search", “WCSEARCH”),953 “value” => "Los Angeles, US Capitol, Central Park NY",954 “dependency” => array(‘mode’ => ‘dropdown_address’),955 ),956 array(957 “type” => "string",958 “name” => "keywords_suggestions",959 “title” => esc_html__("Try to search", “WCSEARCH”),960 “description” => esc_html__("Comma-separated list of suggestions to try to search", “WCSEARCH”),961 “value” => "sport,business,event",962 “dependency” => array(‘mode’ => ‘dropdown_keywords’),963 ),964 array(965 “type” => "select",966 “name” => "relation",967 “title” => esc_html__("Relation", “WCSEARCH”),968 “options” => array(969 “OR” => "OR",970 “AND” => "AND",971 ),972 “value” => "OR",973 “dependency” => array(‘mode’ => ‘multi_dropdown,checkboxes,checkboxes_buttons’),974 ),975 array(976 “type” => "select",977 “name” => "open_on_click",978 “title” => esc_html__("Open on click", “WCSEARCH”),979 “options” => array(980 “0” => esc_html__("No", “WCSEARCH”),981 “1” => esc_html__("Yes", “WCSEARCH”),982 ),983 “value” => 1,984 “dependency” => array(‘mode’ => ‘dropdown,dropdown_address,dropdown_keywords’),985 ),986 array(987 “type” => "select",988 “name” => "columns",989 “title” => esc_html__("Columns", “WCSEARCH”),990 “options” => array(991 1 => 1,992 2 => 2,993 3 => 3,994 4 => 4,995 5 => 5,996 ),997 “value” => 2,998 “dependency” => array(‘mode’ => ‘radios,radios_buttons,checkboxes,checkboxes_buttons’),999 ),1000 array(1001 “type” => "string",1002 “name” => "height_limit",1003 “title” => esc_html__("Cut long-list items by height (in pixels)", “WCSEARCH”),1004 “value” => 280,1005 “dependency” => array(‘mode’ => ‘radios,radios_buttons,checkboxes,checkboxes_buttons’),1006 ),1007 array(1008 “type” => "select",1009 “name” => "how_to_limit",1010 “title” => esc_html__("How to cut long-list items", “WCSEARCH”),1011 “options” => array(1012 “show_more_less” => esc_html__("Show all/hide and scroll", “WCSEARCH”),1013 “use_scroll” => esc_html__("Use only scroll", “WCSEARCH”),1014 ),1015 “value” => "show_more_less",1016 “dependency” => array(‘mode’ => ‘radios,radios_buttons,checkboxes,checkboxes_buttons’),1017 ),1018 array(1019 “type” => "string",1020 “name” => "text_open",1021 “title” => esc_html__("Text to open new items", “WCSEARCH”),1022 “value” => esc_html__(“show all”),1023 “dependency” => array(‘mode’ => 'radios,radios_buttons,checkboxes,checkboxes_buttons’, ‘how_to_limit’ => ‘show_more_less’),1024 ),1025 array(1026 “type” => "string",1027 “name” => "text_close",1028 “title” => esc_html__("Text to hide", “WCSEARCH”),1029 “value” => esc_html__(“hide”),1030 “dependency” => array(‘mode’ => 'radios,radios_buttons,checkboxes,checkboxes_buttons’, ‘how_to_limit’ => ‘show_more_less’),1031 ),1032 array(1033 “type” => "select",1034 “name” => "use_pointer",1035 “title” => esc_html__("Use floating pointer", “WCSEARCH”),1036 “options” => array(1037 “0” => esc_html__("No", “WCSEARCH”),1038 “1” => esc_html__("Yes", “WCSEARCH”),1039 ),1040 “value” => "0",1041 “dependency” => array(‘mode’ => ‘radios,radios_buttons,checkboxes,checkboxes_buttons’),1042 ),1043 array(1044 “type” => "select",1045 “name” => "orderby",1046 “title” => esc_html__("Order terms", “WCSEARCH”),1047 “options” => array(1048 “menu_order” => esc_html__("By default", “WCSEARCH”),1049 “name” => esc_html__("By name", “WCSEARCH”),1050 “count” => esc_html__("By count", “WCSEARCH”),1051 ),1052 “value” => "menu_order",1053 “dependency” => array(‘mode’ => ‘dropdown,dropdown_keywords,multi_dropdown,radios,radios_buttons,checkboxes,checkboxes_buttons,range,single_slider’),1054 ),1055 array(1056 “type” => "select",1057 “name” => "order",1058 “title” => esc_html__("Order direction", “WCSEARCH”),1059 “options” => array(1060 “ASC” => esc_html__("ASC", “WCSEARCH”),1061 “DESC” => esc_html__("DESC", “WCSEARCH”),1062 ),1063 “value” => "ASC",1064 “dependency” => array(1065 ‘mode’ => 'dropdown,dropdown_keywords,multi_dropdown,radios,radios_buttons,checkboxes,checkboxes_buttons,range,single_slider’,1066 ‘orderby’ => 'name,count’,1067 ),1068 ),1069 array(1070 “type” => "select",1071 “name” => "hide_empty",1072 “title” => esc_html__("Hide empty", “WCSEARCH”),1073 “options” => array(1074 “0” => esc_html__("No", “WCSEARCH”),1075 “1” => esc_html__("Yes", “WCSEARCH”),1076 ),1077 “value” => "0",1078 ),1079 array(1080 “type” => "select",1081 “name” => "counter",1082 “title” => esc_html__("Show counter", “WCSEARCH”),1083 “options” => array(1084 “0” => esc_html__("No", “WCSEARCH”),1085 “1” => esc_html__("Yes", “WCSEARCH”),1086 ),1087 “value” => "1",1088 ),1089 array(1090 “type” => "exact_terms",1091 “name” => "is_exact_terms",1092 “title” => esc_html__("Set specific terms", “WCSEARCH”),1093 “description” => esc_html__("Show all terms or select specific (dependent on max depth level)", “WCSEARCH”),1094 “options” => array(1095 0 => esc_html__("All terms", “WCSEARCH”),1096 1 => esc_html__("Specific terms", “WCSEARCH”),1097 ),1098 ),1099 array(1100 “type” => "dependency",1101 “name” => "dependency_tax",1102 “title” => esc_html__("Dependency", “WCSEARCH”),1103 “description” => esc_html__("The field will be dependent from selected tax", “WCSEARCH”),1104 “options” => array(1105 0 => esc_html__("No dependency", “WCSEARCH”),1106 ),1107 ),1108 array(1109 “type” => "select",1110 “name” => "dependency_visibility",1111 “title” => esc_html__("Dependency visibility", “WCSEARCH”),1112 “options” => array(1113 “0” => esc_html__("Hidden", “WCSEARCH”),1114 “1” => esc_html__("Shaded", “WCSEARCH”),1115 ),1116 “value” => "1",1117 “dependency” => array(“dependency_tax” => “”),1118 ),1119 ),1120 “featured” => array(1121 array(1122 “type” => "string",1123 “name” => "label",1124 “title” => esc_html__("Label text", “WCSEARCH”),1125 “value” => esc_html__(“featured”),1126 ),1127 array(1128 “type” => "select",1129 “name” => "align",1130 “title” => esc_html__("Align", “WCSEARCH”),1131 “options” => array(1132 “left” => esc_html__("Left", “WCSEARCH”),1133 “center” => esc_html__("Center", “WCSEARCH”),1134 “right” => esc_html__("Right", “WCSEARCH”),1135 ),1136 “value” => "left",1137 ),1138 array(1139 “type” => "select",1140 “name” => "counter",1141 “title” => esc_html__("Show counter", “WCSEARCH”),1142 “options” => array(1143 “0” => esc_html__("No", “WCSEARCH”),1144 “1” => esc_html__("Yes", “WCSEARCH”),1145 ),1146 “value” => "0",1147 ),1148 ),1149 “instock” => array(1150 array(1151 “type” => "string",1152 “name” => "label",1153 “title” => esc_html__("Label text", “WCSEARCH”),1154 “value” => esc_html__(“in stock”),1155 ),1156 array(1157 “type” => "select",1158 “name” => "align",1159 “title” => esc_html__("Align", “WCSEARCH”),1160 “options” => array(1161 “left” => esc_html__("Left", “WCSEARCH”),1162 “center” => esc_html__("Center", “WCSEARCH”),1163 “right” => esc_html__("Right", “WCSEARCH”),1164 ),1165 “value” => "left",1166 ),1167 array(1168 “type” => "select",1169 “name” => "counter",1170 “title” => esc_html__("Show counter", “WCSEARCH”),1171 “options” => array(1172 “0” => esc_html__("No", “WCSEARCH”),1173 “1” => esc_html__("Yes", “WCSEARCH”),1174 ),1175 “value” => "0",1176 ),1177 ),1178 “onsale” => array(1179 array(1180 “type” => "string",1181 “name” => "label",1182 “title” => esc_html__("Label text", “WCSEARCH”),1183 “value” => esc_html__(“on sale”),1184 ),1185 array(1186 “type” => "select",1187 “name” => "align",1188 “title” => esc_html__("Align", “WCSEARCH”),1189 “options” => array(1190 “left” => esc_html__("Left", “WCSEARCH”),1191 “center” => esc_html__("Center", “WCSEARCH”),1192 “right” => esc_html__("Right", “WCSEARCH”),1193 ),1194 “value” => "left",1195 ),1196 array(1197 “type” => "select",1198 “name” => "counter",1199 “title” => esc_html__("Show counter", “WCSEARCH”),1200 “options” => array(1201 “0” => esc_html__("No", “WCSEARCH”),1202 “1” => esc_html__("Yes", “WCSEARCH”),1203 ),1204 “value” => "0",1205 ),1206 ),1207 “ratings” => array(1208 array(1209 “type” => "string",1210 “name” => "title",1211 “title” => esc_html__("Label text", “WCSEARCH”),1212 “value” => esc_html__(“By ratings”),1213 ),1214 array(1215 “type” => "select",1216 “name” => "visible_status",1217 “title” => esc_html__("Visible", “WCSEARCH”),1218 “options” => array(1219 “always_opened” => esc_html__("Always opened", “WCSEARCH”),1220 “opened” => esc_html__("Opened", “WCSEARCH”),1221 “closed” => esc_html__("Closed", “WCSEARCH”),1222 “always_closed” => esc_html__("Always closed", “WCSEARCH”),1223 “more_filters” => esc_html__("In ‘more filters’ section", “WCSEARCH”),1224 ),1225 “value” => "always_opened",1226 ),1227 array(1228 “type” => "select",1229 “name” => "counter",1230 “title” => esc_html__("Show counter", “WCSEARCH”),1231 “options” => array(1232 “0” => esc_html__("No", “WCSEARCH”),1233 “1” => esc_html__("Yes", “WCSEARCH”),1234 ),1235 “value” => "0",1236 ),1237 array(1238 “type” => "color",1239 “name” => "stars_color",1240 “title” => esc_html__("Stars color", “WCSEARCH”),1241 “value” => "#FFB300",1242 ),1243 ),1244 “hours” => array(1245 array(1246 “type” => "string",1247 “name” => "label",1248 “title” => esc_html__("Label text", “WCSEARCH”),1249 “value” => esc_html__(“open now”),1250 ),1251 array(1252 “type” => "select",1253 “name” => "display",1254 “title” => esc_html__("Display as", “WCSEARCH”),1255 “options” => array(1256 “checkbox” => esc_html__("Checkbox", “WCSEARCH”),1257 “button” => esc_html__("Button", “WCSEARCH”),1258 ),1259 “value” => "checkbox",1260 ),1261 array(1262 “type” => "select",1263 “name” => "align",1264 “title” => esc_html__("Align", “WCSEARCH”),1265 “options” => array(1266 “left” => esc_html__("Left", “WCSEARCH”),1267 “center” => esc_html__("Center", “WCSEARCH”),1268 “right” => esc_html__("Right", “WCSEARCH”),1269 ),1270 “value” => "left",1271 “dependency” => array(“display” => “checkbox”),1272 ),1273 array(1274 “type” => "select",1275 “name” => "counter",1276 “title” => esc_html__("Show counter", “WCSEARCH”),1277 “options” => array(1278 “0” => esc_html__("No", “WCSEARCH”),1279 “1” => esc_html__("Yes", “WCSEARCH”),1280 ),1281 “value” => "0",1282 ),1283 ),1284);128512861287add_filter("init", "wcsearch_set_default_model_settings", 1);1288add_filter("admin_init", "wcsearch_set_default_model_settings", 1);1289function wcsearch_set_default_model_settings() {1290 global $wcsearch_default_model_settings;1291 1292 $wcsearch_default_model_settings = array(1293 ‘model’ => array(1294 ‘placeholders’ => array(1295 array(1296 “columns” => 1,1297 “rows” => 1,1298 “input” => "",1299 ),1300 ),1301 ),1302 ‘columns_num’ => 1,1303 ‘bg_color’ => "",1304 ‘bg_transparency’ => 100,1305 ‘text_color’ => "#666666",1306 ‘elements_color’ => "#428BCA",1307 ‘elements_color_secondary’ => "#275379",1308 ‘use_overlay’ => 0,1309 ‘on_shop_page’ => 0,1310 ‘auto_submit’ => 0,1311 ‘use_border’ => 1,1312 ‘scroll_to’ => '’, // products1313 ‘sticky_scroll’ => 0,1314 ‘sticky_scroll_toppadding’ => 0,1315 ‘use_ajax’ => 1,1316 ‘target_url’ => ‘’,1317 ‘used_by’ => wcsearch_get_default_used_by(), // wc, w2dc, w2gm, w2mb1318 1319 );1320}13211322add_filter("admin_init", “wcsearch_filter_model_options”);1323function wcsearch_filter_model_options() {1324 global $wcsearch_model_options;13251326 $taxes = wcsearch_get_all_taxonomies();1327 $tax_names = wcsearch_get_all_taxonomies_names();13281329 foreach ($wcsearch_model_options AS $type=>$options) {13301331 // add taxonomies in dependency fields1332 //1333 // “categories” instead of "w2dc-category",1334 // “locations” instead of "w2dc-location",1335 // “tags” instead of "w2dc-tag"1336 foreach ($options AS $key=>$option) {1337 if ($option[‘type’] == ‘dependency’) {1338 foreach ($taxes AS $tax_slug=>$tax_name) {1339 $wcsearch_model_options[$type][$key][‘options’][$tax_name] = $tax_names[$tax_slug];1340 }1341 }1342 }13431344 // add “Single dropdown + address” option in mode1345 if (wcsearch_geocode_functions()) {1346 if ($type == ‘tax’) {1347 foreach ($options AS $key=>$option) {1348 if ($option[‘name’] == ‘mode’) {1349 $arr = $wcsearch_model_options[$type][$key][“options”];1350 1351 $arr = array_slice($arr, 0, 2, true) +1352 array(“dropdown_address” => esc_html__(“Single dropdown + address", “WCSEARCH”)) +1353 array_slice($arr, 2, count($arr)-2, true);13541355 $wcsearch_model_options[$type][$key][“options”] = $arr;1356 }1357 }1358 }1359 }1360 }1361}13621363class wcsearch_search_forms_manager {1364 1365 public function __construct() {1366 add_action('add_meta_boxes’, array($this, ‘addSearchFormMetabox’));1367 1368 add_filter('manage_’.WCSEARCH_FORM_TYPE.’_posts_columns’, array($this, ‘add_wcsearch_table_columns’));1369 add_filter('manage_’.WCSEARCH_FORM_TYPE.’_posts_custom_column’, array($this, ‘manage_wcsearch_table_rows’), 10, 2);1370 1371 add_filter('post_row_actions’, array($this, ‘duplicate_form_link’), 10, 2);1372 add_action('admin_action_wcsearch_duplicate_form’, array($this, ‘duplicate_form’));1373 1374 add_action('wp_ajax_wcsearch_tax_dropdowns_hook’, ‘wcsearch_tax_dropdowns_updateterms’);1375 add_action('wp_ajax_nopriv_wcsearch_tax_dropdowns_hook’, ‘wcsearch_tax_dropdowns_updateterms’);1376 1377 if (isset($_POST[‘submit’]) && isset($_POST[‘post_type’]) && $_POST[‘post_type’] == WCSEARCH_FORM_TYPE) {1378 add_action(‘save_post_’ . WCSEARCH_FORM_TYPE, array($this, ‘saveForm’), 10, 3);1379 }1380 }1381 1382 public function duplicate_form_link($actions, $post) {1383 if ($post->post_type == WCSEARCH_FORM_TYPE) {1384 $actions[‘duplicate’] = ‘<a href="’ . wp_nonce_url(‘admin.php?action=wcsearch_duplicate_form&post=’ . $post->ID, basename(__FILE__), ‘duplicate_nonce’) . '” title="’ . __("Make duplicate", “W2DC”) . ‘">’ . __("Make duplicate", “W2DC”) . '</a>’;1385 }1386 1387 return $actions;1388 }1389 1390 public function duplicate_form() {1391 global $wpdb;1392 1393 if (empty($_GET[‘post’])) {1394 wp_die(‘No post to duplicate has been supplied!’);1395 }1396 1397 if (!isset($_GET[‘duplicate_nonce’]) || !wp_verify_nonce($_GET[‘duplicate_nonce’], basename(__FILE__))) {1398 return;1399 }1400 1401 $post_id = $_GET[‘post’];1402 $post = get_post($post_id);1403 1404 $current_user = wp_get_current_user();1405 $new_post_author = $current_user->ID;1406 1407 if (isset($post) && $post != null) {1408 $args = array(1409 ‘comment_status’ => $post->comment_status,1410 ‘ping_status’ => $post->ping_status,1411 ‘post_author’ => $new_post_author,1412 ‘post_content’ => $post->post_content,1413 ‘post_excerpt’ => $post->post_excerpt,1414 ‘post_name’ => $post->post_name . "-duplicate",1415 ‘post_parent’ => $post->post_parent,1416 ‘post_password’ => $post->post_password,1417 ‘post_status’ => 'publish’,1418 ‘post_title’ => $post->post_title . " (duplicate)",1419 ‘post_type’ => $post->post_type,1420 ‘to_ping’ => $post->to_ping,1421 ‘menu_order’ => $post->menu_order1422 );1423 $new_post_id = wp_insert_post( $args );1424 1425 $post_meta_infos = $wpdb->get_results(“SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post_id”);1426 if (count($post_meta_infos)) {1427 $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";1428 foreach ($post_meta_infos as $meta_info) {1429 $meta_key = $meta_info->meta_key;1430 if ($meta_key == ‘_wp_old_slug’) {1431 continue;1432 }1433 $meta_value = addslashes($meta_info->meta_value);1434 $sql_query_sel[]= "SELECT $new_post_id, '$meta_key’, '$meta_value’";1435 }1436 $sql_query.= implode(" UNION ALL ", $sql_query_sel);1437 $wpdb->query($sql_query);1438 }1439 1440 wp_redirect(admin_url(‘post.php?action=edit&post=’ . $new_post_id));1441 die();1442 } else {1443 wp_die('Post creation failed, could not find original post: ' . $post_id);1444 }1445 }1446 1447 public function addSearchFormMetabox($post_type) {1448 if ($post_type == WCSEARCH_FORM_TYPE) {1449 remove_meta_box('submitdiv’, WCSEARCH_FORM_TYPE, ‘side’);1450 1451 add_meta_box('wcsearch_form’,1452 __('Search Form’, ‘WCSEARCH’),1453 array($this, ‘searchFormMetabox’),1454 WCSEARCH_FORM_TYPE,1455 'normal’,1456 ‘high’);1457 }1458 }1459 1460 public function searchFormMetabox($post) {1461 global $wcsearch_default_model_settings;1462 1463 wp_enqueue_script(‘jquery-ui-draggable’);1464 wp_enqueue_script(‘jquery-ui-sortable’);1465 wp_enqueue_script(‘jquery-ui-droppable’);1466 wp_enqueue_script(‘jquery-ui-slider’);1467 wp_enqueue_script(‘jquery-ui-datepicker’);1468 wp_enqueue_style(‘wp-color-picker’);1469 wp_enqueue_script(‘wp-color-picker’);1470 1471 $model = get_post_meta($post->ID, '_model’, true);1472 1473 $search_form_data = array();1474 if (!$model) {1475 // default model1476 foreach ($wcsearch_default_model_settings AS $setting=>$value) {1477 $search_form_data[$setting] = $value;1478 }1479 1480 $model = $search_form_data[‘model’];1481 } else {1482 $model = json_decode($model, true);1483 1484 foreach ($wcsearch_default_model_settings AS $setting=>$value) {1485 if (metadata_exists('post’, $post->ID, '_’.$setting)) {1486 $search_form_data[$setting] = get_post_meta($post->ID, '_’.$setting, true);1487 } else {1488 $search_form_data[$setting] = $wcsearch_default_model_settings[$setting];1489 }1490 }1491 }1492 1493 if (wcsearch_getValue($_GET, ‘export’)) {1494 echo '<textarea style="width: 100%; height: 500px;">’;1495 echo "{";1496 $key_value_pair = array();1497 foreach ($search_form_data AS $setting=>$val) {1498 $key_value_pair[] = '"’.esc_attr($setting).’":"’.addslashes($val).’"’;1499 }1500 echo implode(",", $key_value_pair);1501 echo "}";1502 echo '</textarea>’;1503 }1504 1505 $search_form_model = new wcsearch_search_form_model($model[‘placeholders’], $search_form_data[‘used_by’]);1506 1507 wcsearch_renderTemplate('search_form_model.tpl.php’,1508 array(1509 ‘wcsearch_model’ => $model,1510 ‘search_form_model’ => $search_form_model,1511 ‘search_form_data’ => $search_form_data,1512 )1513 );1514 }1515 1516 public function saveForm($post_ID, $post, $update) {1517 global $wcsearch_default_model_settings;1518 1519 foreach ($wcsearch_default_model_settings AS $setting=>$value) {1520 update_post_meta($post_ID, '_’.$setting, wcsearch_getValue($_POST, $setting));1521 }1522 }1523 1524 public function add_wcsearch_table_columns($columns) {1525 global $wcsearch_instance;1526 1527 $wcsearch_columns[‘wcsearch_shortcode’] = __(‘Shortcode’, ‘WCSEARCH’);1528 1529 return array_slice($columns, 0, 2, true) + $wcsearch_columns + array_slice($columns, 2, count($columns)-2, true);1530 }1531 1532 public function manage_wcsearch_table_rows($column, $post_id) {1533 switch ($column) {1534 case "wcsearch_shortcode":1535 echo '[‘.WCSEARCH_MAIN_SHORTCODE.’ id=’ . esc_attr($post_id) . ']';1536 break;1537 }1538 }1539}15401541?>

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907