WP Manifestindependent plugin directory
manifest / developer / pr-plugin-similiar-properties

PBCR Similar Properties Filter

Filters similar properties to match only by deepest child/grandchild locations, excluding parent terms.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/gianfranco2605/pr-plugin-similiar-properties/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A WordPress plugin that filters similar properties queries to match only by deepest child/grandchild locations, excluding top-level parent terms.

Description

This plugin modifies the similar properties query in RealHomes theme to ensure that properties only match based on their deepest location hierarchy level. For example:

  • If a property has "Perrine" (child of Miami), it will only match other "Perrine" properties, not "Miami" properties
  • If a property has "Test" (grandchild: Miami → Little Havana → Test), it will match other "Test" properties AND "Little Havana" properties, but not "Miami" properties
  • If a property has a great-grandchild term, it will match other great-grandchildren AND their parent grandchildren

Features

  • Filters out top-level parent terms from similar properties queries
  • Uses the deepest child/grandchild/great-grandchild term available
  • Includes the direct parent of deepest terms (if parent is not top-level)
  • Comprehensive debug logging (can be disabled)
  • Clean, object-oriented code structure
  • Follows WordPress coding standards

Installation

  1. Upload the pbcr-similar-properties folder to /wp-content/plugins/
  2. Activate the plugin through the 'Plugins' menu in WordPress

Requirements

  • WordPress 6.4+
  • PHP 8.2+
  • RealHomes theme (or compatible theme using inspiry_similar_properties_filter hook)

How It Works

The plugin hooks into the inspiry_similar_properties_filter filter and:

  1. Calculates the depth of each term assigned to the property
  2. Finds the deepest term(s) (child, grandchild, great-grandchild, etc.)
  3. Includes the deepest term(s) and their direct parents (if parent is not top-level)
  4. Excludes all top-level parent terms

Debug Mode

Debug logging is disabled by default in production. To enable it for troubleshooting, edit includes/SimilarPropertiesFilter.php and set:

private $debug_mode = true;

Debug logs are written to wp-content/debug.log (requires WP_DEBUG_LOG to be enabled in wp-config.php).

Note: Debug mode should only be enabled temporarily for troubleshooting purposes as it can impact performance.

Changelog

1.0.0

  • Initial release
  • Filter similar properties by deepest child/grandchild locations
  • Exclude top-level parent terms
  • Include parent of deepest terms when applicable