=== BP Groups CiviCRM Sync ===
Contributors: needle, cuny-academic-commons
Donate link: https://www.paypal.me/interactivist
Tags: civicrm, buddypress, user, groups, sync
Requires at least: 4.9
Tested up to: 6.8
Stable tag: 0.5.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

Enables two-way synchronisation between BuddyPress groups and CiviCRM groups.



== Description ==

The *BP Groups CiviCRM Sync* plugin provides two-way synchronisation between *CiviCRM* Groups and *BuddyPress* Groups. For each *BuddyPress* Group, the plugin will automatically create two *CiviCRM* Groups:

* A "Member Group" (of type "Mailing List") containing a Contact record for each corresponding *BuddyPress* Group Member. This Group is assigned the same name as the linked *BuddyPress* Group.
* An "ACL Group" (of type "Access Control") containing the Contact records of the Administrators of the corresponding *BuddyPress* Group. This gives *BuddyPress* Group Administrators the ability to view and edit their Group Members in *CiviCRM*.

When a new Member is added to (or joins) a *BuddyPress* Group, they are automatically added to the corresponding *CiviCRM* Group. Likewise, when a Contact is added to the  *CiviCRM* "Member Group", they will be added as a Member to the corresponding *BuddyPress* Group. If a Contact is added to the *CiviCRM* "ACL Group", they will be added to the *BuddyPress* Group as an Administrator.

This plugin works in a similar way to the [Drupal *Organic Groups CiviCRM* module](https://civicrm.org/blog/lobo/civicrm-and-og-organic-groups). Existing Groups in *CiviCRM* that were generated by the Drupal *Organic Groups CiviCRM* module can be migrated to become *BuddyPress*-compatible *CiviCRM* Groups.

### Requirements

This plugin requires a minimum of *WordPress 4.9*, *BuddyPress 2.3* and *CiviCRM 5.19*. Having the latest version of each plugin active is, of course, highly recommended.

### Plugin Development

This plugin is in active development. For feature requests and bug reports (or if you're a plugin author and want to contribute) please visit the plugin's [GitHub repository](https://github.com/christianwach/bp-groups-civicrm-sync).



== Installation ==

1. Extract the plugin archive
1. Upload plugin files to your `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. In Multisite, it is recommended that you network-activate the plugin



== Changelog ==

= 0.5.4 =

* Fixes PHP warning

= 0.5.3 =

* Reworks BuddyPress Group Member logic to use before and after SQL hooks
* Accounts for Group Admins leaving via the Groups Directory button

= 0.5.2 =

* Fixes CiviCRM API error check

= 0.5.1 =

* Fixes fatal error on activation and deactivation

= 0.5.0 =

* Fixes CiviCRM ACL methods after CiviCRM changed underlying data
* Introduces WP-CLI sync commands
* Introduces WordPress pseudo-cron sync schedule

= 0.4.4 =

* Tested with latest WordPress

= 0.4.3 =

* Removes a possibly recursive CiviCRM initialisation call

= 0.4.2 =

* Fixes possible error on activation

= 0.4.1 =

* Fixes broken "Settings" link
* Adds token for Manual Sync

= 0.4 =

* Fixes CiviCRM ACLs for Groups
* Prevents errors when BP Groups component not active
* Relocates admin page menu item

= 0.3.7 =

* Adds filter to exclude BuddyPress groups from sync
* Fixes ACL group membership sync
* Disables the UI for creating a BuddyPress Group from a CiviCRM Group - create a BuddyPress Group instead

= 0.3.6 =

* Improves plugin loading procedure
* Better code documentation

= 0.3.5 =

* Fixes sync procedure hanging when errors are encountered

= 0.3.4 =

* Drops support for CiviCRM 4.5
* Fixes membership of ACL Group for BuddyPress group admins

= 0.3.3 =

* Fixes CiviCRM "Mailing List" group type on BuddyPress group creation

= 0.3.2 =

* Make usernames URL-friendly

= 0.3.1 =

* Fixes empty WordPress user emails when Contacts are added to groups via "New Individual" form
* Updates hook references for CiviCRM 4.7.x instances

= 0.3 =

* AJAX-driven BuddyPress to CiviCRM sync
* Fixed sync recursion errors
* Fixed sync when using Groups admin page

= 0.2.1 =

Set "Use Parent Group" to off by default

= 0.2 =

First public release

= 0.1 =

Initial release
