Releases: pixelwatt/method-search-tools
Releases · pixelwatt/method-search-tools
Release list
v1.0.1
[1.0.1] - 2026-09-21
Fixed
- Meta search never activated.
meta-search.phpused
function_exists( 'method_search_context' )as its double-load guard. PHP
binds top-level function declarations at compile time, so the check was
already true on first load and the file returned before registering its
posts_join/posts_search/posts_fields/posts_orderbyfilters.
The guard is now a constant (METHOD_META_SEARCH_LOADED), and the
implementation moved tometa-search-functions.phpso a second copy can't
trigger a compile-time "Cannot redeclare" fatal. -termexclusions. The rebuiltposts_searchclause now strips core's
exclusion prefix (honoringwp_query_search_exclusion_prefix) and emits
NOT LIKEacross title, excerpt, content, and meta columns. Meta columns
are wrapped inCOALESCE()so posts with no matching meta aren't wrongly
excluded by the LEFT JOIN's NULLs. Excluded terms are omitted from
relevance scoring.- Missing
method_relevancealias. The alias is now always selected
(0when nothing is scorable), so exclusion-only searches can't produce
anORDER BYon a nonexistent column. - Long meta values truncated in search.
GROUP_CONCATwas capped at
MySQL's defaultgroup_concat_max_len(1024 bytes). It's now raised to
1 MB per connection, once per request.
Security
- Added
ABSPATHguards tomethod-search-tools.phpandmeta-search.php. mf[]sanitization is type-strict. Array-for-scalar input
(mf[venue][]=x,mf[date][after][]=x) and scalar-for-array input are
rejected before any cast, removing "Array to string conversion" warnings
triggered by crafted URLs. Non-finite range bounds (e.g.1e999) are
rejected.- Checkbox filters: nested arrays are dropped, values are de-duplicated, and
submissions are capped at 50 values per filter. The cap only takes effect
for checkbox filters without enumerable options, since the option
whitelist already bounds the rest.
Changed
- Checkbox sanitization preserves
"0"as a valid value (previously
dropped byarray_filter).
Added
- Filter
method_search_group_concat_max_len(int, default1048576).
Return0to leave the server default. - Filter
method/search_filters/max_checkbox_values(int, default50).
Receives$max, $filter_key, $post_type.
Upgrade notes
- Meta search is live for the first time in this release. Expect relevance
ordering and result sets to change on sites with
method_search_meta_weightsconfigured, and check search query time on
staging. - If a theme bundles its own copy of the old single-file
meta-search.php,
update it too. An old copy loaded alongside this version will fatal on
redeclaration.