Monthly Archives: April 2019

BP Profile Search 5.0.2

When you search your Members directory for City is: London, there is no doubt that all the members in your search results live in London. There is no need to show the value of the City field, or to order the search results by City.

But if you search for City is: London OR Paris, or for City contains: York, then you can’t say where a member in your search results actually lives. In these cases BP Profile Search 5.0.2 shows the value of the City field, and offers the option to sort your search results by City.

You can disable this feature if you don’t need it. Simply add this code to your bp-custom.php file:

add_filter ('bps_sort_options', 'change_sort_options');
function change_sort_options ($sort_options)
{
	$sort_options = array ();
	return $sort_options;
}

add_filter ('bps_details', 'change_details');
function change_details ($details)
{
	$details = array ();
	return $details;
}

The [bps_directory] shortcode allows you to activate this feature independently of the current search.

[bps_directory show='field_4,field_36' order_by='field_4,field_40']

shows the fields with ID 4 and 36 in all your directory (or search results) entries, and offers the option to sort your directory (or search results) by the fields with ID 4 and 40.

Please note that [bps_directory] is not a standard shortcode. You can enter it in a new page, and you’ll get a new Members directory, or you can enter it in the standard Members directory page, and you’ll be able to customize the standard Members directory itself.

BP Profile Search 5.0.2 also fixes a potentially nasty privacy problem. This involves a possible backwards incompatibility, see Potential privacy problem fixed in 5.0.2 for details.

And, last but not least, version 5.0.2 features a much improved compatibility with GEO my WordPress. Enjoy!

Potential privacy problem fixed in 5.0.2

Note: If you are not using a link to run a search, you are not affected by this change, and you can upgrade BP Profile Search as usual.

BP Profile Search (BPS) allows to run a search from a link, a menu item, or a bookmark, using the members directory URL with a custom query string. The query string is the same string that BPS generates when you choose Form Method: GET in the Form Settings box.

The query string contains the ID of the form that generates the search. Previous BPS versions didn’t check the form ID, so users could manipulate the query string to run any possible search on your member profiles, even on fields with restricted visibility.

To fix this potential privacy breach, BP Profile Search 5.0.2 checks the form ID in the query string, and allows only the searches specified in that form.

The price of the fix is a backwards incompatibility if you are using a link to run a search on your site. In this case, you have to check that link and make sure it uses a valid form ID. For instance, if you used a link like:

http://your-site/members/?field_1_contains=john&bp_profile_search=50

make sure that your form with ID 50 allows for that search, and replace that link with:

http://your-site/members/?field_1_contains=john&bps_form=50

If you used a link like:

http://your-site/members/?field_1_contains=john&bp_profile_search

create a new search form that allows for that search, and replace that link with:

http://your-site/members/?field_1_contains=john&bps_form=75

where 75 is your new search form ID.

Please note that the key bp_profile_search is replaced by the key bps_form.

As already mentioned, if you are not using a link to run a search you are not affected by this change.