BP Nearby Members
A premium WordPress plugin that adds geolocation-based member discovery to BuddyPress. Find and connect with members nearby using an interactive map.
by WBCom Designs · github.com/divangrastogi/bp-nearby-members · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/divangrastogi/bp-nearby-members/archive/refs/heads/main.zipA premium WordPress plugin that adds geolocation-based member discovery to BuddyPress. Find and connect with members nearby using an interactive map.
Features
- Interactive Map: Display nearby members on a responsive map
- Geolocation Support: Automatic location detection and manual address search
- Advanced Filtering: Filter by distance, online status, gender, interests
- Multiple Map Providers: Support for Leaflet (free) and Google Maps
- REST API: Full REST API for integration with other systems
- Privacy Controls: Granular privacy settings for location sharing
- Performance Optimized: Caching, lazy loading, and database optimization
- Translation Ready: Full internationalization support
- Accessibility: WCAG 2.1 AA compliant
Installation
- Upload the
bp-nearby-membersfolder to/wp-content/plugins/ - Activate the plugin through the WordPress admin
- Configure settings under Settings > BP Nearby Members
- Add the shortcode
[bp_nearby_members]to any page
Requirements
- WordPress 6.0+
- BuddyPress 12.0+
- PHP 7.4+
- MySQL 5.6+
Configuration
Basic Setup
- Go to Settings > BP Nearby Members
- Configure general settings (default location, radius, etc.)
- Set up geocoding provider (OpenStreetMap recommended for free usage)
- Configure privacy settings
Advanced Configuration
- Geocoding: Choose between OpenStreetMap, Google Maps, or Mapbox
- Map Provider: Select Leaflet for free usage or Google Maps for premium features
- Caching: Adjust cache duration for performance optimization
- API Keys: Add API keys for premium geocoding/map services
Usage
Shortcodes
[bp_nearby_members radius="10" height="500px"]
PHP Code
<?php
$query = BPNM_Query::get_instance();
$members = $query->get_nearby_members(array(
'latitude' => 28.6139,
'longitude' => 77.2090,
'radius' => 10
));
?>
REST API
GET /wp-json/bp-nearby/v1/members?lat=28.6139&lng=77.2090&radius=10
Hooks & Filters
Actions
bpnm_before_location_update- Before updating user locationbpnm_after_location_update- After updating user locationbpnm_geocode_failed- When geocoding failsbpnm_map_loaded- When map is loaded
Filters
bpnm_nearby_members_query_args- Modify query argumentsbpnm_marker_icon_url- Customize marker iconsbpnm_member_distance_display- Format distance displaybpnm_geocoding_provider- Change geocoding providerbpnm_max_search_radius- Set maximum search radius
Templates
Override templates by creating files in your theme:
your-theme/
├── bp-nearby-members/
│ ├── nearby-members-map.php
│ ├── nearby-members-list.php
│ └── member-location-settings.php
Security
- All inputs are sanitized and validated
- Nonces used for all AJAX requests and forms
- Prepared statements for all database queries
- Capability checks for all operations
- Output escaping for security
Performance
- Database queries optimized with bounding box pre-filtering
- Object caching for frequently accessed data
- Lazy loading for map assets
- Minified CSS/JS in production
Privacy & GDPR
- Location sharing is opt-in by default
- Users can control location visibility
- Data export functionality available
- Automatic data cleanup on uninstall
Troubleshooting
Common Issues
- Map not loading: Check console for JavaScript errors
- Geocoding failing: Verify API keys and provider settings
- No members showing: Check location sharing settings
- Performance issues: Adjust caching settings
Debug Mode
Enable debugging by adding to wp-config.php:
define('BPNM_DEBUG', true);
Changelog
1.0.0
- Initial release
- Basic geolocation functionality
- Map integration
- REST API
- Admin settings
Support
For support, please visit the support forum or contact WBCom Designs.
License
GPL-2.0+
Credits
Developed by WBCom Designs