froger-me/wp-weixin

关于打开网站强制关注问题

Closed this issue · 2 comments

我想了解下如一个用户在第一次打开网站关注了公众号,然后再取消关注公众号,如何实现第二次打开网站时还需要关注?

我现在遇到的问题是取消关注后还能继续打开网站!

万分感谢!

Hi @leadroy !

The user is remembered as being a follower in the user metadata with key wx_follower for 1 hour before checking again for performance reasons: doing the check at every page load would lead to an unacceptable page load time.

It is possible to remove that metadata automatically, but that requires the use of the WeChat Responder in the WP Weixin settings. The WeChat Responder catches events sent by WeChat, and unsubscribe is one of the events WP Weixin actually reacts to without extra code, but it comes with a trade-off: it removes auto-reply and official Account menu management features in the WeChat backend ; the Official Account menu can be set in WordPress "WeChat Official Account menu" display location, but for the auto-reply it would be up to you (or another developer) to catch the events and reimplement the feature using the WeChat API.

If you do not want to use the WeChat Responder (for example, because you do not care about the welcome message feature, do not plan to catch events with custom code, and want to keep the auto-reply and menu management features in the WeChat backend), then the system has no way to determine when a user unsubscribed, and needs to wait 1 hour before checking if the user is a follower or not.

Is the responder activated on your site?

Hi @leadroy !
Any update? Is the responder activated on your site and do you still have the problem?

If this issue doesn't receive more info before April 3rd, I'll close it.