Memberpress + WP Discourse (Groups Management)

I just had a look at the code. In case it’s not clear, the Memberpress Sync plugin depends on code from the WP Discourse plugin: WP Discourse – WordPress plugin | That means you will also need to install, activate and configure the WP Discourse plugin: Connect WP Discourse to Discourse. You will also need to configure your WordPress site as the DiscourseConnect provider for your Discourse site. Details about setting that up are here: Configure single sign-on (SSO) with WP Discourse and DiscourseConnect.

There’s something in the Memberpress Sync plugin that I’m not sure about. It looks to me as though there are two Memberpress Product IDs and two Discourse groups hard coded into the plugin’s code:

I think you will need to make some changes to that file. The values in the array that’s defined by PV_MEMBERPRESS_PRODUCT_IDS will need to be set to your site’s subscription IDs. You will also need to set the PV_DISCOURSE_ENROLLED_GROUP and PV_DISCOURSE_UNENROLLED_GROUP definitions to groups that exist on your Discourse site.

It seems that the plugin adds any users who have an active subscription for any of your products to the PV_DISCOURSE_ENROLLED_GROUP. If a user who had one or more active subscriptions then has all their subscriptions expire, they will be removed from the PV_DISCOURSE_ENROLLED_GROUP and added to the PV_DISCOURSE_UNENROLLED_GROUP.

Maybe @fzngagan can confirm if this is correct? If it is, it will be fairly straightforward to setup the code for @earlysound’s site. It’s possible I’m misunderstanding how the plugin works though. I don’t have a copy of the Memberpress plugin. If I could get access to a development version of Memberpress, I could test it out myself.

1 Like