Skip to content

v1.0.1

Latest

Choose a tag to compare

@pixelwatt pixelwatt released this 21 Sep 16:03

[1.0.1] - 2026-09-21

Fixed

  • Meta search never activated. meta-search.php used
    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_orderby filters.
    The guard is now a constant (METHOD_META_SEARCH_LOADED), and the
    implementation moved to meta-search-functions.php so a second copy can't
    trigger a compile-time "Cannot redeclare" fatal.
  • -term exclusions. The rebuilt posts_search clause now strips core's
    exclusion prefix (honoring wp_query_search_exclusion_prefix) and emits
    NOT LIKE across title, excerpt, content, and meta columns. Meta columns
    are wrapped in COALESCE() 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_relevance alias. The alias is now always selected
    (0 when nothing is scorable), so exclusion-only searches can't produce
    an ORDER BY on a nonexistent column.
  • Long meta values truncated in search. GROUP_CONCAT was capped at
    MySQL's default group_concat_max_len (1024 bytes). It's now raised to
    1 MB per connection, once per request.

Security

  • Added ABSPATH guards to method-search-tools.php and meta-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 by array_filter).

Added

  • Filter method_search_group_concat_max_len (int, default 1048576).
    Return 0 to leave the server default.
  • Filter method/search_filters/max_checkbox_values (int, default 50).
    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_weights configured, 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.